mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
1b74cbd9d6
mysql-test/r/partition.result: result fixed mysql-test/r/partition_mgm_err.result: result fixed mysql-test/t/partition.test: test case added mysql-test/t/partition_mgm_err.test: test modified to produce the declared error sql/handler.h: check_reorganise_list interface sql/sql_partition.cc: check_reorganise_list implementation sql/sql_table.cc: now we call check_reorganise_list to do proper test. Also we should set right no_parts value as it can change here
160 lines
4.1 KiB
Text
160 lines
4.1 KiB
Text
#
|
|
# 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 x3 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;
|