efmarshall / h2database

Automatically exported from code.google.com/p/h2database
0 stars 0 forks source link

H2 Mysql Compatibility code fails to ignore "COMMENT" in CREATE TABLE #474

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
from https://groups.google.com/forum/?fromgroups#!topic/h2-database/oC0HHmwg37U

H2 when running in MYSQL compatibility cannot handle (or ignore) COMMENT 
commands in CREATE statements. For example:

create table ASN_SUP_ATTACH_T (ID bigint not null auto_increment, ATTACHMENT_ID 
varchar(255), ASN_SUP_ITEM_ID bigint not null, primary key (ID), unique 
(ATTACHMENT_ID, ASN_SUP_ITEM_ID)) comment='This table is for assignment 
supplement item attachment.'

Results in:
Unsuccessful schema statement: create table ASN_SUP_ATTACH_T (ID bigint not 
null auto_increment, ATTACHMENT_ID varchar(255), ASN_SUP_ITEM_ID bigint not 
null, primary key (ID), unique (ATTACHMENT_ID, ASN_SUP_ITEM_ID)) comment='This 
table is for assignment supplement item attachment.' ENGINE=InnoDB
org.h2.jdbc.JdbcSQLException: Syntax error in SQL statement "CREATE TABLE 
ASN_SUP_ATTACH_T (ID BIGINT NOT NULL AUTO_INCREMENT, ATTACHMENT_ID 
VARCHAR(255), ASN_SUP_ITEM_ID BIGINT NOT NULL, PRIMARY KEY (ID), UNIQUE 
(ATTACHMENT_ID, ASN_SUP_ITEM_ID)) COMMENT[*]='This table is for assignment 
supplement item attachment.' ENGINE=INNODB ";

As suggested by Noel Grandin on Jun 7, I am attaching a patch. This patch also 
includes a few fixes for other areas of the code which were blocking the build 
of the trunk code as of today and also stopped the docs from being able to be 
built.

Original issue reported on code.google.com by azeckoski on 9 Jun 2013 at 1:07

Attachments:

GoogleCodeExporter commented 9 years ago
In case it is not clear in the part above, the patch for this is attached.

Original comment by azeckoski on 9 Jun 2013 at 1:08

GoogleCodeExporter commented 9 years ago
Committed in revision 4846.

Original comment by noelgrandin on 10 Jun 2013 at 6:55