DDC-1077: Specifying a constant value in the SELECT clause causes parser error #1670

Closed
doctrinebot opened this Issue Mar 24, 2011 · 3 comments

2 participants

@doctrinebot

Jira issue originally created by user kmcbride:

User group post: [http://groups.google.com/group/doctrine-user/browse_thread/thread/7f49cf9ff36d0750]

Specifying a value in the select clause, such as the following, causes a parser error:

queryBuilder->select('p.name as name, \'foo\' as bar')->from->('Person p');

The equivalent SQL would be:

SELECT p.name as name, 'foo' as bar FROM person;

And would result in something like the following:

name bar

steve foo
john foo
sally foo

The error output:

Doctrine\ORM\Query\QueryException : [Syntax Error] line 0, col 136: Error:

Expected IdentificationVariable | StateFieldPathExpression | AggregateExpression | "(" Subselect ")" | ScalarExpression, got 'foo'

Doctrine/ORM/Query/Parser.php(393): syntaxError()

@doctrinebot

Comment created by @beberlei:

Fixed

@doctrinebot

Issue was closed with resolution "Fixed"

@beberlei beberlei was assigned by doctrinebot Dec 6, 2015
@doctrinebot doctrinebot added this to the 2.0.4 milestone Dec 6, 2015
@doctrinebot doctrinebot closed this Dec 6, 2015
@doctrinebot doctrinebot added the Bug label Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment