ArrayIndexOutOfBoundsException in RIGHT JOIN with COALESCE
----------------------------------------------------------

                 Key: DERBY-4389
                 URL: https://issues.apache.org/jira/browse/DERBY-4389
             Project: Derby
          Issue Type: Bug
          Components: SQL
    Affects Versions: 10.5.3.0, 10.4.2.0, 10.3.3.0, 10.2.2.0, 10.1.3.1, 
10.0.2.1, 10.6.0.0
            Reporter: Knut Anders Hatlen


Dag H. Wanvik identified this problematic query in DERBY-4342:

ij> create table t(x int, y int);
0 rows inserted/updated/deleted
ij> insert into t values (1,2);
1 row inserted/updated/deleted
ij> select * from t t1 right join t t2 on t1.x=t2.x where coalesce(t1.x,t1.y) = 
1;
ERROR 38000: The exception 'java.lang.ArrayIndexOutOfBoundsException: -1' was 
thrown while evaluating an expression.
ERROR XJ001: Java exception: '-1: java.lang.ArrayIndexOutOfBoundsException'.

With a debug build, an assert failure is raised instead:

ij> select * from t t1 right join t t2 on t1.x=t2.x where coalesce(t1.x,t1.y) = 
1;
ERROR XJ001: Java exception: 'ASSERT FAILED sourceResultSetNumber expected to 
be >= 0 for T1.X: org.apache.derby.shared.common.sanity.AssertFailure'.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to