Issue Details (XML | Word | Printable)

Key: NUCJDOQUERY-14
Type: Bug Bug
Status: Closed Closed
Resolution: Incomplete
Priority: Testcase Required Testcase Required
Assignee: Unassigned
Reporter: Tregubova
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
DataNucleus JDO Query Processor

Searching fails for composite OR filter on empty list collection

Created: 05/Feb/13 07:28 PM   Updated: 11/Feb/13 02:40 PM   Resolved: 11/Feb/13 02:39 PM
Component/s: None
Affects Version/s: 3.0.2
Fix Version/s: None

Datastore: MongoDB
Severity: Production


 Description  « Hide
1. There is collection in MongoDB with 2 collection fields - parts and numbers.

2. Persist entity contained the following values:
      parts - [] (empty list)
      numbers - ["12"] (list of one element "12")
      
3. Trying to do search by the following filter:
  (
    numbers.contains(parameter_1)
  ||
    (
       parts.contains(contains_param_0) && contains_param_0.matches(parameter_2)
     )
   )

   parameter_1 = "12" (String type)
   parameter_2 = "_12" (String type)

Expected result: found one entity

Actual result: no entity was found

Possible cause:
   class: JavaQueryEvaluator
   method: evaluateBooleanExpression
   code fragment:

      if (vnse.getValues() == null || vnse.getValues().length == 0)
            {
                // No possible values for the variable so fails
                return Boolean.FALSE;
            }

So, as we have empty list we return Boolean.FALSE for first filter expression:
       parts.contains(contains_param_0) && contains_param_0.matches(parameter_2)
and ignore the second one after OR operator.

                  
   




Sort Order: Ascending order - Click to sort in descending order
Andy Jefferson added a comment - 08/Feb/13 03:08 PM
What has this "issue" got to do with the annotation processor for generating typesafe query meta classes ?
Also you haven't attached a valid DataNucleus testcase as per the front page of JIRA, and all of the DataNucleus docs, hence won't be considered til it has that

Andy Jefferson added a comment - 11/Feb/13 02:39 PM
Nothing to do with an annotation processor that generates query typesafe classes (where this was raised). No testcase was provided either as per http://www.datanucleus.org/project/problem_reporting.html
NUCMONGODB is the project for the MongoDB plugin, and if you raise an issue on that a testcase is a prerequisite