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

Open
opened 2026-01-22 12:37:27 +01:00 by admin · 0 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:27 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#411