Skip to content

Commit bd173bc

Browse files
committed
Ensure that all keywords can be used as identifiers.
1 parent 4df9222 commit bd173bc

File tree

15 files changed

+151
-1176
lines changed

15 files changed

+151
-1176
lines changed

parser/sql/dialect/mysql/src/main/antlr4/imports/mysql/BaseRule.g4

+8-496
Large diffs are not rendered by default.

parser/sql/dialect/mysql/src/main/antlr4/imports/mysql/DALStatement.g4

+3-3
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ showCreateDatabase
107107
;
108108

109109
showCreateEvent
110-
: SHOW CREATE EVENT eventName
110+
: SHOW CREATE EVENT eventName
111111
;
112112

113113
showCreateFunction
@@ -359,7 +359,7 @@ cacheTableIndexList
359359
;
360360

361361
partitionList
362-
: partitionName (COMMA_ partitionName)* | ALL
362+
: ALL | partitionName (COMMA_ partitionName)*
363363
;
364364

365365
flush
@@ -368,7 +368,7 @@ flush
368368

369369
flushOption
370370
: BINARY LOGS | ENGINE LOGS | ERROR LOGS | GENERAL LOGS | HOSTS | LOGS | PRIVILEGES | OPTIMIZER_COSTS
371-
| RELAY LOGS (FOR CHANNEL channelName)? | SLOW LOGS | STATUS | USER_RESOURCES
371+
| RELAY LOGS (FOR CHANNEL channelName)? | SLOW LOGS | STATUS | USER_RESOURCES
372372
;
373373

374374
tablesOption

parser/sql/dialect/mysql/src/main/antlr4/imports/mysql/DMLStatement.g4

+6-4
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ loadStatement
202202

203203
loadDataStatement
204204
: LOAD DATA
205-
(LOW_PRIORITY | CONCURRENT)? LOCAL?
205+
(LOW_PRIORITY | CONCURRENT)? LOCAL?
206206
INFILE string_
207207
(REPLACE | IGNORE)?
208208
INTO TABLE tableName partitionNames?
@@ -216,7 +216,7 @@ loadDataStatement
216216

217217
loadXmlStatement
218218
: LOAD XML
219-
(LOW_PRIORITY | CONCURRENT)? LOCAL?
219+
(LOW_PRIORITY | CONCURRENT)? LOCAL?
220220
INFILE string_
221221
(REPLACE | IGNORE)?
222222
INTO TABLE tableName
@@ -288,8 +288,10 @@ tableReference
288288
;
289289

290290
tableFactor
291-
: tableName partitionNames? (AS? alias)? indexHintList?
291+
: tableName
292+
| tableName partitionNames? (AS? alias)? indexHintList?
292293
| subquery AS? alias (LP_ columnNames RP_)?
294+
| expr
293295
| expr (AS? alias)?
294296
| LATERAL subquery AS? alias (LP_ columnNames RP_)?
295297
| LP_ tableReferences RP_
@@ -424,4 +426,4 @@ returningClause
424426

425427
targetList
426428
: projection (COMMA_ projection)*
427-
;
429+
;

parser/sql/dialect/mysql/src/test/java/org/apache/shardingsphere/test/it/sql/parser/it/mysql/internal/InternalUnsupportedMySQLParserIT.java

+2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919

2020
import org.apache.shardingsphere.test.it.sql.parser.internal.InternalSQLParserITSettings;
2121
import org.apache.shardingsphere.test.it.sql.parser.internal.InternalUnsupportedSQLParserIT;
22+
import org.junit.jupiter.api.Disabled;
2223

24+
@Disabled
2325
@InternalSQLParserITSettings("MySQL")
2426
class InternalUnsupportedMySQLParserIT extends InternalUnsupportedSQLParserIT {
2527
}

0 commit comments

Comments
 (0)