Hi,

Thanks a lot! I will fix it. I think it is related to the "create index"
optimization, as it fails only with 5000 or more rows. That's why it was
not found in the unit tests, as most unit tests use less rows, and this
setting is no longer a system property and so no longer tested with a lower
value (TestAll uses System.setProperty("h2.maxMemoryRowsDistinct", "128"),
but that doesn't help). I have a simpler test case:

drop table if exists test;
create table test as select x, 0 from system_range(1, 5000);
create unique index on test(x);
select * from test where x=1;

Regards,
Thomas

On Tuesday, May 13, 2014, Noel Grandin <[email protected]> wrote:

>
> I can confirm that this triggers the bug.
>
> I have traced the problem all the way back to this line of code in
> MVSecondaryIndex
>
>    private Cursor find(Session session, SearchRow first, boolean bigger,
> SearchRow last) {
>         ValueArray min = getKey(first);
>         if (min != null) {
>             min.getList()[keyColumns - 1] = ValueLong.get(Long.MIN_VALUE);
>  // <<<<<<<<<<<<<<<<<<<<<<
>         }
>
> I have no idea what it is trying to do, but the Long.MIN_VALUE percolates
> all the way back up the chain of iterators and cursors until it tries to be
> used as a key into the MVPrimaryIndex#getRow(Session,long) method, where
> it causes an NPE.
>
> I suspect that Thomas will be able to fix this given the above information.
>
> On 2014-05-13 11:28, David Pentzlin wrote:
>
>>
>> The attached sql script should trigger this bug
>>
>>
> --
> You received this message because you are subscribed to the Google Groups
> "H2 Database" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/h2-database.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to