You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// When removing partitioning, set all indexes to 'local' since it will become a non-partitioned table!
3234
3234
newGlobal=false
3235
3235
}
3236
-
if!index.Unique {
3237
-
// for now, only unique index can be global, non-unique indexes are 'local'
3238
-
// TODO: For the future loosen this restriction and allow non-unique global indexes
3239
-
ifnewGlobal {
3240
-
job.State=model.JobStateCancelled
3241
-
returnver, dbterror.ErrGeneralUnsupportedDDL.GenWithStackByArgs(fmt.Sprintf("PARTITION BY, index '%v' is not unique, but has Global Index set", index.Name.O))
Copy file name to clipboardExpand all lines: tests/integrationtest/r/globalindex/ddl.result
+93-35Lines changed: 93 additions & 35 deletions
Original file line number
Diff line number
Diff line change
@@ -5,39 +5,11 @@ Error 8200 (HY000): Unsupported Global Index on non-partitioned table
5
5
create table t (a int, b int, unique index idx(a) global) partition by hash(b) partitions 3;
6
6
drop table t;
7
7
create table t (a int, b int, index idx(a) global) partition by hash(b) partitions 3;
8
-
Error 8200 (HY000): Unsupported GLOBAL IndexOption on non-unique index
8
+
drop table t;
9
9
create table t3(a int not null, b int, primary key(a) nonclustered, unique idx_b(b) global) partition by hash(a) partitions 3;
10
10
drop table t3;
11
11
create table t (a int primary key nonclustered, b int) partition by hash(b) partitions 3;
12
12
Error 8264 (HY000): Global Index is needed for index 'PRIMARY', since the unique index is not including all partitioning columns, and GLOBAL is not given as IndexOption
13
-
create table t (a int, b int, unique key (a)) partition by hash(a) partitions 3;
14
-
alter table t partition by hash(b) partitions 3;
15
-
Error 8264 (HY000): Global Index is needed for index 'a', since the unique index is not including all partitioning columns, and GLOBAL is not given as IndexOption
16
-
alter table t partition by hash(b) partitions 3 update indexes (a global);
17
-
alter table t add index idxErr (b) global;
18
-
Error 8200 (HY000): Unsupported Global IndexOption on non-unique index
19
-
alter table t add unique index idxOK (b) global;
20
-
create index idxErr on t (b) global;
21
-
Error 8200 (HY000): Unsupported Global IndexOption on non-unique index
22
-
create unique index idxOK2 on t (b) global;
23
-
alter table t remove partitioning;
24
-
alter table t add index idxErr (b) global;
25
-
Error 8200 (HY000): Unsupported Global Index on non-partitioned table
26
-
alter table t add unique index idxErr (b) global;
27
-
Error 8200 (HY000): Unsupported Global Index on non-partitioned table
28
-
create index idxErr on t (b) global;
29
-
Error 8200 (HY000): Unsupported Global Index on non-partitioned table
30
-
create unique index idxErr on t (b) global;
31
-
Error 8200 (HY000): Unsupported Global Index on non-partitioned table
32
-
drop table t;
33
-
create table t (a int, b int, unique index idx(a) global);
34
-
Error 8200 (HY000): Unsupported Global Index on non-partitioned table
35
-
create table t (a int, b int, index idx(a) global);
36
-
Error 8200 (HY000): Unsupported Global Index on non-partitioned table
37
-
create table t (a int, b int, index idx(a) global) partition by hash(b) partitions 3;
38
-
Error 8200 (HY000): Unsupported GLOBAL IndexOption on non-unique index
39
-
create table t (a int not null, b int, primary key(a) nonclustered, unique idx_b(b) global) partition by hash(a) partitions 3;
40
-
drop table t;
41
13
create table t (a int key global, b int) partition by hash(b) partitions 3;
42
14
Error 8200 (HY000): Unsupported create an index that is both a global index and a clustered index
43
15
create table t (a int unique, b int) partition by hash(b) partitions 3;
@@ -65,14 +37,34 @@ create table t (a int, b int, unique key (a)) partition by hash(a) partitions 3;
65
37
alter table t partition by hash(b) partitions 3;
66
38
Error 8264 (HY000): Global Index is needed for index 'a', since the unique index is not including all partitioning columns, and GLOBAL is not given as IndexOption
67
39
alter table t partition by hash(b) partitions 3 UPDATE INDEXES (a GLOBAL);
alter table t partition by hash(b) partitions 3 UPDATE INDEXES (a LOCAL);
131
+
Error 8264 (HY000): Global Index is needed for index 'a', since the unique index is not including all partitioning columns, and GLOBAL is not given as IndexOption
132
+
alter table t partition by hash(b) partitions 3 UPDATE INDEXES (b LOCAL);
133
+
show create table t;
134
+
Table Create Table
135
+
t CREATE TABLE `t` (
136
+
`a` int DEFAULT NULL,
137
+
`b` int DEFAULT NULL,
138
+
UNIQUE KEY `a` (`a`) /*T![global_index] GLOBAL */,
0 commit comments