ArrayIndexOutOfBoundsException [HSQLDB 2.3.1]

Help
Lucani
2013-12-04
2014-01-19
  • Lucani
    Lucani
    2013-12-04

    Hello,

    I encountered a problem with inserting a new bit string to database.

    Simplest way to reproduce error (try to insert 128 x binary "1" and then 128 x "0":

    CREATE TABLE test_table(column BIT(256) NOT NULL)
    INSERT INTO test_table VALUES (B'1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'))
    

    java.lang.ArrayIndexOutOfBoundsException: 4 java.lang.ArrayIndexOutOfBoundsException: 4 / Error Code: -458 / State: S1000

    When I replace any "0" in right half of 256 bit string (second 128 bits) to "1" the problem won't occur.
    It's query with 129 x "1" and then 127 x "0".

    INSERT INTO test_table VALUES (B'1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000')
    
     
  • Fred Toussi
    Fred Toussi
    2013-12-04

    Thanks, the parser isn't allocating the buffer for trailing zeros. Will be fixed in the next release.