Issue Bug Closed

#65657[Query Extbase] LogicalAnd -> Equals and In

Amrouche Hamza 03/11/15, 09:26 updated 11/10/21, 23:09

Description

Grettings,

We experienced a bug when using the QueryInterface :

This is how we do it :

in a repository:

            $query = $this->createQuery();
                $matching[] = $query->in(‘Relation1', $valOfRelation1); // contains list of values ‘1111,2222,3333'
               $matching[] = $query->equals(‘Relation2', $valOfRelation2); // coutains one value ‘0404'
                $query->matching($query->logicalAnd($matching));

            return $query->execute();

return this in SQL

  WHERE (1<>1 AND MyTableRelation.Relation2  = '0404')

So the $query->in is gone.

When doing this :

            $query = $this->createQuery();

               $matching[] = $query->equals(‘Relation2', $valOfRelation2); // coutains one value ‘0404'
                $matching[] = $query->in(‘Relation1', $valOfRelation1); // contains list of values ‘1111,2222,3333'
                $query->matching($query->logicalAnd($matching));

            return $query->execute();

The result is :

 WHERE (MyTableRelation.Relation2 = '0404' AND MyTableRelation.Relation1 IN ('101311','101312','101313','101314','101315','101316','101391','101399'))

We think there is a bug in the $query->logincalAnd with in / equals.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.