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 @@ -9621,11 +9621,13 @@ String AList():
96219621String ColumnsNamesListItem():
96229622{
96239623 Token tk = null;
9624+ Token sortDirection = null;
96249625 String item = null;
96259626}
96269627{
96279628 ( item = RelObjectName() )
96289629 [ LOOKAHEAD(2) "(" tk = <S_LONG> ")" { item = item + "(" + tk.image + ")"; } ]
9630+ [ (sortDirection = <K_ASC> | sortDirection = <K_DESC>) { item = item + " " + sortDirection.image; } ]
96299631 {
96309632 return item;
96319633 }
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