Jira issue originally created by user mzach:
When using the between() method of the Doctrine\ORM\Query\Expr class, an instance of Doctrine\ORM\Query\Expr\Func is returned, which produces a DQL similar to:
SELECT p FROM MyTest\Domain\Person p WHERE BETWEEN(p.id, 1, 100)
This is expected behaviour following the test available in Doctrine/Tests/ORM/Query/ExprTest.php, unfortunately the parser itself as well as other testcases expect the format to be
SELECT p FROM MyTest\Domain\Person p WHERE p.id BETWEEN 1 AND 100
So every time you call getSql() Doctrine throws an Exception because it tries to access BETWEEN() as a database function, whereas it really is a comparator.
I made a quick fix available at http://www.pastie.org/888251 to solve this issue by keeping the parser as-is and only rewriting the returned class
Comment created by mzach:
Attached modified classes for easier review
Comment created by @beberlei:
Issue was closed with resolution "Fixed"
Imported 3 attachments from Jira into https://gist.github.com/9f0d5e12e7051df5a6f4