Issue Details (XML | Word | Printable)

Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Alexi Polenur
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
DataNucleus Store RDBMS

Fail to compile JDOQLQuery with named parameters in range clause

Created: 11/Dec/12 05:42 PM   Updated: 31/Dec/12 07:59 PM   Resolved: 13/Dec/12 09:15 AM
Component/s: None
Affects Version/s: 3.2.0.m1
Fix Version/s: 3.1.4, 3.2.0.m2

Datastore: PostgreSQL

 Description  « Hide
There is a copy/paste typo in which make query compilation fail when query uses named parameter for the right range bound.
I found this issue on 3.2.0.m1, but also confirmed that it is still in SVN trunk. Here is the problematic code starting on line 936

            if (toExclParam != null)
                if (parameters.containsKey(fromInclParam))
                    upper = ((Number)parameters.get(toExclParam)).longValue();
                    // Must be numbered input so take ultimate
                    int pos = parameters.size()-1;
                    upper = ((Number)parameters.get(Integer.valueOf(pos))).longValue();

It is typo, the code checks if *fromIncParam* is in the map if (parameters.containsKey(*fromInclParam*)),
but it should check if *toExclParam* is in the map if (parameters.containsKey(*toExclParam*)),

Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.