Hi
This bug has been fixed already in SVN, but we haven't done a release yet.
Regards,
Noel.
On 2012-11-24 09:41, Akshay Mehta wrote:
Hi,
I am trying to execute the attached script in the default console for
H2 Database. On executing it I am getting the following Error :
General error: "java.lang.NullPointerException"; SQL statement:
CREATE TABLE IF NOT EXISTS ITEM_MASTER (
ITEM_ID INTEGER NOT NULL DEFAULT NEXT VALUE FOR ITEMIDS,
ITEM_NAME VARCHAR(30) NOT NULL UNIQUE,
DESCRIPTION VARCHAR(50) DEFAULT NULL,
GROUPID INTEGER NOT NULL DEFAULT 1001,
MANUFACTURER INTEGER NOT NULL,
MEASUREMENT_ID INTEGER NOT NULL DEFAULT 101,
BARCODE VARCHAR(25) DEFAULT NULL,
DEFAULT_PUR_TAXID INTEGER NOT NULL,
DEFAULT_SALE_TAXID INTEGER NOT NULL,
CARRIES_UNIQUE_SERIALNO BOOLEAN DEFAULT FALSE,
MAINTAINED_IN_BATCHES BOOLEAN DEFAULT FALSE,
PRIMARY KEY (ITEM_ID),
FOREIGN KEY (MEASUREMENT_ID) REFERENCES UNITS_OF_MEASUREMENT
(MEASUREMENT_ID),
FOREIGN KEY (DEFAULT_PUR_TAXID) REFERENCES ACCOUNTS.LIST_TAX_ACCOUNTS
(LEDGER_ID),
FOREIGN KEY (DEFAULT_SALE_TAXID) REFERENCES ACCOUNTS.LIST_TAX_ACCOUNTS
(LEDGER_ID),
FOREIGN KEY (MANUFACTURER) REFERENCES MANUFACTURERS (MANUFACTURERID),
FOREIGN KEY (GROUPID) REFERENCES ITEM_GROUP (GROUPID),
CONSTRAINT UNIQUE_BATCH_CHECK CHECK ((CARRIES_UNIQUE_SERIALNO AND
MAINTAINED_IN_BATCHES)=FALSE)
) [50000-164] HY000/50000 (Help)
org.h2.jdbc.JdbcSQLException: General error:
"java.lang.NullPointerException"; SQL statement:
CREATE TABLE IF NOT EXISTS ITEM_MASTER (
ITEM_ID INTEGER NOT NULL DEFAULT NEXT VALUE FOR ITEMIDS,
ITEM_NAME VARCHAR(30) NOT NULL UNIQUE,
DESCRIPTION VARCHAR(50) DEFAULT NULL,
GROUPID INTEGER NOT NULL DEFAULT 1001,
MANUFACTURER INTEGER NOT NULL,
MEASUREMENT_ID INTEGER NOT NULL DEFAULT 101,
BARCODE VARCHAR(25) DEFAULT NULL,
DEFAULT_PUR_TAXID INTEGER NOT NULL,
DEFAULT_SALE_TAXID INTEGER NOT NULL,
CARRIES_UNIQUE_SERIALNO BOOLEAN DEFAULT FALSE,
MAINTAINED_IN_BATCHES BOOLEAN DEFAULT FALSE,
PRIMARY KEY (ITEM_ID),
FOREIGN KEY (MEASUREMENT_ID) REFERENCES UNITS_OF_MEASUREMENT
(MEASUREMENT_ID),
FOREIGN KEY (DEFAULT_PUR_TAXID) REFERENCES ACCOUNTS.LIST_TAX_ACCOUNTS
(LEDGER_ID),
FOREIGN KEY (DEFAULT_SALE_TAXID) REFERENCES ACCOUNTS.LIST_TAX_ACCOUNTS
(LEDGER_ID),
FOREIGN KEY (MANUFACTURER) REFERENCES MANUFACTURERS (MANUFACTURERID),
FOREIGN KEY (GROUPID) REFERENCES ITEM_GROUP (GROUPID),
CONSTRAINT UNIQUE_BATCH_CHECK CHECK ((CARRIES_UNIQUE_SERIALNO AND
MAINTAINED_IN_BATCHES)=FALSE)
) [50000-164]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)
at org.h2.message.DbException.get(DbException.java:158)
at org.h2.message.DbException.convert(DbException.java:281)
at org.h2.command.Command.executeUpdate(Command.java:230)
at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:177)
at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:152)
at org.h2.server.web.WebApp.getResult(WebApp.java:1311)
at org.h2.server.web.WebApp.query(WebApp.java:1001)
at org.h2.server.web.WebApp$1.next(WebApp.java:964)
at org.h2.server.web.WebApp$1.next(WebApp.java:967)
at org.h2.server.web.WebThread.process(WebThread.java:166)
at org.h2.server.web.WebThread.run(WebThread.java:93)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at
org.h2.command.ddl.AlterTableAddConstraint.getUniqueIndex(AlterTableAddConstraint.java:275)
at
org.h2.command.ddl.AlterTableAddConstraint.tryUpdate(AlterTableAddConstraint.java:209)
at
org.h2.command.ddl.AlterTableAddConstraint.update(AlterTableAddConstraint.java:68)
at org.h2.command.ddl.CreateTable.update(CreateTable.java:168)
at org.h2.command.CommandContainer.update(CommandContainer.java:73)
at org.h2.command.Command.executeUpdate(Command.java:226)
... 9 more
Can anyone help in explaining the cause of the above error. I am using
H2 version : 1.3.164.
Regards
Akshay
--
You received this message because you are subscribed to the Google
Groups "H2 Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/h2-database?hl=en.
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/h2-database?hl=en.