Bug #8411

QOM logicalNot() does not work as expected

Added by Andreas Förthner almost 11 years ago. Updated over 10 years ago.

Status:
Resolved
Priority:
Must have
Category:
Persistence
Start date:
2010-06-23
Due date:
% Done:

100%

Estimated time:
3.00 h
PHP Version:
Has patch:
Complexity:

Description

$query->logicalNot() seems to be completely ignored. To reproduce that bug you can add a new constraint to the query in BlogRepository->findByBlog():

This works as expected (only posts with the title "FLOW3" are returned):

$query->matching($query->logicalAnd($query->equals('blog', $blog), $query->equals('title', 'FLOW3')))...

This query should return all posts, but not the ones having "FLOW3" as title:

$query->matching($query->logicalAnd($query->equals('blog', $blog), $query->logicalNot($query->equals('title', 'FLOW3'))))...

The second query ignores the title constraint and returns all posts.

#1

Updated by Karsten Dambekalns almost 11 years ago

  • Status changed from New to Accepted
  • Start date deleted (2010-06-21)
#2

Updated by Karsten Dambekalns almost 11 years ago

  • Target version set to 1.0 alpha 10
  • Start date set to 2010-06-23
#3

Updated by Karsten Dambekalns almost 11 years ago

  • Estimated time set to 3.00 h

Ok, confirmed. Here's the problem:

To check a value of a certain property we use this logic:
... AND (field = 'title' AND value = 'Test')

Now we wrap this in logicalNot(), basically doing what it should:
... AND (NOT (field = 'title' AND value = 'Test') )

But, we mean:
... AND (field = 'title' AND NOT (value = 'Test') )

#4

Updated by Karsten Dambekalns almost 11 years ago

  • Status changed from Accepted to Resolved
  • % Done changed from 0 to 100

Applied in changeset r4636.

Also available in: Atom PDF