mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-4002: Identifiers matching a different token are not usabled for alias result variables #4886
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 @doctrinebot on GitHub (Nov 16, 2015).
Originally assigned to: @guilhermeblanco on GitHub.
Jira issue originally created by user stof:
The following query does not work:
This triggers a very confusing error:
[Semantical Error] line 0, col 17 near ', SIZE(g.members)': Error: Class ',' is not defined.This happens because
groupis matched as aT*GROUPtoken, not as aT_IDENTIFIER. The lexer has a comment saying that all tokens which are also valid identifiers must have a value>= T*IDENTIFIER, but I don't see any place relying on this, making these token reserved for any place using them. This is annoying as it means that it is impossible to alias the result asgroupwhen using DQL.Regarding the confusing error message, I have an idea to improve it in some cases (including the one described here) as the current implementation does not actually reflect the documented EBNF: the implementation allows to use
ASwithout putting an AliasResultVariable after it, while the EBNF does not. If we consider thatASneeds the AliasResultVariable after it, we can at least have a better error message@patrick-mcdougle commented on GitHub (Mar 16, 2016):
I had the same issue when naming a result field "count". Mine was at the end of the select statement which made it even more confusing when it said
[Semantical Error] ... near FROM...@benbor commented on GitHub (Mar 10, 2017):
@patrick-mcdougle i had the same issue for v2.5.6. But for
masterbranch it's works fine.