Hi, I have had this exception come up when trying to query a table

This is the table definition
CREATE TABLE `AL_PAC_TBL`
(
`PAC_ID`                        BIGINT(20) UNSIGNED,
`PAC_STR`                       VARCHAR(100) PRIMARY KEY,
`EXPIRE_TIME`                   TIMESTAMP,
`USED_FLAG`                     CHAR(1)
);

CREATE UNIQUE INDEX `AL_PAC_TBL_IDX_1` ON `AL_PAC_TBL` (`PAC_ID`);
CREATE INDEX `AL_PAC_TBL_IDX_2` ON `AL_PAC_TBL`
(`EXPIRE_TIME`,`USED_FLAG`);

this is the query

SELECT * FROM AL_PAC_TBL WHERE PAC_STR='|1088712|4080362';

this is the exception

Caused by: java.lang.NullPointerException: null
        at org.h2.store.PageStore.readPage(PageStore.java:1250)
[na:na]
        at org.h2.store.PageStore.getPage(PageStore.java:687) [na:na]
        at org.h2.index.PageBtreeIndex.getPage(PageBtreeIndex.java:
141) [na:na]
        at org.h2.index.PageBtreeNode.find(PageBtreeNode.java:297)
[na:na]
        at org.h2.index.PageBtreeNode.find(PageBtreeNode.java:298)
[na:na]
        at org.h2.index.PageBtreeNode.find(PageBtreeNode.java:298)
[na:na]
        at org.h2.index.PageBtreeIndex.find(PageBtreeIndex.java:172)
[na:na]
        at org.h2.index.PageBtreeIndex.find(PageBtreeIndex.java:163)
[na:na]
        at org.h2.index.MultiVersionIndex.find(MultiVersionIndex.java:
71) [na:na]
        at org.h2.index.IndexCursor.find(IndexCursor.java:138) [na:na]
        at org.h2.table.TableFilter.next(TableFilter.java:309) [na:na]
        at org.h2.command.dml.Select.queryFlat(Select.java:493)
[na:na]
        at org.h2.command.dml.Select.queryWithoutCache(Select.java:
580) [na:na]
        at org.h2.command.dml.Query.query(Query.java:241) [na:na]
        at org.h2.command.CommandContainer.query(CommandContainer.java:
80) [na:na]
        at org.h2.command.Command.executeQuery(Command.java:132)
[na:na]
        at
org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:
96) [na:na]
        ... 11 common frames omitted

---------------------------

I have also had issues before where the index would get corrupted and
the database would not return a result that was previously inserted,
however it would not let me insert a row with the same key claiming
there is an index violation.

After dropping the index the 'missing' rows did show up and there
appeared to be duplicates in the database where unique index was used.

Any comments?
Thanks

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to h2-datab...@googlegroups.com.
To unsubscribe from this group, send email to 
h2-database+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to