DDC-3295: Detection of reserved words in DQL #4076

Closed
opened 2026-01-22 14:34:42 +01:00 by admin · 2 comments
Owner

Originally created by @doctrinebot on GitHub (Sep 2, 2014).

Originally assigned to: @Ocramius on GitHub.

Jira issue originally created by user jaimz:

I don't know if the summary really explains much...

I wrote a query in DQL (using the query builder but I doubt that matters). The query is:

SELECT club FROM Domain\Groups\Roster roster INNER JOIN Domain\Club\Club club WITH club.roster = roster INNER JOIN Domain\Groups\GroupMember member WITH member.group = roster

This results in the error:

line #, col ###: Error: Expected Doctrine\ORM\Query\Lexer::T_MEMBER, got '='

It wasn't until I looked deep into the documentation that I can't name my entity "member" because it's a reserved word (I guess) in DQL for the MEMBER OF clause.

Is it possible to detect that the usage of it is as an entity name, not a comparison operator?
Is there anyway around this?

I could only imagine that I'm not the first person to have this issue, and I'm sure that there are other people out there with user systems that would like to use the word 'member'

Maybe the documentation should have a page that covers what words are 'reserved words'? (if there is a page that mentions them, I haven't seen it)

Originally created by @doctrinebot on GitHub (Sep 2, 2014). Originally assigned to: @Ocramius on GitHub. Jira issue originally created by user jaimz: I don't know if the summary really explains much... I wrote a query in DQL (using the query builder but I doubt that matters). The query is: SELECT club FROM Domain\Groups\Roster roster INNER JOIN Domain\Club\Club club WITH club.roster = roster INNER JOIN Domain\Groups\GroupMember member WITH member.group = roster This results in the error: line #, col ###: Error: Expected Doctrine\ORM\Query\Lexer::T_MEMBER, got '=' It wasn't until I looked deep into the documentation that I can't name my entity "member" because it's a reserved word (I guess) in DQL for the MEMBER OF clause. Is it possible to detect that the usage of it is as an entity name, not a comparison operator? Is there anyway around this? I could only imagine that I'm not the first person to have this issue, and I'm sure that there are other people out there with user systems that would like to use the word 'member' Maybe the documentation should have a page that covers what words are 'reserved words'? (if there is a page that mentions them, I haven't seen it)
admin added the Bug label 2026-01-22 14:34:42 +01:00
admin closed this issue 2026-01-22 14:34:43 +01:00
Author
Owner

@doctrinebot commented on GitHub (Sep 2, 2014):

Issue was closed with resolution "Can't Fix"

@doctrinebot commented on GitHub (Sep 2, 2014): Issue was closed with resolution "Can't Fix"
Author
Owner

@doctrinebot commented on GitHub (Sep 2, 2014):

Comment created by @ocramius:

We have an EBNF at http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/dql-doctrine-query-language.html#ebnf, where all DQL symbols are listed.

We can't solve this sort of issue in 2.x as it would require a rewrite of the parser/lexer.

@doctrinebot commented on GitHub (Sep 2, 2014): Comment created by @ocramius: We have an EBNF at http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/dql-doctrine-query-language.html#ebnf, where all DQL symbols are listed. We can't solve this sort of issue in 2.x as it would require a rewrite of the parser/lexer.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4076