[DDC-2016] DQL Parser fails in select clause Created: 07/Sep/12  Updated: 23/Nov/12  Resolved: 23/Nov/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: DQL
Affects Version/s: 2.2.3
Fix Version/s: 2.4
Security Level: All

Type: Bug Priority: Major
Reporter: Stefan Klug Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

Executing the following query inside the sandbox:

$r = $em->createQuery('SELECT u, (((3))) as v FROM Entities\User u')->getResult();

results in the following exception:

PHP Fatal error:  Uncaught exception 'Doctrine\ORM\Query\QueryException' with message '[Syntax Error] line 0, col 10: Error: Expected known function, got '('' in /mnt/D/Jobs/Wanderwalter/htdocs/doctrineTest/doctrine2/lib/Doctrine/ORM/Query/QueryException.php:42
Stack trace:
#0 /mnt/D/Jobs/Wanderwalter/htdocs/doctrineTest/doctrine2/lib/Doctrine/ORM/Query/Parser.php(380): Doctrine\ORM\Query\QueryException::syntaxError('line 0, col 10:...')
#1 /mnt/D/Jobs/Wanderwalter/htdocs/doctrineTest/doctrine2/lib/Doctrine/ORM/Query/Parser.php(3001): Doctrine\ORM\Query\Parser->syntaxError('known function', Array)
#2 /mnt/D/Jobs/Wanderwalter/htdocs/doctrineTest/doctrine2/lib/Doctrine/ORM/Query/Parser.php(2975): Doctrine\ORM\Query\Parser->CustomFunctionDeclaration()
#3 /mnt/D/Jobs/Wanderwalter/htdocs/doctrineTest/doctrine2/lib/Doctrine/ORM/Query/Parser.php(1907): Doctrine\ORM\Query\Parser->FunctionDeclaration()
#4 /mnt/D/Jobs/Wanderwalter/htdocs/doctrineTest/doctrine2/lib/Doctrine/ORM/Query/Parser.php(1048): Doctrine\ORM\Query\Parser->SelectExp in /mnt/D/Jobs/Wanderwalter/htdocs/doctrineTest/doctrine2/lib/Doctrine/ORM/Query/QueryException.php on line 42


 Comments   
Comment by Stefan Klug [ 07/Sep/12 ]

Solution is available at https://github.com/doctrine/doctrine2/pull/438

Comment by Fabio B. Silva [ 23/Nov/12 ]

Fixed : https://github.com/doctrine/doctrine2/commit/ec1950d3cac918935e0f05c1fb79bbd592caed87

Generated at Wed Aug 27 21:07:05 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.