mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Group as entity name is not parsed correctly in DQL #6491
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 @BrtBnn on GitHub (Jun 18, 2020).
Bug Report
Summary
A syntax error is raised when executing a DQL statement.
Current behavior
A syntax error:
line 0, col 15: Error: Expected Doctrine\ORM\Query\Lexer::T_ALIASED_NAME, got 'Group'is raised when executing a DQL statement:SELECT gr FROM Group grHow to reproduce
Create an entity
GroupExecuting the following DQL statement:
SELECT gr FROM Group grraised the syntax error:line 0, col 15: Error: Expected Doctrine\ORM\Query\Lexer::T_ALIASED_NAME, got 'Group'It seems that the Entity name
Groupis matched by the Lexer as aLexer::T_GROUP, which is OK, but when parsing the from-clause in AbstractSchemaName() theLexer::T_GROUPtoken is not matched as a identifier (although it should be), resulting in a syntax error when trying to matchLexer::T_GROUPasLexer::T_ALIASED_NAMEMaybe the following fixes it already
Expected behavior
In the DQL statement, Group is a valid identifier. So AbstractSchemaName() should parse it without raising syntax errors