DDC-334: QueryBuilder throws QueryException when Expr\Comparison with 'LIKE' operator was added in where clause #413

Closed
opened 2026-01-22 12:37:31 +01:00 by admin · 4 comments
Owner

Originally created by @doctrinebot on GitHub (Feb 14, 2010).

Jira issue originally created by user ignat:

Example of code that throws exception:

$qb->select('e')->from('SomeEntity','e')
->add('where',$qb->expr()->like('LOWER(e.title)',':title'));
$result = $qb->getQuery()->execute(array('title' => $title),Doctrine\ORM\Query::HYDRATE_OBJECT); // exception throws here

Exception details:
Message: Doctrine\ORM\Query\QueryException: [Syntax Error] line 0, col 100: Error: Expected =, <, <=, <>, >, >=, !=, got 'LIKE'
Trace:
lib/Doctrine/ORM/Query/QueryException.php:41
lib/Doctrine/ORM/Query/Parser.php:346
lib/Doctrine/ORM/Query/Parser.php:2572
...

Originally created by @doctrinebot on GitHub (Feb 14, 2010). Jira issue originally created by user ignat: Example of code that throws exception: ``` $qb->select('e')->from('SomeEntity','e') ->add('where',$qb->expr()->like('LOWER(e.title)',':title')); $result = $qb->getQuery()->execute(array('title' => $title),Doctrine\ORM\Query::HYDRATE_OBJECT); // exception throws here ``` Exception details: Message: Doctrine\ORM\Query\QueryException: [Syntax Error] line 0, col 100: Error: Expected =, <, <=, <>, >, >=, !=, got 'LIKE' Trace: lib/Doctrine/ORM/Query/QueryException.php:41 lib/Doctrine/ORM/Query/Parser.php:346 lib/Doctrine/ORM/Query/Parser.php:2572 ...
admin added the Bug label 2026-01-22 12:37:31 +01:00
admin closed this issue 2026-01-22 12:37:31 +01:00
Author
Owner

@doctrinebot commented on GitHub (Feb 14, 2010):

@doctrinebot commented on GitHub (Feb 14, 2010): - is duplicated by [DDC-339: Parser incorrectly assumes arithmetic expression when finding lower(something) ](http://www.doctrine-project.org/jira/browse/DDC-339)
Author
Owner

@doctrinebot commented on GitHub (Feb 14, 2010):

Comment created by ignat:

I found that if I don't use LOWER function exception won't throw.

@doctrinebot commented on GitHub (Feb 14, 2010): Comment created by ignat: I found that if I don't use LOWER function exception won't throw.
Author
Owner

@doctrinebot commented on GitHub (Feb 20, 2010):

Comment created by romanb:

Should be fixed in trunk.

@doctrinebot commented on GitHub (Feb 20, 2010): Comment created by romanb: Should be fixed in trunk.
Author
Owner

@doctrinebot commented on GitHub (Feb 20, 2010):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Feb 20, 2010): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#413