File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
main/jjtree/net/sf/jsqlparser/parser
test/java/net/sf/jsqlparser/statement/create Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -3769,11 +3769,13 @@ CreateTable CreateTable():
37693769 sk3=RelObjectName()
37703770 /* colNames=ColumnsNamesList() */
37713771 colNames = ColumnNamesWithParamsList()
3772+ ( parameter=CreateParameter() { idxSpec.addAll(parameter); } )*
37723773 {
37733774 index = new Index();
37743775 index.setType((tk!=null?tk.image + " ":"") + (tk3!=null?tk3.image + " ":"") + tk2.image);
37753776 index.setName(sk3);
37763777 index.setColumnNamesWithParams(colNames);
3778+ index.setIndexSpec(idxSpec);
37773779 indexes.add(index);
37783780 }
37793781 )
Original file line number Diff line number Diff line change @@ -600,4 +600,13 @@ public void testCreateTableWithComments() throws JSQLParserException {
600600 + " PRIMARY KEY (`id`)\n "
601601 + ") COMMENT='comment'" , true );
602602 }
603+
604+ @ Test
605+ public void testCreateTableWithCommentIssue922 () throws JSQLParserException {
606+ assertSqlCanBeParsedAndDeparsed ("CREATE TABLE index_with_comment_test (\n "
607+ + "id int(11) NOT NULL,\n "
608+ + "name varchar(60) DEFAULT NULL,\n "
609+ + "KEY name_ind (name) COMMENT 'comment for the name index'\n "
610+ + ") ENGINE=InnoDB DEFAULT CHARSET=utf8" , true );
611+ }
603612}
You can’t perform that action at this time.
0 commit comments