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-977
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Graham Stewart
Votes: 0
Watchers: 0
Operations

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

JDO bulk update in single string JDOQL not working due to '=' throwing exception in parser

Created: 03/Jan/13 12:48 AM   Updated: 11/Jan/13 12:46 PM   Resolved: 03/Jan/13 10:20 AM
Component/s: Persistence, Queries
Affects Version/s: 3.2.0.m1, 3.2.0.m2
Fix Version/s: 3.2.0.m3

Environment: Linux

Forum Thread URL: http://www.datanucleus.org/servlet/forum/viewthread_thread,7402
Datastore: MySQL
Severity: Development


 Description  « Hide
You cannot use bulk update in JDOQL due to single '=' being rejected by JDOQLParser

javax.jdo.JDOUserException: Invalid operator "=". Did you mean to use "=="?
at org.datanucleus.api.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:549)
at org.datanucleus.api.jdo.JDOQuery.execute(JDOQuery.java:230)
at org.datanucleus.samples.jdo.query.Main.main(Main.java:103)
NestedThrowablesStackTrace:
Invalid operator "=". Did you mean to use "=="?
org.datanucleus.store.query.QueryCompilerSyntaxException: Invalid operator "=". Did you mean to use "=="?
at org.datanucleus.query.compiler.JDOQLParser.processRelationalExpression(JDOQLParser.java:482)
at org.datanucleus.query.compiler.JDOQLParser.processAndExpression(JDOQLParser.java:432)
at org.datanucleus.query.compiler.JDOQLParser.processExclusiveOrExpression(JDOQLParser.java:418)
at org.datanucleus.query.compiler.JDOQLParser.processInclusiveOrExpression(JDOQLParser.java:404)
at org.datanucleus.query.compiler.JDOQLParser.processConditionalAndExpression(JDOQLParser.java:390)
at org.datanucleus.query.compiler.JDOQLParser.processConditionalOrExpression(JDOQLParser.java:371)
at org.datanucleus.query.compiler.JDOQLParser.processExpression(JDOQLParser.java:360)
at org.datanucleus.query.compiler.JDOQLParser.parse(JDOQLParser.java:98)
at org.datanucleus.query.compiler.JavaQueryCompiler.compileFilter(JavaQueryCompiler.java:461)
at org.datanucleus.query.compiler.JDOQLCompiler.compile(JDOQLCompiler.java:105)
at org.datanucleus.store.query.AbstractJDOQLQuery.compileInternal(AbstractJDOQLQuery.java:349)
at org.datanucleus.store.rdbms.query.JDOQLQuery.compileInternal(JDOQLQuery.java:215)
at org.datanucleus.store.query.Query.executeQuery(Query.java:1736)
at org.datanucleus.store.query.Query.executeWithArray(Query.java:1664)
at org.datanucleus.store.query.Query.execute(Query.java:1646)
at org.datanucleus.api.jdo.JDOQuery.execute(JDOQuery.java:221)
at org.datanucleus.samples.jdo.query.Main.main(Main.java:103)


Forum post has testcase and diff to "fix"

Andy Jefferson added a comment - 03/Jan/13 10:20 AM
SVN trunk allows "=" syntax in the UPDATE clause when 'allowAll' is set. Note that this doesn't use the forum patch which had 2 problems : added a Node as "!=", and applied to all clauses not just the UPDATE (and I've no intention of allowing people to use "=" in a WHERE clause for example). Thx

Andy Jefferson made changes - 03/Jan/13 10:20 AM
Field Original Value New Value
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 3.2.0.m3 [ 11832 ]
Resolution Fixed [ 1 ]
Andy Jefferson made changes - 11/Jan/13 12:46 PM
Status Resolved [ 5 ] Closed [ 6 ]