Skip to content

Commit dd80699

Browse files
committed
fixes #798
1 parent aecc414 commit dd80699

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

src/test/java/net/sf/jsqlparser/statement/create/CreateTableTest.java

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,4 +504,37 @@ public void testCollateUtf8Issue785() throws JSQLParserException {
504504
public void testCreateTableWithSetTypeIssue796() throws JSQLParserException {
505505
assertSqlCanBeParsedAndDeparsed("CREATE TABLE `tables_priv` (`Host` char (60) COLLATE utf8_bin NOT NULL DEFAULT '', `Table_priv` set ('Select', 'Insert', 'Update', 'Delete', 'Create', 'Drop', 'Grant', 'References', 'Index', 'Alter', 'Create View', 'Show view', 'Trigger') CHARACTER SET utf8 NOT NULL DEFAULT '') ENGINE = MyISAM DEFAULT CHARSET = utf8 COLLATE = utf8_bin COMMENT = 'Table privileges'");
506506
}
507+
508+
@Test
509+
public void testCreateTableIssue798() throws JSQLParserException {
510+
assertSqlCanBeParsedAndDeparsed("CREATE TABLE `comment` (`text_hash` varchar (32) COLLATE utf8_bin)");
511+
}
512+
513+
@Test
514+
public void testCreateTableIssue798_2() throws JSQLParserException {
515+
assertSqlCanBeParsedAndDeparsed("CREATE TABLE parent (\n"
516+
+ "PARENT_ID int(11) NOT NULL AUTO_INCREMENT,\n"
517+
+ "PCN varchar(100) NOT NULL,\n"
518+
+ "IS_DELETED char(1) NOT NULL,\n"
519+
+ "STRUCTURE_ID int(11) NOT NULL,\n"
520+
+ "DIRTY_STATUS char(1) NOT NULL,\n"
521+
+ "BIOLOGICAL char(1) NOT NULL,\n"
522+
+ "STRUCTURE_TYPE int(11) NOT NULL,\n"
523+
+ "CST_ORIGINAL varchar(1000) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,\n"
524+
+ "MWT decimal(14,6) DEFAULT NULL,\n"
525+
+ "RESTRICTED int(11) NOT NULL,\n"
526+
+ "INIT_DATE datetime DEFAULT NULL,\n"
527+
+ "MOD_DATE datetime DEFAULT NULL,\n"
528+
+ "CREATED_BY varchar(255) NOT NULL,\n"
529+
+ "MODIFIED_BY varchar(255) NOT NULL,\n"
530+
+ "CHEMIST_ID varchar(255) NOT NULL,\n"
531+
+ "UNKNOWN_ID int(11) DEFAULT NULL,\n"
532+
+ "STEREOCHEMISTRY varchar(256) DEFAULT NULL,\n"
533+
+ "GEOMETRIC_ISOMERISM varchar(256) DEFAULT NULL,\n"
534+
+ "PRIMARY KEY (PARENT_ID),\n"
535+
+ "UNIQUE KEY PARENT_PCN_IDX (PCN),\n"
536+
+ "KEY PARENT_SID_IDX (STRUCTURE_ID),\n"
537+
+ "KEY PARENT_DIRTY_IDX (DIRTY_STATUS)\n"
538+
+ ") ENGINE=InnoDB AUTO_INCREMENT=2663 DEFAULT CHARSET=utf8", true);
539+
}
507540
}

0 commit comments

Comments
 (0)