DBZ-6188 Allow optional uidList for partitionFunctionKey rule

This commit is contained in:
ani-sha 2023-03-15 19:33:21 +05:30 committed by Jiri Pechanec
parent 075954f359
commit 1847c9b116
2 changed files with 7 additions and 1 deletions

View File

@ -539,7 +539,7 @@ partitionDefinitions
partitionFunctionDefinition partitionFunctionDefinition
: LINEAR? HASH '(' expression ')' #partitionFunctionHash : LINEAR? HASH '(' expression ')' #partitionFunctionHash
| LINEAR? KEY (ALGORITHM '=' algType=('1' | '2'))? | LINEAR? KEY (ALGORITHM '=' algType=('1' | '2'))?
'(' uidList ')' #partitionFunctionKey '(' uidList? ')' #partitionFunctionKey // Optional uidList for MySQL only
| RANGE ( '(' expression ')' | COLUMNS '(' uidList ')' ) #partitionFunctionRange | RANGE ( '(' expression ')' | COLUMNS '(' uidList ')' ) #partitionFunctionRange
| LIST ( '(' expression ')' | COLUMNS '(' uidList ')' ) #partitionFunctionList | LIST ( '(' expression ')' | COLUMNS '(' uidList ')' ) #partitionFunctionList
; ;

View File

@ -180,6 +180,12 @@ GROUP_ID int(11) not null,
DATE_ADD datetime DEFAULT NULL, DATE_ADD datetime DEFAULT NULL,
primary key (USER_ID, GROUP_ID) primary key (USER_ID, GROUP_ID)
); );
CREATE TABLE T1 (
ID INT NOT NULL,
NAME VARCHAR(255),
UNIQUE KEY(ID)
) PARTITION BY KEY() PARTITIONS 2;
#end #end
#begin #begin
-- Rename table -- Rename table