Doctrine Common
  1. Doctrine Common
  2. DCOM-214

Collection Criteria isNull does not work well

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.4.1
    • Fix Version/s: None
    • Component/s: Collections
    • Environment:
      PHP 5.4.4, PostgreSQL 9.1

      Description

      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 ]

        Activity

        Jan Pecek created issue -

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Jan Pecek
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: