mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-42: the DQL parser does not support boolean literal values #54
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Oct 12, 2009).
Jira issue originally created by user itoijala:
The parser does not support boolean literal values. This means that comparisons like e.unlocked = true result in a syntax error. This is not what is intended, since both documentation and comments in the code Doctrine\ORM\Query\Parser.php line 1870 say that boolean literals are supported.
I have a possible fix. I don't know if it is the best way to fix this.
OLD:
NEW:
Using convertBooleans is important. Otherwise the sql will have 'true' or 'false'.
Cases T_TRUE and T_FALSE should also be added to ArithmeticPrimary(). (line 2048)
@doctrinebot commented on GitHub (Oct 12, 2009):
Comment created by romanb:
Thanks, I will work on this.
One thing for your understanding though: The task of the parser is only to accept or deny input, thereby building up a syntax tree. Afterwards, one or more tree walkers can walk down this tree to do something with it. Normally this is just the SqlWalker that produces SQL. So it is the task of this SqlWalker to properly quote the literals. The Parser does not even care what the output will be.
@doctrinebot commented on GitHub (Oct 13, 2009):
Issue was closed with resolution "Fixed"