DBZ-7468 Support parsing MariaDB SYSTEM VERSIONING
DDL
This commit is contained in:
parent
237755331a
commit
8265e4e42e
@ -53,6 +53,7 @@ ARRAY: 'ARRAY';
|
||||
AS: 'AS';
|
||||
ASC: 'ASC';
|
||||
ATTRIBUTE: 'ATTRIBUTE';
|
||||
AUTO: 'AUTO'; // MariaDB-specific
|
||||
BEFORE: 'BEFORE';
|
||||
BETWEEN: 'BETWEEN';
|
||||
BOTH: 'BOTH';
|
||||
@ -211,6 +212,7 @@ STACKED: 'STACKED';
|
||||
STARTING: 'STARTING';
|
||||
STATEMENT: 'STATEMENT';
|
||||
STRAIGHT_JOIN: 'STRAIGHT_JOIN';
|
||||
SYSTEM_TIME: 'SYSTEM_TIME'; // MariaDB-specific
|
||||
TABLE: 'TABLE';
|
||||
TERMINATED: 'TERMINATED';
|
||||
THEN: 'THEN';
|
||||
|
@ -548,6 +548,21 @@ partitionFunctionDefinition
|
||||
'(' uidList? ')' #partitionFunctionKey // Optional uidList for MySQL only
|
||||
| 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
|
||||
|
@ -59,6 +59,9 @@ ALTER TABLE T1 ALTER I SET VISIBLE;
|
||||
ALTER TABLE T1 ALTER I SET INVISIBLE;
|
||||
ALTER TABLE IF EXISTS `add_test` ADD COLUMN IF NOT EXISTS `new_col` TEXT DEFAULT 'my_default';
|
||||
alter table user_details add index if not exists `country_id_index` (country_id), algorithm=NOCOPY;
|
||||
-- # MariaDB Specific
|
||||
ALTER TABLE t1 PARTITION BY SYSTEM_TIME INTERVAL 1 HOUR;
|
||||
ALTER TABLE t1 PARTITION BY SYSTEM_TIME INTERVAL 1 HOUR AUTO;
|
||||
#end
|
||||
#begin
|
||||
-- Alter database
|
||||
|
@ -748,3 +748,28 @@ ORDER BY 1
|
||||
;
|
||||
END
|
||||
#end
|
||||
|
||||
#begin
|
||||
CREATE TABLE `dailydata` (
|
||||
`DATE` bigint(20) NOT NULL,
|
||||
`ID` varchar(25) NOT NULL,
|
||||
`OPEN` double DEFAULT NULL,
|
||||
`HIGH` double DEFAULT NULL,
|
||||
`LOW` double DEFAULT NULL,
|
||||
`CLOSE` double DEFAULT NULL,
|
||||
PRIMARY KEY (`ID`,`DATE`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci WITH SYSTEM VERSIONING
|
||||
PARTITION BY SYSTEM_TIME INTERVAL 1 DAY STARTS TIMESTAMP'2024-02-05 00:00:00' AUTO
|
||||
PARTITIONS 6
|
||||
#end
|
||||
#begin
|
||||
CREATE TABLE t1 (x int) WITH SYSTEM VERSIONING PARTITION BY SYSTEM_TIME LIMIT 1000 AUTO;
|
||||
#end
|
||||
#begin
|
||||
CREATE TABLE t1 (x int) WITH SYSTEM VERSIONING PARTITION BY SYSTEM_TIME INTERVAL 1 HOUR AUTO;
|
||||
#endif
|
||||
#begin
|
||||
CREATE TABLE t1 (x int) WITH SYSTEM VERSIONING
|
||||
PARTITION BY SYSTEM_TIME INTERVAL 1 HOUR AUTO
|
||||
(PARTITION p0 HISTORY, PARTITION pn CURRENT);
|
||||
#end
|
||||
|
Loading…
Reference in New Issue
Block a user