Skip to content

ArrayIndexOutOfBoundsException with compound index #4136

@lildeaf

Description

@lildeaf

I updated the H2 version for a project from 2.2.220 to 2.3.232 and some tests failed afterwards because of the following error:

General error: "java.lang.ArrayIndexOutOfBoundsException: Index 37 out of bounds for length 20" [50000-232]' occurred.

The exception gets thrown at line 241 in TableFilter.java.
The if condition for compound indexes got introduced in following commit: 539e8d6

Steps to reproduce

Here is a small example with the H2 console(2.3.232):

CREATE TABLE TESTTABLE1 (id1 number, testid number, owner varchar(20));
INSERT into TESTTABLE1 values (1, 1, 'test');

CREATE TABLE TESTTABLE2 (id number, testid number, lid number, origin number);
INSERT into TESTTABLE2 values (1, 1, null, null);

SELECT test0_.id as test0_id_ from TESTTABLE2 test0_ inner join TESTTABLE1 test1_ where ((test0_.lid, test0_.origin) in ((1,1), (1,1)));

This will result in following exception:

General error: "java.lang.ArrayIndexOutOfBoundsException: Index 3 out of bounds for length 3" [50000-232] HY000/50000

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions