Skip to content

Commit

Permalink
DBZ-8270 Remove MariaDB specific grammar from MySQL grammar; Add miss…
Browse files Browse the repository at this point in the history
…ing grammar to MariaDB
  • Loading branch information
ani-sha authored and jpechane committed Dec 18, 2024
1 parent 322c7fa commit da9e385
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 307 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ STACKED : 'STACKED';
STARTING : 'STARTING';
STATEMENT : 'STATEMENT';
STRAIGHT_JOIN : 'STRAIGHT_JOIN';
SYSTEM : 'SYSTEM';
TABLE : 'TABLE';
TERMINATED : 'TERMINATED';
THEN : 'THEN';
Expand All @@ -232,6 +233,7 @@ USAGE : 'USAGE';
USE : 'USE';
USING : 'USING';
VALUES : 'VALUES';
VERSIONING : 'VERSIONING';
WHEN : 'WHEN';
WHERE : 'WHERE';
WHILE : 'WHILE';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@ tableOption
| tablespaceStorage # tableOptionTablespace
| TRANSACTIONAL '='? ('0' | '1') # tableOptionTransactional
| UNION '='? '(' tables ')' # tableOptionUnion
| WITH SYSTEM VERSIONING # tableOptionWithSystemVersioning // MariaDB-specific only
;

tableType
Expand All @@ -595,6 +596,19 @@ partitionFunctionDefinition
| LINEAR? KEY (ALGORITHM '=' algType = ('1' | '2'))? '(' uidList ')' # partitionFunctionKey
| RANGE ('(' expression ')' | COLUMNS '(' uidList ')') # partitionFunctionRange
| LIST ('(' expression ')' | COLUMNS '(' uidList ')') # partitionFunctionList
| SYSTEM_TIME (expression | LIMIT expression) (
STARTS (TIMESTAMP timestampValue | timestampValue)
)? AUTO? partitionSystemVersionDefinitions? # partitionSystemVersion // MariaDB-specific
;

// MariaDB-specific
partitionSystemVersionDefinitions
: '(' partitionSystemVersionDefinition (',' partitionSystemVersionDefinition)* ')'
;

// MariaDB-specific
partitionSystemVersionDefinition
: PARTITION uid (HISTORY | CURRENT)
;

subpartitionFunctionDefinition
Expand Down Expand Up @@ -1663,7 +1677,7 @@ privilege
: ALL PRIVILEGES?
| ALTER ROUTINE?
| CREATE (TEMPORARY TABLES | ROUTINE | VIEW | USER | TABLESPACE | ROLE)?
| DELETE
| DELETE (HISTORY)? // HISTORY is MariaDB-specific
| DROP (ROLE)?
| EVENT
| EXECUTE
Expand Down Expand Up @@ -2305,6 +2319,7 @@ dataType
) # spatialDataType
| typeName = LONG VARCHAR? BINARY? (charSet charsetName)? (COLLATE collationName)? # longVarcharDataType // LONG VARCHAR is the same as LONG
| LONG VARBINARY # longVarbinaryDataType
| UUID # uuidDataType // MariaDB-specific only
;

collectionOptions
Expand Down Expand Up @@ -3232,6 +3247,7 @@ keywordsCanBeId
| SETVAL
| SKIP_
| STATEMENT
| UUID
| VIA
| MONITOR
| READ_ONLY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ ARRAY: 'ARRAY';
AS: 'AS';
ASC: 'ASC';
ATTRIBUTE: 'ATTRIBUTE';
AUTO: 'AUTO'; // MariaDB-specific
BEFORE: 'BEFORE';
BETWEEN: 'BETWEEN';
BOTH: 'BOTH';
Expand Down Expand Up @@ -218,7 +217,6 @@ STACKED: 'STACKED';
STARTING: 'STARTING';
STATEMENT: 'STATEMENT';
STRAIGHT_JOIN: 'STRAIGHT_JOIN';
SYSTEM_TIME: 'SYSTEM_TIME'; // MariaDB-specific
TABLE: 'TABLE';
TERMINATED: 'TERMINATED';
THEN: 'THEN';
Expand Down Expand Up @@ -773,13 +771,6 @@ WEEK: 'WEEK';
SECOND: 'SECOND';
MICROSECOND: 'MICROSECOND';

// MariaDB: userstat plugin Keywords

USER_STATISTICS: 'USER_STATISTICS';
CLIENT_STATISTICS: 'CLIENT_STATISTICS';
INDEX_STATISTICS: 'INDEX_STATISTICS';
TABLE_STATISTICS: 'TABLE_STATISTICS';

// Azure Database for MySQL Single Server instance:
FIREWALL_RULES: 'FIREWALL_RULES';

Expand Down Expand Up @@ -1225,23 +1216,6 @@ YEARWEEK: 'YEARWEEK';
Y_FUNCTION: 'Y';
X_FUNCTION: 'X';

// MariaDB tokens
VIA: 'VIA';
LASTVAL: 'LASTVAL';
NEXTVAL: 'NEXTVAL';
SETVAL: 'SETVAL';
PREVIOUS: 'PREVIOUS';
PERSISTENT: 'PERSISTENT'; // Same as STORED for MySQL
BINLOG_MONITOR: 'BINLOG_MONITOR';
BINLOG_REPLAY: 'BINLOG_REPLAY';
FEDERATED_ADMIN: 'FEDERATED_ADMIN';
READ_ONLY_ADMIN: 'READ_ONLY_ADMIN';
REPLICA: 'REPLICA';
REPLICATION_MASTER_ADMIN: 'REPLICATION_MASTER_ADMIN';
MONITOR: 'MONITOR';
READ_ONLY: 'READ_ONLY';
REPLAY: 'REPLAY';

// Operators
// Operators. Assigns

Expand Down
Loading

0 comments on commit da9e385

Please sign in to comment.