DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
Issue Details (XML | Word | Printable)

Key: NUCRDBMS-625
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Alexi Polenur
Votes: 0
Watchers: 0
Operations

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 JDOQLQuery.java 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

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

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*)),

Andy Jefferson made changes - 13/Dec/12 09:15 AM
Field Original Value New Value
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 3.1.4 [ 11811 ]
Fix Version/s 3.2.0.m2 [ 11788 ]
Resolution Fixed [ 1 ]
Andy Jefferson made changes - 31/Dec/12 07:59 PM
Status Resolved [ 5 ] Closed [ 6 ]