File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
main/jjtree/net/sf/jsqlparser/parser
test/java/net/sf/jsqlparser/statement/alter Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -8731,11 +8731,13 @@ String AList():
87318731String ColumnsNamesListItem():
87328732{
87338733 Token tk = null;
8734+ Token sortDirection = null;
87348735 String item = null;
87358736}
87368737{
87378738 ( item = RelObjectName() )
87388739 [ LOOKAHEAD(2) "(" tk = <S_LONG> ")" { item = item + "(" + tk.image + ")"; } ]
8740+ [ (sortDirection = <K_ASC> | sortDirection = <K_DESC>) { item = item + " " + sortDirection.image; } ]
87398741 {
87408742 return item;
87418743 }
Original file line number Diff line number Diff line change @@ -572,6 +572,17 @@ public void testAlterTableIndex586() throws Exception {
572572 + "USING BTREE, ALGORITHM = INPLACE" , result .toString ());
573573 }
574574
575+ @ Test
576+ public void testAlterTableDropAndAddUniqueIndexWithAscendingColumns () throws Exception {
577+ Statement result =
578+ CCJSqlParserUtil .parse ("ALTER TABLE `wxp_dm`.`xqgl_req_report` "
579+ + "DROP INDEX `index_name`, "
580+ + "ADD UNIQUE INDEX `index_name`(`report_name` ASC) USING BTREE" );
581+ assertEquals ("ALTER TABLE `wxp_dm`.`xqgl_req_report` DROP INDEX `index_name`, "
582+ + "ADD UNIQUE INDEX `index_name` (`report_name` ASC) USING BTREE" ,
583+ result .toString ());
584+ }
585+
575586 @ Test
576587 public void testIssue259 () throws JSQLParserException {
577588 assertSqlCanBeParsedAndDeparsed (
You can’t perform that action at this time.
0 commit comments