mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-3821: QueryBuilder throws QueryException when Expr\Comparison($x, 'LIKE', $y) with 'LIKE' operator was added in where clause #4680
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 (Jul 13, 2015).
Originally assigned to: @Ocramius on GitHub.
Jira issue originally created by user eghlima.r@gmail.com:
This is the query from
QueryBuilder->getDQL():SELECT c FROM wsi\ams\model\Cell c INNER JOIN c.accountingUnit au WHERE 'name' LIKE ?1We are using YII (1.1.16) and Doctrine ORM (2.5).
For YII grid, we need to handle filtering. We accept user input and try to add them all to an Expr\orX clause then add this expression to our QueryBuilder object at the end.
The problem as i could understood is expr\like internally handle by expr\comparison. this comparison later will use in Parser class and in ComparisonOperator method, there is no case for LIKE in switch-case at all. but before that method in Parser class there is a method called: Parser::SimpleConditionalExpression and in this method there is:
and it should handle like in this clause (If i get it right?), but $token['type'] is holding attribute name(in my case
name) not the constant belong to Lexer::T_LIKE and so it ignores this clause and goes down into:Example of code that throws exception:
Exception details: