DDC-2668: DQL TRIM function is not converted into TRIM SQL correctly #3405

Closed
doctrinebot opened this Issue Sep 10, 2013 · 1 comment

1 participant

@doctrinebot

Jira issue originally created by user slavik2121:

Hi!

Using DQL to generate SQL TRIM code won't trim '0'.
For ex., this expression doesn't work:

$queryBuilder->andWhere("TRIM (LEADING '0' FROM t.field) LIKE :field")

This is happening as whenever TRIM DQL is converted into SQL, trimming character is checked for being 'false' multiple times. In php, both 0 and '0' are equaled to false.

{quote}
doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/TrimFunction.php:61
doctrine/dbal/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php:640
{quote}

@doctrinebot

Issue was closed with resolution "Fixed"

@doctrinebot doctrinebot added this to the 2.4.1 milestone Dec 6, 2015
@doctrinebot doctrinebot closed this Dec 6, 2015
@doctrinebot doctrinebot added the Bug label Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment