Skip to content

Commit 65ad8f9

Browse files
committed
1 parent 5783b65 commit 65ad8f9

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

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

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -569,20 +569,35 @@ public void testSettingCharacterSetIssue829() throws JSQLParserException {
569569

570570
assertEquals("GBK", colName.getColDataType().getCharacterSet());
571571
}
572-
572+
573573
@Test
574574
public void testCreateTableIssue924() throws JSQLParserException {
575575
assertSqlCanBeParsedAndDeparsed("CREATE TABLE test_descending_indexes (c1 INT, c2 INT, INDEX idx1 (c1 ASC, c2 DESC))");
576576
}
577-
577+
578578
@Test
579579
public void testCreateTableIssue924_2() throws JSQLParserException {
580580
assertSqlCanBeParsedAndDeparsed("CREATE TABLE test_descending_indexes (c1 INT, c2 INT, INDEX idx1 (c1 ASC, c2 ASC), INDEX idx2 (c1 ASC, c2 DESC), INDEX idx3 (c1 DESC, c2 ASC), INDEX idx4 (c1 DESC, c2 DESC))");
581581
}
582-
582+
583583
@Test
584584
public void testCreateTableIssue921() throws JSQLParserException {
585585
assertSqlCanBeParsedAndDeparsed("CREATE TABLE binary_test (c1 binary (10))");
586586
}
587-
}
588587

588+
@Test
589+
public void testCreateTableWithComments() throws JSQLParserException {
590+
assertSqlCanBeParsedAndDeparsed("CREATE TABLE IF NOT EXISTS `eai_applications`(\n"
591+
+ " `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'comment',\n"
592+
+ " `name` varchar(64) NOT NULL COMMENT 'comment',\n"
593+
+ " `logo` varchar(128) DEFAULT NULL COMMENT 'comment',\n"
594+
+ " `description` varchar(128) DEFAULT NULL COMMENT 'comment',\n"
595+
+ " `type` int(11) NOT NULL COMMENT 'comment',\n"
596+
+ " `status` tinyint(2) NOT NULL COMMENT 'comment',\n"
597+
+ " `creator_id` bigint(20) NOT NULL COMMENT 'comment',\n"
598+
+ " `created_at` datetime NOT NULL COMMENT 'comment',\n"
599+
+ " `updated_at` datetime NOT NULL COMMENT 'comment',\n"
600+
+ " PRIMARY KEY (`id`)\n"
601+
+ ") COMMENT='comment'", true);
602+
}
603+
}

0 commit comments

Comments
 (0)