DDC-339: Parser incorrectly assumes arithmetic expression when finding lower(something) #419

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

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

Jira issue originally created by user russ:

$dql = "SELECT f FROM foo f WHERE f.something LIKE :str

works ok, but cannot be converted to a case insensitive search

$dql = "SELECT f FROM foo f WHERE lower(f.something) LIKE :str

Fails with syntax error (Expected =, <, <=, etc) got 'LIKE'

Originally created by @doctrinebot on GitHub (Feb 14, 2010). Jira issue originally created by user russ: $dql = "SELECT f FROM foo f WHERE f.something LIKE :str works ok, but cannot be converted to a case insensitive search $dql = "SELECT f FROM foo f WHERE lower(f.something) LIKE :str Fails with syntax error (Expected =, <, <=, etc) got 'LIKE'
admin added the Bug label 2026-01-22 12:37:42 +01:00
admin closed this issue 2026-01-22 12:37:43 +01:00
Author
Owner
@doctrinebot commented on GitHub (Feb 14, 2010): - duplicates [DDC-3821: QueryBuilder throws QueryException when Expr\Comparison($x, 'LIKE', $y) with 'LIKE' operator was added in where clause](http://www.doctrine-project.org/jira/browse/DDC-3821) - duplicates [DDC-334: QueryBuilder throws QueryException when Expr\Comparison with 'LIKE' operator was added in where clause](http://www.doctrine-project.org/jira/browse/DDC-334)
Author
Owner

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

Comment created by @beberlei:

Reproduced with CMS Model Set:

    /****
     * @group [DDC-339](http://www.doctrine-project.org/jira/browse/DDC-339)
     */
    public function testStringFunctionLikeExpression()
    {
        $this->assertSqlGeneration(
            "SELECT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE LOWER(u.name) LIKE '%foo OR bar%'",
            ""
        );
    }
@doctrinebot commented on GitHub (Feb 15, 2010): Comment created by @beberlei: Reproduced with CMS Model Set: ``` /**** * @group [DDC-339](http://www.doctrine-project.org/jira/browse/DDC-339) */ public function testStringFunctionLikeExpression() { $this->assertSqlGeneration( "SELECT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE LOWER(u.name) LIKE '%foo OR bar%'", "" ); } ```
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#419