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

Case statement in where condition is removed by magic parameters #50

Closed moufmouf closed 5 years ago

moufmouf commented 5 years ago

For some reason, the case statement is removed from a where condition.

SELECT a FROM users u WHERE status = (CASE WHEN u.id = 1 THEN u.status_1 ELSE u.status_2 END)

=>

SELECT a FROM users u

This is a failing test showcasing the issue.

coveralls commented 5 years ago

Coverage Status

Coverage increased (+0.06%) to 68.453% when pulling e1b88d44687f545cd65bf348c370a2ee71fcdf5e on moufmouf:case_in_where into 91dda2cc485900470085f50c65262a8ccd228d11 on thecodingmachine:1.3.