thecodingmachine / magic-query

A very clever library to use SQL prepared statement with a variable number of parameters... and much more!
http://mouf-php.com/packages/mouf/magic-query/README.md
22 stars 14 forks source link

Fixing an issue if there is no alias in subquery #69

Closed moufmouf closed 4 years ago

moufmouf commented 4 years ago

This PR fixes an issue with query of the type:

SELECT COUNT(*) FROM (SELECT DISTINCTstates.country_id,states.codeFROM states)

(with no alias in the subquery).

Starts with a failing test

coveralls commented 4 years ago

Coverage Status

Coverage increased (+0.7%) to 70.681% when pulling 306f4f4c3bfa5a2b00c7d230a6e91c1055a549c3 on moufmouf:fix_another_alias into 1294fd874c314fed0f0bf1cdc4f7e335d824950b on thecodingmachine:1.4.