Issue Details (XML | Word | Printable)

Key: NUCRDBMS-362
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Marco Schulze
Votes: 0
Watchers: 0
Operations

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

java.lang.IndexOutOfBoundsException with query involving interface

Created: 13/Apr/10 07:41 PM   Updated: 15/Apr/10 07:12 PM   Resolved: 14/Apr/10 07:23 PM
Component/s: ORM
Affects Version/s: None
Fix Version/s: 2.1.0.m2

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


 Description  « Hide
*** Scenario ***

interface MyInterface { }

class A implements MyInterface {
  // some stuff
}

class B implements MyInterface {
  // some stuff
}

class Link {
  private MyInterface from;
  private MyInterface to;

  // some more stuff
}

Querying for all Link instances that point to a certain "from" cause an exception.


*** Exception ***
java.lang.IndexOutOfBoundsException: Index: 3, Size: 3
        at java.util.ArrayList.RangeCheck(ArrayList.java:547)
        at java.util.ArrayList.get(ArrayList.java:322)
        at org.datanucleus.store.rdbms.sql.expression.SQLExpression$ColumnExpressionList.getExpression(SQLExpression.java:574)
        at org.datanucleus.store.rdbms.sql.expression.ObjectExpression.eq(ObjectExpression.java:178)
        at org.datanucleus.store.rdbms.query.QueryToSQLMapper.processEqExpression(QueryToSQLMapper.java:1445)
        at org.datanucleus.query.evaluator.AbstractExpressionEvaluator.compileRelationalExpression(AbstractExpr
essionEvaluator.java:77)
        at org.datanucleus.query.evaluator.AbstractExpressionEvaluator.compileOrAndExpression(AbstractExpressio
nEvaluator.java:65)
        at org.datanucleus.query.evaluator.AbstractExpressionEvaluator.evaluate(AbstractExpressionEvaluator.jav
a:46)
        at org.datanucleus.query.expression.Expression.evaluate(Expression.java:324)
        at org.datanucleus.query.expression.DyadicExpression.evaluate(DyadicExpression.java:73)
        at org.datanucleus.store.rdbms.query.QueryToSQLMapper.compileFilter(QueryToSQLMapper.java:412)
        at org.datanucleus.store.rdbms.query.QueryToSQLMapper.compile(QueryToSQLMapper.java:319)
        at org.datanucleus.store.rdbms.query.JDOQLQuery.compileQueryFull(JDOQLQuery.java:777)
        at org.datanucleus.store.rdbms.query.JDOQLQuery.compileInternal(JDOQLQuery.java:260)
        at org.datanucleus.store.query.Query.executeQuery(Query.java:1635)
        at org.datanucleus.store.query.Query.executeWithMap(Query.java:1533)
        at org.datanucleus.jdo.JDOQuery.executeWithMap(JDOQuery.java:334)
        at org.datanucleus.test.Main$QueryDataTransRunnable0.run(Main.java:86)
        at org.datanucleus.test.Main.executeInTransaction(Main.java:47)
        at org.datanucleus.test.Main.main(Main.java:120)


*** Test ***
http://www.nightlabs.de/~marco/datanucleus/2010-04-13.00/

Andy Jefferson made changes - 14/Apr/10 05:39 AM
Field Original Value New Value
Affects Version/s 2.1.0.m2 [ 10912 ]
Andy Jefferson added a comment - 14/Apr/10 07:23 PM
Works for me with SVN trunk

Andy Jefferson made changes - 14/Apr/10 07:23 PM
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 2.1.0.m2 [ 10912 ]
Resolution Fixed [ 1 ]
Marco Schulze added a comment - 15/Apr/10 07:12 PM
Thanks a lot for fixing this! Works here, too.

Marco Schulze made changes - 15/Apr/10 07:12 PM
Status Resolved [ 5 ] Closed [ 6 ]