mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
[Syntax Error] line 0, col 94: Error: Expected Doctrine\\ORM\\Query\\Lexer::T_COMMA, got 'AND'" Upgrade to 2.6 #6040
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 @mayro on GitHub (Aug 20, 2018).
Originally assigned to: @Ocramius on GitHub.
Hello,
I used REGEXP, and i have this error.
Here is the produced DQL:
This was perfectly working with the same code for v2.5, not after upgrading to 2.6.
Rolling back to v2.5 was the only thing I did to make it working again.
@Ocramius commented on GitHub (Aug 20, 2018):
Went through https://www.doctrine-project.org/projects/doctrine-orm/en/latest/reference/dql-doctrine-query-language.html#conditional-expressions, seems OK, so this is probably a bug, not a BC break.
I don't see a
REGEXP()function in ORM though: where is that coming from?Can you try reproducing the bug in a DQL test to be added to
7b261676d2/tests/Doctrine/Tests/ORM/Query/SelectSqlGenerationTest.phpplease?@mayro commented on GitHub (Aug 20, 2018):
Hello @Ocramius,
Thank you for your quick response.
You are right it seems to be a bug, i'm blocked by match() in Orm/Query/Parser.php.
I'm using the string_functions REGEXP. DoctrineExtensions\Query\Mysql\Regexp
@Ocramius commented on GitHub (Aug 20, 2018):
Can you print out a full trace, please?
@Ocramius commented on GitHub (Aug 20, 2018):
@mayro from your screenshots, it seems evident that you need a
REGEXP(SOMETHING, SOMETHING)(notice the comma).Closing as
invalidhere.@mayro commented on GitHub (Aug 20, 2018):
@Ocramius
I don't understand whey you have closed quickly this issue.
This is my query $qb
->andWhere('REGEXP('labels', ':' . $attributeKey.') = true')
->setParameter($attributeKey, $this->regexTag($tag))
You can see that I'm using the comma ',' with my REGEXP. the "AND" is in the DQL transformation This was perfectly working with the same code for v2.5, not after upgrading to 2.6.
@Ocramius commented on GitHub (Aug 20, 2018):
The query you pasted above is following:
The transformation should be an SQL transformation, not a DQL one. The DQL parser is correctly throwing an exception, and your traces show that the failure is precisely in the handling of the custom DQL function.