mirror of
https://github.com/MariaDB/server.git
synced 2025-11-22 17:44:29 +03:00
Merge joreland@bk-internal.mysql.com:/home/bk/mysql-5.1
into eel.(none):/home/jonas/src/mysql-5.1-push
This commit is contained in:
109
mysql-test/r/partition_mgm_err.result
Normal file
109
mysql-test/r/partition_mgm_err.result
Normal file
@@ -0,0 +1,109 @@
|
||||
CREATE TABLE t1 (a int, b int)
|
||||
PARTITION BY RANGE (a)
|
||||
(PARTITION x0 VALUES LESS THAN (2),
|
||||
PARTITION x1 VALUES LESS THAN (4),
|
||||
PARTITION x2 VALUES LESS THAN (6),
|
||||
PARTITION x3 VALUES LESS THAN (8),
|
||||
PARTITION x4 VALUES LESS THAN (10),
|
||||
PARTITION x5 VALUES LESS THAN (12),
|
||||
PARTITION x6 VALUES LESS THAN (14),
|
||||
PARTITION x7 VALUES LESS THAN (16),
|
||||
PARTITION x8 VALUES LESS THAN (18),
|
||||
PARTITION x9 VALUES LESS THAN (20));
|
||||
ALTER TABLE t1 REORGANISE PARTITION x0,x1 INTO
|
||||
(PARTITION x01 VALUES LESS THAN (2),
|
||||
PARTITION x11 VALUES LESS THAN (5));
|
||||
ERROR HY000: The new partitions cover a bigger range then the reorganised partitions do
|
||||
ALTER TABLE t1 DROP PARTITION x0, x1, x2, x3, x3;
|
||||
ERROR HY000: Error in list of partitions to change
|
||||
ALTER TABLE t1 DROP PARTITION x0, x1, x2, x10;
|
||||
ERROR HY000: Error in list of partitions to change
|
||||
ALTER TABLE t1 DROP PARTITION x10, x1, x2, x1;
|
||||
ERROR HY000: Error in list of partitions to change
|
||||
ALTER TABLE t1 DROP PARTITION x10, x1, x2, x3;
|
||||
ERROR HY000: Error in list of partitions to change
|
||||
ALTER TABLE t1 REORGANISE PARTITION x0,x1,x2,x3,x4,x5,x6,x7,x8,x9,x10 INTO
|
||||
(PARTITION x11 VALUES LESS THAN (22));
|
||||
ERROR HY000: More partitions to reorganise than there are partitions
|
||||
ALTER TABLE t1 REORGANISE PARTITION x0,x1,x2 INTO
|
||||
(PARTITION x1 VALUES LESS THAN (6));
|
||||
ERROR HY000: All partitions must have unique names in the table
|
||||
ALTER TABLE t1 REORGANISE PARTITION x0, x2 INTO
|
||||
(PARTITION x11 VALUES LESS THAN (2));
|
||||
ERROR HY000: When reorganising a set of partitions they must be in consecutive order
|
||||
ALTER TABLE t1 REORGANISE PARTITION x0, x1, x1 INTO
|
||||
(PARTITION x11 VALUES LESS THAN (4));
|
||||
ERROR HY000: Error in list of partitions to change
|
||||
ALTER TABLE t1 REORGANISE PARTITION x0,x1 INTO
|
||||
(PARTITION x01 VALUES LESS THAN (5));
|
||||
ERROR HY000: The new partitions cover a bigger range then the reorganised partitions do
|
||||
ALTER TABLE t1 REORGANISE PARTITION x0,x1 INTO
|
||||
(PARTITION x01 VALUES LESS THAN (4),
|
||||
PARTITION x11 VALUES LESS THAN (2));
|
||||
ERROR HY000: VALUES LESS THAN value must be strictly increasing for each partition
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a int)
|
||||
PARTITION BY KEY (a)
|
||||
PARTITIONS 2;
|
||||
ALTER TABLE t1 ADD PARTITION (PARTITION p1);
|
||||
ERROR HY000: All partitions must have unique names in the table
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a int)
|
||||
PARTITION BY KEY (a)
|
||||
(PARTITION x0, PARTITION x1, PARTITION x2, PARTITION x3, PARTITION x3);
|
||||
ERROR HY000: All partitions must have unique names in the table
|
||||
CREATE TABLE t1 (a int)
|
||||
PARTITION BY RANGE (a)
|
||||
SUBPARTITION BY KEY (a)
|
||||
SUBPARTITIONS 2
|
||||
(PARTITION x0 VALUES LESS THAN (4),
|
||||
PARTITION x1 VALUES LESS THAN (8));
|
||||
ALTER TABLE t1 ADD PARTITION (PARTITION x2 VALUES LESS THAN (5)
|
||||
(SUBPARTITION sp0, SUBPARTITION sp1));
|
||||
ERROR HY000: VALUES LESS THAN value must be strictly increasing for each partition
|
||||
ALTER TABLE t1 ADD PARTITION (PARTITION x2 VALUES LESS THAN (12)
|
||||
(SUBPARTITION sp0, SUBPARTITION sp1, SUBPARTITION sp2));
|
||||
ERROR HY000: Trying to Add partition(s) with wrong number of subpartitions
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a int)
|
||||
PARTITION BY LIST (a)
|
||||
(PARTITION x0 VALUES IN (1,2,3),
|
||||
PARTITION x1 VALUES IN (4,5,6));
|
||||
ALTER TABLE t1 ADD PARTITION (PARTITION x2 VALUES IN (3,4));
|
||||
ERROR HY000: Multiple definition of same constant in list partitioning
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a int);
|
||||
ALTER TABLE t1 ADD PARTITION PARTITIONS 1;
|
||||
ERROR HY000: Partition management on a not partitioned table is not possible
|
||||
ALTER TABLE t1 DROP PARTITION x1;
|
||||
ERROR HY000: Partition management on a not partitioned table is not possible
|
||||
ALTER TABLE t1 COALESCE PARTITION 1;
|
||||
ERROR HY000: Partition management on a not partitioned table is not possible
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a int)
|
||||
PARTITION BY KEY (a)
|
||||
(PARTITION x0, PARTITION x1);
|
||||
ALTER TABLE t1 ADD PARTITION PARTITIONS 0;
|
||||
ERROR HY000: At least one partition must be added
|
||||
ALTER TABLE t1 ADD PARTITION PARTITIONS 1024;
|
||||
ERROR HY000: Too many partitions were defined
|
||||
ALTER TABLE t1 DROP PARTITION x0;
|
||||
ERROR HY000: DROP PARTITION can only be used on RANGE/LIST partitions
|
||||
ALTER TABLE t1 COALESCE PARTITION 1;
|
||||
ALTER TABLE t1 COALESCE PARTITION 1;
|
||||
ERROR HY000: Cannot remove all partitions, use DROP TABLE instead
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a int)
|
||||
PARTITION BY RANGE (a)
|
||||
(PARTITION x0 VALUES LESS THAN (4),
|
||||
PARTITION x1 VALUES LESS THAN (8));
|
||||
ALTER TABLE t1 ADD PARTITION PARTITIONS 1;
|
||||
ERROR HY000: For RANGE partitions each partition must be defined
|
||||
ALTER TABLE t1 DROP PARTITION x2;
|
||||
ERROR HY000: Error in list of partitions to change
|
||||
ALTER TABLE t1 COALESCE PARTITION 1;
|
||||
ERROR HY000: COALESCE PARTITION can only be used on HASH/KEY partitions
|
||||
ALTER TABLE t1 DROP PARTITION x1;
|
||||
ALTER TABLE t1 DROP PARTITION x0;
|
||||
ERROR HY000: Cannot remove all partitions, use DROP TABLE instead
|
||||
DROP TABLE t1;
|
||||
@@ -726,3 +726,4 @@ partition by list (a)
|
||||
partitions 2
|
||||
(partition x1 values in 4,
|
||||
partition x2 values in (5));
|
||||
|
||||
|
||||
160
mysql-test/t/partition_mgm_err.test
Normal file
160
mysql-test/t/partition_mgm_err.test
Normal file
@@ -0,0 +1,160 @@
|
||||
#
|
||||
# Simple test for the erroneos create statements using the
|
||||
# partition storage engine
|
||||
#
|
||||
-- source include/have_partition.inc
|
||||
|
||||
#
|
||||
# Try faulty DROP PARTITION and COALESCE PARTITION
|
||||
#
|
||||
CREATE TABLE t1 (a int, b int)
|
||||
PARTITION BY RANGE (a)
|
||||
(PARTITION x0 VALUES LESS THAN (2),
|
||||
PARTITION x1 VALUES LESS THAN (4),
|
||||
PARTITION x2 VALUES LESS THAN (6),
|
||||
PARTITION x3 VALUES LESS THAN (8),
|
||||
PARTITION x4 VALUES LESS THAN (10),
|
||||
PARTITION x5 VALUES LESS THAN (12),
|
||||
PARTITION x6 VALUES LESS THAN (14),
|
||||
PARTITION x7 VALUES LESS THAN (16),
|
||||
PARTITION x8 VALUES LESS THAN (18),
|
||||
PARTITION x9 VALUES LESS THAN (20));
|
||||
|
||||
--error ER_REORG_OUTSIDE_RANGE
|
||||
ALTER TABLE t1 REORGANISE PARTITION x0,x1 INTO
|
||||
(PARTITION x01 VALUES LESS THAN (2),
|
||||
PARTITION x11 VALUES LESS THAN (5));
|
||||
|
||||
--error ER_DROP_PARTITION_NON_EXISTENT
|
||||
ALTER TABLE t1 DROP PARTITION x0, x1, x2, x3, x3;
|
||||
|
||||
--error ER_DROP_PARTITION_NON_EXISTENT
|
||||
ALTER TABLE t1 DROP PARTITION x0, x1, x2, x10;
|
||||
|
||||
--error ER_DROP_PARTITION_NON_EXISTENT
|
||||
ALTER TABLE t1 DROP PARTITION x10, x1, x2, x1;
|
||||
|
||||
--error ER_DROP_PARTITION_NON_EXISTENT
|
||||
ALTER TABLE t1 DROP PARTITION x10, x1, x2, x3;
|
||||
|
||||
--error ER_REORG_PARTITION_NOT_EXIST
|
||||
ALTER TABLE t1 REORGANISE PARTITION x0,x1,x2,x3,x4,x5,x6,x7,x8,x9,x10 INTO
|
||||
(PARTITION x11 VALUES LESS THAN (22));
|
||||
|
||||
--error ER_SAME_NAME_PARTITION
|
||||
ALTER TABLE t1 REORGANISE PARTITION x0,x1,x2 INTO
|
||||
(PARTITION x1 VALUES LESS THAN (6));
|
||||
|
||||
--error ER_CONSECUTIVE_REORG_PARTITIONS
|
||||
ALTER TABLE t1 REORGANISE PARTITION x0, x2 INTO
|
||||
(PARTITION x11 VALUES LESS THAN (2));
|
||||
|
||||
--error ER_DROP_PARTITION_NON_EXISTENT
|
||||
ALTER TABLE t1 REORGANISE PARTITION x0, x1, x1 INTO
|
||||
(PARTITION x11 VALUES LESS THAN (4));
|
||||
|
||||
--error ER_REORG_OUTSIDE_RANGE
|
||||
ALTER TABLE t1 REORGANISE PARTITION x0,x1 INTO
|
||||
(PARTITION x01 VALUES LESS THAN (5));
|
||||
|
||||
--error ER_RANGE_NOT_INCREASING_ERROR
|
||||
ALTER TABLE t1 REORGANISE PARTITION x0,x1 INTO
|
||||
(PARTITION x01 VALUES LESS THAN (4),
|
||||
PARTITION x11 VALUES LESS THAN (2));
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (a int)
|
||||
PARTITION BY KEY (a)
|
||||
PARTITIONS 2;
|
||||
|
||||
--error ER_SAME_NAME_PARTITION
|
||||
ALTER TABLE t1 ADD PARTITION (PARTITION p1);
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--error ER_SAME_NAME_PARTITION
|
||||
CREATE TABLE t1 (a int)
|
||||
PARTITION BY KEY (a)
|
||||
(PARTITION x0, PARTITION x1, PARTITION x2, PARTITION x3, PARTITION x3);
|
||||
|
||||
CREATE TABLE t1 (a int)
|
||||
PARTITION BY RANGE (a)
|
||||
SUBPARTITION BY KEY (a)
|
||||
SUBPARTITIONS 2
|
||||
(PARTITION x0 VALUES LESS THAN (4),
|
||||
PARTITION x1 VALUES LESS THAN (8));
|
||||
|
||||
--error ER_RANGE_NOT_INCREASING_ERROR
|
||||
ALTER TABLE t1 ADD PARTITION (PARTITION x2 VALUES LESS THAN (5)
|
||||
(SUBPARTITION sp0, SUBPARTITION sp1));
|
||||
|
||||
--error ER_ADD_PARTITION_SUBPART_ERROR
|
||||
ALTER TABLE t1 ADD PARTITION (PARTITION x2 VALUES LESS THAN (12)
|
||||
(SUBPARTITION sp0, SUBPARTITION sp1, SUBPARTITION sp2));
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (a int)
|
||||
PARTITION BY LIST (a)
|
||||
(PARTITION x0 VALUES IN (1,2,3),
|
||||
PARTITION x1 VALUES IN (4,5,6));
|
||||
|
||||
--error ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR
|
||||
ALTER TABLE t1 ADD PARTITION (PARTITION x2 VALUES IN (3,4));
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (a int);
|
||||
|
||||
--error ER_PARTITION_MGMT_ON_NONPARTITIONED
|
||||
ALTER TABLE t1 ADD PARTITION PARTITIONS 1;
|
||||
|
||||
--error ER_PARTITION_MGMT_ON_NONPARTITIONED
|
||||
ALTER TABLE t1 DROP PARTITION x1;
|
||||
|
||||
--error ER_PARTITION_MGMT_ON_NONPARTITIONED
|
||||
ALTER TABLE t1 COALESCE PARTITION 1;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (a int)
|
||||
PARTITION BY KEY (a)
|
||||
(PARTITION x0, PARTITION x1);
|
||||
|
||||
--error ER_ADD_PARTITION_NO_NEW_PARTITION
|
||||
ALTER TABLE t1 ADD PARTITION PARTITIONS 0;
|
||||
|
||||
--error ER_TOO_MANY_PARTITIONS_ERROR
|
||||
ALTER TABLE t1 ADD PARTITION PARTITIONS 1024;
|
||||
|
||||
--error ER_ONLY_ON_RANGE_LIST_PARTITION
|
||||
ALTER TABLE t1 DROP PARTITION x0;
|
||||
|
||||
ALTER TABLE t1 COALESCE PARTITION 1;
|
||||
|
||||
--error ER_DROP_LAST_PARTITION
|
||||
ALTER TABLE t1 COALESCE PARTITION 1;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (a int)
|
||||
PARTITION BY RANGE (a)
|
||||
(PARTITION x0 VALUES LESS THAN (4),
|
||||
PARTITION x1 VALUES LESS THAN (8));
|
||||
|
||||
--error ER_PARTITIONS_MUST_BE_DEFINED_ERROR
|
||||
ALTER TABLE t1 ADD PARTITION PARTITIONS 1;
|
||||
|
||||
--error ER_DROP_PARTITION_NON_EXISTENT
|
||||
ALTER TABLE t1 DROP PARTITION x2;
|
||||
|
||||
--error ER_COALESCE_ONLY_ON_HASH_PARTITION
|
||||
ALTER TABLE t1 COALESCE PARTITION 1;
|
||||
|
||||
ALTER TABLE t1 DROP PARTITION x1;
|
||||
|
||||
--error ER_DROP_LAST_PARTITION
|
||||
ALTER TABLE t1 DROP PARTITION x0;
|
||||
|
||||
DROP TABLE t1;
|
||||
Reference in New Issue
Block a user