@@ -9206,6 +9206,57 @@ List<Index.ColumnParams> ColumnNamesWithParamsList() : {
92069206 { return colNames; }
92079207}
92089208
9209+ Index.ColumnParams IndexColumnWithParams(): {
9210+ String columnName = null;
9211+ List<String> parameter = null;
9212+ Expression expression = null;
9213+ Index.ColumnParams column = null;
9214+ }
9215+ {
9216+ (
9217+ columnName=RelObjectName()
9218+ { parameter = null; }
9219+ [ parameter = CreateParameter() ]
9220+ {
9221+ column = new Index.ColumnParams(columnName, parameter);
9222+ }
9223+ |
9224+ "(" expression=Expression() ")"
9225+ { parameter = null; }
9226+ [ LOOKAHEAD(2) parameter = CreateParameter() ]
9227+ {
9228+ column = new Index.ColumnParams(expression, parameter);
9229+ }
9230+ )
9231+ {
9232+ return column;
9233+ }
9234+ }
9235+
9236+ List<Index.ColumnParams> IndexColumnsWithParamsList() : {
9237+ List<Index.ColumnParams> colNames = new ArrayList<Index.ColumnParams>();
9238+ Index.ColumnParams column = null;
9239+ }
9240+ {
9241+ "("
9242+ column=IndexColumnWithParams()
9243+ {
9244+ colNames.add(column);
9245+ }
9246+
9247+ (
9248+ ","
9249+ column=IndexColumnWithParams()
9250+ {
9251+ colNames.add(column);
9252+ }
9253+ )*
9254+
9255+ ")"
9256+
9257+ { return colNames; }
9258+ }
9259+
92099260Index Index(): {
92109261 ObjectNames name;
92119262}
@@ -9245,7 +9296,7 @@ CreateIndex CreateIndex():
92459296 <K_ON> table=Table()
92469297 )
92479298 )
9248- colNames = ColumnNamesWithParamsList ()
9299+ colNames = IndexColumnsWithParamsList ()
92499300 ( LOOKAHEAD(2) parameter=CreateParameter() { tailParameters.addAll(parameter); } )*
92509301 {
92519302 index.setColumns(colNames);
@@ -9404,7 +9455,7 @@ CreateTable CreateTable(boolean isUsingOrReplace):
94049455 }
94059456 tk=<K_INDEX>
94069457 sk3=RelObjectName()
9407- colNames = ColumnNamesWithParamsList ()
9458+ colNames = IndexColumnsWithParamsList ()
94089459 ( parameter=CreateParameter() { idxSpec.addAll(parameter); } )*
94099460 {
94109461 index = new Index().withType(tk.image).withName(sk3).withColumns(colNames).withIndexSpec(new ArrayList<String>(idxSpec));
@@ -9447,7 +9498,7 @@ CreateTable CreateTable(boolean isUsingOrReplace):
94479498 [ tk=<K_UNIQUE> ]
94489499 [ tk3=<K_FULLTEXT> | tk3=<K_SPATIAL> ] tk2=<K_KEY>
94499500 sk3=RelObjectName()
9450- colNames = ColumnNamesWithParamsList ()
9501+ colNames = IndexColumnsWithParamsList ()
94519502 ( parameter=CreateParameter() { idxSpec.addAll(parameter); } )*
94529503 {
94539504 index = new Index()
@@ -10377,6 +10428,7 @@ AlterExpression AlterExpression():
1037710428 String sk4 = null;
1037810429 ColDataType dataType;
1037910430 List<String> columnNames = null;
10431+ List<Index.ColumnParams> indexColumnNames = null;
1038010432 List<ConstraintState> constraints = null;
1038110433 ForeignKeyIndex fkIndex = null;
1038210434 Index index = null;
@@ -10426,18 +10478,18 @@ AlterExpression AlterExpression():
1042610478 LOOKAHEAD(3)
1042710479 sk3 = RelObjectName()
1042810480 [ LOOKAHEAD(2) sk4 = UsingIndexType() ]
10429- [ LOOKAHEAD(2) columnNames = ColumnsNamesList () ]
10481+ [ LOOKAHEAD(2) indexColumnNames = IndexColumnsWithParamsList () ]
1043010482 |
1043110483 [ LOOKAHEAD(2) sk4 = UsingIndexType() ]
10432- [ LOOKAHEAD(2) columnNames = ColumnsNamesList () ]
10484+ [ LOOKAHEAD(2) indexColumnNames = IndexColumnsWithParamsList () ]
1043310485 )
1043410486 IndexOptionList(indexSpec = new ArrayList<String>())
1043510487 {
1043610488 index = new Index()
1043710489 .withIndexKeyword(tk.image)
1043810490 .withName(sk3)
1043910491 .withUsing(sk4)
10440- .withColumnsNames(columnNames )
10492+ .withColumns(indexColumnNames )
1044110493 .withIndexSpec(indexSpec);
1044210494
1044310495 alterExp.setIndex(index);
0 commit comments