mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Patch for push of wl1354 Partitioning
This commit is contained in:
342
mysql-test/r/partition_list.result
Normal file
342
mysql-test/r/partition_list.result
Normal file
@@ -0,0 +1,342 @@
|
||||
drop table if exists t1;
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
c int not null)
|
||||
partition by list(a)
|
||||
partitions 2
|
||||
(partition x123 values in (1,5,6),
|
||||
partition x234 values in (4,7,8));
|
||||
INSERT into t1 VALUES (1,1,1);
|
||||
INSERT into t1 VALUES (2,1,1);
|
||||
ERROR HY000: Got error 1 from storage engine
|
||||
INSERT into t1 VALUES (3,1,1);
|
||||
ERROR HY000: Got error 1 from storage engine
|
||||
INSERT into t1 VALUES (4,1,1);
|
||||
INSERT into t1 VALUES (5,1,1);
|
||||
INSERT into t1 VALUES (6,1,1);
|
||||
INSERT into t1 VALUES (7,1,1);
|
||||
INSERT into t1 VALUES (8,1,1);
|
||||
INSERT into t1 VALUES (9,1,1);
|
||||
ERROR HY000: Got error 1 from storage engine
|
||||
INSERT into t1 VALUES (1,2,1);
|
||||
INSERT into t1 VALUES (1,3,1);
|
||||
INSERT into t1 VALUES (1,4,1);
|
||||
INSERT into t1 VALUES (7,2,1);
|
||||
INSERT into t1 VALUES (7,3,1);
|
||||
INSERT into t1 VALUES (7,4,1);
|
||||
SELECT * from t1;
|
||||
a b c
|
||||
1 1 1
|
||||
5 1 1
|
||||
6 1 1
|
||||
1 2 1
|
||||
1 3 1
|
||||
1 4 1
|
||||
4 1 1
|
||||
7 1 1
|
||||
8 1 1
|
||||
7 2 1
|
||||
7 3 1
|
||||
7 4 1
|
||||
SELECT * from t1 WHERE a=1;
|
||||
a b c
|
||||
1 1 1
|
||||
1 2 1
|
||||
1 3 1
|
||||
1 4 1
|
||||
SELECT * from t1 WHERE a=7;
|
||||
a b c
|
||||
7 1 1
|
||||
7 2 1
|
||||
7 3 1
|
||||
7 4 1
|
||||
SELECT * from t1 WHERE b=2;
|
||||
a b c
|
||||
1 2 1
|
||||
7 2 1
|
||||
UPDATE t1 SET a=8 WHERE a=7 AND b=3;
|
||||
SELECT * from t1;
|
||||
a b c
|
||||
1 1 1
|
||||
5 1 1
|
||||
6 1 1
|
||||
1 2 1
|
||||
1 3 1
|
||||
1 4 1
|
||||
4 1 1
|
||||
7 1 1
|
||||
8 1 1
|
||||
7 2 1
|
||||
8 3 1
|
||||
7 4 1
|
||||
UPDATE t1 SET a=8 WHERE a=5 AND b=1;
|
||||
SELECT * from t1;
|
||||
a b c
|
||||
1 1 1
|
||||
6 1 1
|
||||
1 2 1
|
||||
1 3 1
|
||||
1 4 1
|
||||
4 1 1
|
||||
7 1 1
|
||||
8 1 1
|
||||
7 2 1
|
||||
8 3 1
|
||||
7 4 1
|
||||
8 1 1
|
||||
DELETE from t1 WHERE a=8;
|
||||
SELECT * from t1;
|
||||
a b c
|
||||
1 1 1
|
||||
6 1 1
|
||||
1 2 1
|
||||
1 3 1
|
||||
1 4 1
|
||||
4 1 1
|
||||
7 1 1
|
||||
7 2 1
|
||||
7 4 1
|
||||
DELETE from t1 WHERE a=2;
|
||||
SELECT * from t1;
|
||||
a b c
|
||||
1 1 1
|
||||
6 1 1
|
||||
1 2 1
|
||||
1 3 1
|
||||
1 4 1
|
||||
4 1 1
|
||||
7 1 1
|
||||
7 2 1
|
||||
7 4 1
|
||||
DELETE from t1 WHERE a=5 OR a=6;
|
||||
SELECT * from t1;
|
||||
a b c
|
||||
1 1 1
|
||||
1 2 1
|
||||
1 3 1
|
||||
1 4 1
|
||||
4 1 1
|
||||
7 1 1
|
||||
7 2 1
|
||||
7 4 1
|
||||
ALTER TABLE t1
|
||||
partition by list(a)
|
||||
partitions 2
|
||||
(partition x123 values in (1,5,6),
|
||||
partition x234 values in (4,7,8));
|
||||
SELECT * from t1;
|
||||
a b c
|
||||
1 1 1
|
||||
1 2 1
|
||||
1 3 1
|
||||
1 4 1
|
||||
4 1 1
|
||||
7 1 1
|
||||
7 2 1
|
||||
7 4 1
|
||||
INSERT into t1 VALUES (6,2,1);
|
||||
INSERT into t1 VALUES (2,2,1);
|
||||
ERROR HY000: Got error 1 from storage engine
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
c int not null,
|
||||
primary key (a,b))
|
||||
partition by list (a)
|
||||
subpartition by hash (a+b)
|
||||
( partition x1 values in (1,2,3)
|
||||
( subpartition x11 nodegroup 0,
|
||||
subpartition x12 nodegroup 1),
|
||||
partition x2 values in (4,5,6)
|
||||
( subpartition x21 nodegroup 0,
|
||||
subpartition x22 nodegroup 1)
|
||||
);
|
||||
INSERT into t1 VALUES (1,1,1);
|
||||
INSERT into t1 VALUES (4,1,1);
|
||||
INSERT into t1 VALUES (7,1,1);
|
||||
ERROR HY000: Got error 1 from storage engine
|
||||
UPDATE t1 SET a=5 WHERE a=1;
|
||||
SELECT * from t1;
|
||||
a b c
|
||||
5 1 1
|
||||
4 1 1
|
||||
UPDATE t1 SET a=6 WHERE a=4;
|
||||
SELECT * from t1;
|
||||
a b c
|
||||
5 1 1
|
||||
6 1 1
|
||||
DELETE from t1 WHERE a=6;
|
||||
SELECT * from t1;
|
||||
a b c
|
||||
5 1 1
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
c int not null,
|
||||
primary key (a,b))
|
||||
partition by list (a)
|
||||
subpartition by hash (a+b)
|
||||
subpartitions 3
|
||||
( partition x1 values in (1,2,4)
|
||||
( subpartition x11 nodegroup 0,
|
||||
subpartition x12 nodegroup 1),
|
||||
partition x2 values in (3,5,6)
|
||||
( subpartition x21 nodegroup 0,
|
||||
subpartition x22 nodegroup 1)
|
||||
);
|
||||
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near '),
|
||||
partition x2 values in (3,5,6)
|
||||
( subpartition x21 nodegroup 0,
|
||||
subpartition x' at line 11
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
c int not null,
|
||||
primary key (a,b))
|
||||
partition by list (a)
|
||||
subpartition by hash (a+b)
|
||||
( partition x1 values in (1)
|
||||
( subpartition x11 nodegroup 0,
|
||||
subpartition xextra,
|
||||
subpartition x12 nodegroup 1),
|
||||
partition x2 values in (2)
|
||||
( subpartition x21 nodegroup 0,
|
||||
subpartition x22 nodegroup 1)
|
||||
);
|
||||
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near ')
|
||||
)' at line 14
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
c int not null,
|
||||
primary key (a,b))
|
||||
partition by key (a)
|
||||
subpartition by list (a+b)
|
||||
( partition x1
|
||||
( subpartition x11 engine myisam,
|
||||
subpartition x12 engine myisam),
|
||||
partition x2
|
||||
( subpartition x21 engine myisam,
|
||||
subpartition x22 engine myisam)
|
||||
);
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'list (a+b)
|
||||
( partition x1
|
||||
( subpartition x11 engine myisam,
|
||||
subpartition x12 eng' at line 7
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
c int not null,
|
||||
primary key (a,b))
|
||||
partition by key (a)
|
||||
subpartition by list (a+b)
|
||||
( partition x1
|
||||
( subpartition x11 engine myisam values in (0),
|
||||
subpartition x12 engine myisam values in (1)),
|
||||
partition x2
|
||||
( subpartition x21 engine myisam values in (0),
|
||||
subpartition x22 engine myisam values in (1))
|
||||
);
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'list (a+b)
|
||||
( partition x1
|
||||
( subpartition x11 engine myisam values in (0),
|
||||
subpar' at line 7
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
c int not null,
|
||||
primary key(a,b))
|
||||
partition by list (a)
|
||||
(partition x1 values in (1,2,9,4) tablespace ts1);
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
c int not null,
|
||||
primary key(a,b))
|
||||
partition by list (a);
|
||||
ERROR HY000: For LIST partitions each partition must be defined
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
c int not null,
|
||||
primary key(a,b))
|
||||
partition by list (3+4)
|
||||
partitions 2
|
||||
(partition x1 values in (4) tablespace ts1,
|
||||
partition x2 values in (8) tablespace ts2);
|
||||
ERROR HY000: Constant/Random expression in (sub)partitioning function is not allowed
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
c int not null,
|
||||
primary key(a,b))
|
||||
partition by list (a+d)
|
||||
partitions 2
|
||||
(partition x1 values in (4) tablespace ts1,
|
||||
partition x2 values in (8) tablespace ts2);
|
||||
ERROR 42S22: Unknown column 'd' in 'partition function'
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
c int not null,
|
||||
primary key(a,b))
|
||||
partition by list (a)
|
||||
partitions 2
|
||||
(partition x1 values in (4),
|
||||
partition x2);
|
||||
ERROR HY000: LIST PARTITIONING requires definition of VALUES IN for each partition
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
c int not null,
|
||||
primary key(a,b))
|
||||
partition by list (a)
|
||||
partitions 2
|
||||
(partition x1 values in (4),
|
||||
partition x2 values less than (5));
|
||||
ERROR HY000: Only RANGE PARTITIONING can use VALUES LESS THAN in partition definition
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
c int not null,
|
||||
primary key(a,b))
|
||||
partition by list (a)
|
||||
partitions 2
|
||||
(partition x1 values in (4,6),
|
||||
partition x2);
|
||||
ERROR HY000: LIST PARTITIONING requires definition of VALUES IN for each partition
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
c int not null,
|
||||
primary key(a,b))
|
||||
partition by list (a)
|
||||
partitions 2
|
||||
(partition x1 values in (4, 12+9),
|
||||
partition x2 values in (3, 21));
|
||||
ERROR HY000: Multiple definition of same constant in list partitioning
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
c int not null,
|
||||
primary key(a,b))
|
||||
partition by list (a)
|
||||
partitions 2
|
||||
(partition x1 values in (4.0, 12+8),
|
||||
partition x2 values in (3, 21));
|
||||
ERROR HY000: VALUES IN value must be of same type as partition function
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
c int not null,
|
||||
primary key(a,b))
|
||||
partition by list (a)
|
||||
partitions 2
|
||||
(partition x1 values in 4,
|
||||
partition x2 values in (5));
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '4,
|
||||
partition x2 values in (5))' at line 8
|
||||
Reference in New Issue
Block a user