lbehnke / h2database

Automatically exported from code.google.com/p/h2database
0 stars 0 forks source link

Left outer join on two columns result in an ArrayIndexOutOfBoundException #63

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
(simple SQL scripts or simple standalone applications are preferred)

create table a (
  col_a1 number not null,
  col_a2 number not null
);
insert into a (col_a1, col_a2) values (1,1);
insert into a (col_a1, col_a2) values (2,2);

create table b(
 col_b1 number not null,
 col_b2 number not null
);

insert into b(col_b1, col_b2) values (1,1);

select distinct  a.col_a1,
                       a.col_a2,
                       b.col_b1,
                       b.col_b2
from                a a,
                       b b
where              a.col_a1 = b.col_b1(+)
               and a.col_a2 = b.col_b2(+);

What is the expected output? What do you see instead?
COL_A1  COL_A2  COL_B1  COL_B2  
1   1   1   1
2   2   null    null

What version of the product are you using? On what operating system, file
system, and virtual machine?
Database: H2 1.1.107 (2009-01-24)
OS: Ubuntu 8.10 AMD64
FS: EXT3
VM: 
java version "1.6.0_10"
Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
Java HotSpot(TM) 64-Bit Server VM (build 11.0-b15, mixed mode)

Do you know a workaround?
No, however, it does work when joining on a single column

How important/urgent is the problem for you?
Quite important, we use H2 for our tests and are currently failing :(

In your view, is this a defect or a feature request?
A Defect

Please provide any additional information below.

Apparently, a join on two columns result in an ArrayOutOfBoundException. If
I would change the query to perform the join on a single column (see
below), everything seems to work fine:

create table a (
  col_a1 number not null,
  col_a2 number not null
);
insert into a (col_a1, col_a2) values (1,1);
insert into a (col_a1, col_a2) values (2,2);

create table b(
 col_b1 number not null,
 col_b2 number not null
);

insert into b(col_b1, col_b2) values (1,1);

select distinct  a.col_a1,
                       a.col_a2,
                       b.col_b1,
                       b.col_b2
from                a a,
                       b b
where              a.col_a1 = b.col_b1(+);

Original issue reported on code.google.com by coude...@gmail.com on 13 Feb 2009 at 8:50

GoogleCodeExporter commented 9 years ago

Original comment by thomas.t...@gmail.com on 27 Feb 2009 at 4:38

GoogleCodeExporter commented 9 years ago
Should work with version 1.1.108.
Please re-open if not.

Original comment by thomas.t...@gmail.com on 1 Mar 2009 at 10:06

GoogleCodeExporter commented 9 years ago
Works great now,

Thanks!

Chris.

Original comment by coude...@gmail.com on 2 Mar 2009 at 9:41