DBZ-6016 Add CLUSTERING KEY constraint for TOKUDB

This commit is contained in:
Anisha Mohanty 2023-01-25 20:40:03 +05:30 committed by Jiri Pechanec
parent f53237c249
commit 232579a236
2 changed files with 10 additions and 0 deletions

View File

@ -418,6 +418,7 @@ columnConstraint
| INVISIBLE #invisibilityColumnConstraint
| (AUTO_INCREMENT | ON UPDATE currentTimestamp) #autoIncrementColumnConstraint
| PRIMARY? KEY #primaryKeyColumnConstraint
| CLUSTERING KEY #clusteringKeyColumnConstraint // Tokudb-specific only
| UNIQUE KEY? #uniqueKeyColumnConstraint
| COMMENT STRING_LITERAL #commentColumnConstraint
| COLUMN_FORMAT colformat=(FIXED | DYNAMIC | DEFAULT) #formatColumnConstraint
@ -442,6 +443,7 @@ tableConstraint
referenceDefinition #foreignKeyTableConstraint
| (CONSTRAINT name=uid?)?
CHECK '(' expression ')' #checkTableConstraint
| CLUSTERING KEY index=uid? indexColumnNames #clusteringKeyTableConstraint // Tokudb-specific only
;
referenceDefinition

View File

@ -74,6 +74,14 @@ CREATE TABLE table_items_with_subpartitions (id INT, purchased DATE)
)
);
CREATE TABLE `TABLE1` (
`COL1` INT(10) UNSIGNED NOT NULL,
`COL2` VARCHAR(32) NOT NULL,
`COL3` ENUM (`VAR1`,`VAR2`, `VAR3`) NOT NULL,
PRIMARY KEY (`COL1`, `COL2`, `COL3`),
CLUSTERING KEY `CLKEY1` (`COL3`, `COL2`))
ENGINE=TOKUDB DEFAULT CHARSET=CP1251;
CREATE TABLE positions_rollover (
id bigint(20) NOT NULL AUTO_INCREMENT,
time datetime NOT NULL,