You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SELECTo.idFROM Entity o
WHERE CASE o.vatIncluded WHEN TRUE THEN o.priceVat ELSE o.priceWoVat END BETWEEN 100AND300
The exception Expected =, <, <=, <>, >, >=, !=, got 'BETWEEN' is raised instead of successful parsing.
The only way around I found about it was to wrap the CASE to a function:
SELECTo.idFROM Entity o
WHERE ABS(CASE o.vatIncluded WHEN TRUE THEN o.priceVat ELSE o.priceWoVat END) BETWEEN 100AND300
In this case, the query is parsed successfully.
It is worth noting, that adding parentheses anywhere won't help.
Q
A
Version
2.19.6 and 2.5.14
Current behavior
Parser raises exception
Expected behavior
Parser should parse the query successfully
How to reproduce
Run this in PHP:
$em->createQuery('SELECT o.idFROM Entity oWHERE CASE o.vatIncluded WHEN TRUE THEN o.priceVat ELSE o.priceWoVat END BETWEEN 100 AND 300')->getAST();
You'll get an exception
The text was updated successfully, but these errors were encountered:
Bug Report
Parser can not parse this DQL:
The exception Expected =, <, <=, <>, >, >=, !=, got 'BETWEEN' is raised instead of successful parsing.
The only way around I found about it was to wrap the CASE to a function:
In this case, the query is parsed successfully.
It is worth noting, that adding parentheses anywhere won't help.
Current behavior
Parser raises exception
Expected behavior
Parser should parse the query successfully
How to reproduce
Run this in PHP:
You'll get an exception
The text was updated successfully, but these errors were encountered: