|
| 1 | +set tidb_enable_global_index=OFF; |
| 2 | +create table t (a int, b int, unique index idx(a) global); |
| 3 | +Error 8200 (HY000): Unsupported Global Index on non-partitioned table |
| 4 | +create table t (a int, b int, index idx(a) global); |
| 5 | +Error 8200 (HY000): Unsupported Global Index on non-partitioned table |
| 6 | +create table t (a int, b int, unique index idx(a) global) partition by hash(b) partitions 3; |
| 7 | +Error 1503 (HY000): A UNIQUE INDEX must include all columns in the table's partitioning function |
| 8 | +create table t (a int, b int, index idx(a) global) partition by hash(b) partitions 3; |
| 9 | +Error 8200 (HY000): Unsupported GLOBAL IndexOption when tidb_enable_global_index is disabled |
| 10 | +create table t3(a int not null, b int, primary key(a) nonclustered, unique idx_b(b) global) partition by hash(a) partitions 3; |
| 11 | +Error 1503 (HY000): A UNIQUE INDEX must include all columns in the table's partitioning function |
| 12 | +create table t (a int primary key nonclustered, b int) partition by hash(b) partitions 3; |
| 13 | +Error 1503 (HY000): A PRIMARY KEY must include all columns in the table's partitioning function |
| 14 | +create table t (a int, b int, unique key (a)) partition by hash(a) partitions 3; |
| 15 | +alter table t partition by hash(b) partitions 3; |
| 16 | +Error 1503 (HY000): A UNIQUE INDEX must include all columns in the table's partitioning function |
| 17 | +alter table t partition by hash(b) partitions 3 update indexes (a global); |
| 18 | +Error 1503 (HY000): A UNIQUE INDEX must include all columns in the table's partitioning function |
| 19 | +alter table t add index idxErr (b) global; |
| 20 | +Error 8200 (HY000): Unsupported Global IndexOption on non-unique index |
| 21 | +alter table t add unique index idxErr (b) global; |
| 22 | +Error 1503 (HY000): A UNIQUE INDEX must include all columns in the table's partitioning function |
| 23 | +create index idxErr on t (b) global; |
| 24 | +Error 8200 (HY000): Unsupported Global IndexOption on non-unique index |
| 25 | +create unique index idxErr on t (b) global; |
| 26 | +Error 1503 (HY000): A UNIQUE INDEX must include all columns in the table's partitioning function |
| 27 | +alter table t remove partitioning; |
| 28 | +alter table t add index idxErr (b) global; |
| 29 | +Error 8200 (HY000): Unsupported Global Index on non-partitioned table |
| 30 | +alter table t add unique index idxErr (b) global; |
| 31 | +Error 8200 (HY000): Unsupported Global Index on non-partitioned table |
| 32 | +create index idxErr on t (b) global; |
| 33 | +Error 8200 (HY000): Unsupported Global Index on non-partitioned table |
| 34 | +create unique index idxErr on t (b) global; |
| 35 | +Error 8200 (HY000): Unsupported Global Index on non-partitioned table |
| 36 | +drop table t; |
| 37 | +set tidb_enable_global_index=ON; |
| 38 | +create table t (a int, b int, unique index idx(a) global); |
| 39 | +Error 8200 (HY000): Unsupported Global Index on non-partitioned table |
| 40 | +create table t (a int, b int, index idx(a) global); |
| 41 | +Error 8200 (HY000): Unsupported Global Index on non-partitioned table |
| 42 | +create table t (a int, b int, index idx(a) global) partition by hash(b) partitions 3; |
| 43 | +Error 8200 (HY000): Unsupported GLOBAL IndexOption on non-unique index |
| 44 | +create table t (a int not null, b int, primary key(a) nonclustered, unique idx_b(b) global) partition by hash(a) partitions 3; |
| 45 | +drop table t; |
| 46 | +create table t (a int key global, b int) partition by hash(b) partitions 3; |
| 47 | +Error 1503 (HY000): A CLUSTERED INDEX must include all columns in the table's partitioning function |
| 48 | +create table t (a int unique, b int) partition by hash(b) partitions 3; |
| 49 | +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 |
| 50 | +create table t (a int unique key, b int) partition by hash(b) partitions 3; |
| 51 | +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 |
| 52 | +create table t (a int primary key nonclustered, b int) partition by hash(b) partitions 3; |
| 53 | +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 |
| 54 | +CREATE TABLE `t` ( |
| 55 | +`a` int(11) NOT NULL, |
| 56 | +`b` int(11) DEFAULT NULL, |
| 57 | +PRIMARY KEY (`a`) /*T![clustered_index] NONCLUSTERED */ /*T![global_index] GLOBAL */ |
| 58 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin |
| 59 | +PARTITION BY HASH (`b`) PARTITIONS 3; |
| 60 | +show create table t; |
| 61 | +Table Create Table |
| 62 | +t CREATE TABLE `t` ( |
| 63 | + `a` int(11) NOT NULL, |
| 64 | + `b` int(11) DEFAULT NULL, |
| 65 | + PRIMARY KEY (`a`) /*T![clustered_index] NONCLUSTERED */ /*T![global_index] GLOBAL */ |
| 66 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin |
| 67 | +PARTITION BY HASH (`b`) PARTITIONS 3 |
| 68 | +drop table t; |
| 69 | +create table t (a int, b int, unique key (a)) partition by hash(a) partitions 3; |
| 70 | +alter table t partition by hash(b) partitions 3; |
| 71 | +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 |
| 72 | +alter table t partition by hash(b) partitions 3 UPDATE INDEXES (a GLOBAL); |
| 73 | +alter table t add index idxErr (b) global; |
| 74 | +Error 8200 (HY000): Unsupported Global IndexOption on non-unique index |
| 75 | +alter table t add unique index idxOK (a) global; |
| 76 | +alter table t add unique index idxErr (b) global; |
| 77 | +Error 8200 (HY000): Unsupported Global IndexOption on index including all columns in the partitioning expression |
| 78 | +create index idxErr on t (b) global; |
| 79 | +Error 8200 (HY000): Unsupported Global IndexOption on non-unique index |
| 80 | +create unique index idxOK2 on t (a) global; |
| 81 | +create unique index idxErr on t (b) global; |
| 82 | +Error 8200 (HY000): Unsupported Global IndexOption on index including all columns in the partitioning expression |
0 commit comments