Skip to content

Loading…

DCOM-214: Collection Criteria isNull does not work well #520

Open
doctrinebot opened this Issue · 0 comments

2 participants

@doctrinebot

Jira issue originally created by user honzap:

I'm using the Collection project https://github.com/doctrine/collections and its Criteria building part. I'm not sure if I'm putting this bug to the good project. Please, correct me if not.

There is bug in method isNull: https://github.com/doctrine/collections/blob/master/lib/Doctrine/Common/Collections/ExpressionBuilder.php#L125

This produces SQL command where is 'IS ?' and null value is passed as param. This is fail.

Code example:

  $expr = Criteria::expr();
  $criteria = Criteria::create()
    ->where($expr->lte('num', 42))
    ->andWhere($expr->isNull('deleted'));
  return $this->myCollection->matching($criteria);

This produces SQL: SELECT ... FROM ... WHERE num <= ? AND deleted IS ? with params [ 42, null ]

@doctrinebot doctrinebot added the Bug label
@beberlei beberlei was assigned by doctrinebot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.