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: NUCCORE-772
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Unassigned
Reporter: Peter Dettman
Votes: 0
Watchers: 0

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

JDOQL implicit parameters handled incorrectly if one is repeated before all have appeared

Created: 26/Oct/11 10:02 AM   Updated: 04/Oct/12 05:02 PM   Resolved: 26/Oct/11 03:00 PM
Component/s: Persistence, Queries
Affects Version/s: 3.0.2
Fix Version/s: 3.0.3

File Attachments: 1. Text File NUCCORE-772-core.txt (2 kB)
2. Text File NUCCORE-772-test.access.txt (3 kB)

Severity: Production

 Description  « Hide
JDOQL queries may contain references to implicit parameters (of the form ":param"). There may be more than one reference to the same implicit parameter in a single query.

If one or more of the implicit parameters is mentioned twice before all the implicit parameters being used have been encountered, the JDO query compiler will bind the actual parameter values incorrectly (because it numbers the occurrences without checking for duplicates).

Test case and patch to follow.

Peter Dettman added a comment - 26/Oct/11 10:07 AM - edited
Attached files:
1. Test case using a repeated implicit parameter before all appear.
2. Proposed patch to JDOQL parser.

Peter Dettman made changes - 26/Oct/11 10:07 AM
Field Original Value New Value
Attachment NUCCORE-772-test.access.txt [ 11513 ]
Attachment NUCCORE-772-core.txt [ 11514 ]
Andy Jefferson added a comment - 26/Oct/11 03:00 PM
SVN trunk has these now. Thx

Andy Jefferson made changes - 26/Oct/11 03:00 PM
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 3.0.3 [ 11345 ]
Resolution Fixed [ 1 ]
Andy Jefferson made changes - 07/Nov/11 02:57 PM
Status Resolved [ 5 ] Closed [ 6 ]
Andy Jefferson made changes - 04/Oct/12 05:02 PM
Component/s Persistence [ 10200 ]
Component/s JDO [ 10201 ]