File tree Expand file tree Collapse file tree 2 files changed +19
-16
lines changed
main/jjtree/net/sf/jsqlparser/parser
test/java/net/sf/jsqlparser/statement/select Expand file tree Collapse file tree 2 files changed +19
-16
lines changed Original file line number Diff line number Diff line change @@ -2084,31 +2084,27 @@ MySQLIndexHint MySQLIndexHint():
2084
2084
List<String> indexNameList = new ArrayList<String>();
2085
2085
}
2086
2086
{
2087
- (actionToken = <K_USE>
2087
+ (
2088
+ actionToken = <K_USE>
2088
2089
| actionToken = <K_SHOW>
2089
2090
| actionToken = <K_IGNORE>
2090
- | actionToken = <K_FORCE> )
2091
- (indexToken = <K_INDEX>
2092
- | indexToken = <K_KEY>)
2091
+ | actionToken = <K_FORCE>
2092
+ )
2093
+
2094
+ (
2095
+ indexToken = <K_INDEX>
2096
+ | indexToken = <K_KEY>
2097
+ )
2098
+
2093
2099
"("
2094
- indexName = Identifier () { indexNameList.add(indexName); }
2095
- ("," indexName= Identifier () { indexNameList.add(indexName); })*
2100
+ indexName = RelObjectNameWithoutValue () { indexNameList.add(indexName); }
2101
+ ("," indexName= RelObjectNameWithoutValue () { indexNameList.add(indexName); })*
2096
2102
")"
2097
2103
{
2098
2104
return new MySQLIndexHint(actionToken.image, indexToken.image, indexNameList);
2099
2105
}
2100
2106
}
2101
2107
2102
- String Identifier():
2103
- {
2104
- Token tk = null;
2105
- }
2106
- {
2107
- (tk=<S_IDENTIFIER>
2108
- | tk=<S_QUOTED_IDENTIFIER>)
2109
- { return tk.image; }
2110
- }
2111
-
2112
2108
FunctionItem FunctionItem():
2113
2109
{
2114
2110
Alias alias = null;
Original file line number Diff line number Diff line change @@ -4805,4 +4805,11 @@ public void testGroupByComplexExpressionIssue1308() throws JSQLParserException {
4805
4805
"from dual \n " +
4806
4806
"group by (case when 1=1 then 'X' else 'Y' end), column1" , true );
4807
4807
}
4808
+
4809
+ @ Test
4810
+ public void testReservedKeywordsMSSQLUseIndexIssue1325 () throws JSQLParserException {
4811
+ // without extra brackets
4812
+ assertSqlCanBeParsedAndDeparsed (
4813
+ "SELECT col FROM table USE INDEX(primary)" , true );
4814
+ }
4808
4815
}
You can’t perform that action at this time.
0 commit comments