diff --git a/mysql-test/r/not_partition.result b/mysql-test/r/not_partition.result index 8bff8708a86..3d6f3fe39a3 100644 --- a/mysql-test/r/not_partition.result +++ b/mysql-test/r/not_partition.result @@ -85,3 +85,17 @@ explain partitions select * from t1 where a='a ' OR a='a'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 Using where drop table t1; +# +# bug#11760213-52599: ALTER TABLE REMOVE PARTITIONING ON NON-PARTITIONED +# TABLE CORRUPTS MYISAM +DROP TABLE if exists `t1`; +CREATE TABLE `t1`(`a` INT)ENGINE=myisam; +ALTER TABLE `t1` ADD COLUMN `b` INT; +CREATE UNIQUE INDEX `i1` ON `t1`(`b`); +CREATE UNIQUE INDEX `i2` ON `t1`(`a`); +ALTER TABLE `t1` ADD PRIMARY KEY (`a`); +ALTER TABLE `t1` REMOVE PARTITIONING; +CHECK TABLE `t1` EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1; diff --git a/mysql-test/r/partition_disabled.result b/mysql-test/r/partition_disabled.result index edf3a56d9b2..c78552beb9d 100644 --- a/mysql-test/r/partition_disabled.result +++ b/mysql-test/r/partition_disabled.result @@ -91,3 +91,18 @@ explain partitions select * from t1 where a='a ' OR a='a'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 Using where drop table t1; +# +# bug#11760213-52599: ALTER TABLE REMOVE PARTITIONING ON NON-PARTITIONED +# TABLE CORRUPTS MYISAM +DROP TABLE if exists `t1`; +CREATE TABLE `t1`(`a` INT)ENGINE=myisam; +ALTER TABLE `t1` ADD COLUMN `b` INT; +CREATE UNIQUE INDEX `i1` ON `t1`(`b`); +CREATE UNIQUE INDEX `i2` ON `t1`(`a`); +ALTER TABLE `t1` ADD PRIMARY KEY (`a`); +ALTER TABLE `t1` REMOVE PARTITIONING; +ERROR HY000: Partition management on a not partitioned table is not possible +CHECK TABLE `t1` EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1; diff --git a/mysql-test/t/not_partition.test b/mysql-test/t/not_partition.test index a4faa794e3d..dd52e4b97e6 100644 --- a/mysql-test/t/not_partition.test +++ b/mysql-test/t/not_partition.test @@ -84,3 +84,17 @@ create table t1 (a varchar(10) charset latin1 collate latin1_bin); insert into t1 values (''),(' '),('a'),('a '),('a '); explain partitions select * from t1 where a='a ' OR a='a'; drop table t1; +--echo # +--echo # bug#11760213-52599: ALTER TABLE REMOVE PARTITIONING ON NON-PARTITIONED +--echo # TABLE CORRUPTS MYISAM +--disable_warnings +DROP TABLE if exists `t1`; +--enable_warnings +CREATE TABLE `t1`(`a` INT)ENGINE=myisam; +ALTER TABLE `t1` ADD COLUMN `b` INT; +CREATE UNIQUE INDEX `i1` ON `t1`(`b`); +CREATE UNIQUE INDEX `i2` ON `t1`(`a`); +ALTER TABLE `t1` ADD PRIMARY KEY (`a`); +ALTER TABLE `t1` REMOVE PARTITIONING; +CHECK TABLE `t1` EXTENDED; +DROP TABLE t1; diff --git a/mysql-test/t/partition_disabled.test b/mysql-test/t/partition_disabled.test index c3e6cd5119f..940aea105ce 100644 --- a/mysql-test/t/partition_disabled.test +++ b/mysql-test/t/partition_disabled.test @@ -85,3 +85,20 @@ create table t1 (a varchar(10) charset latin1 collate latin1_bin); insert into t1 values (''),(' '),('a'),('a '),('a '); explain partitions select * from t1 where a='a ' OR a='a'; drop table t1; + +--echo # +--echo # bug#11760213-52599: ALTER TABLE REMOVE PARTITIONING ON NON-PARTITIONED +--echo # TABLE CORRUPTS MYISAM +--disable_warnings +DROP TABLE if exists `t1`; +--enable_warnings +CREATE TABLE `t1`(`a` INT)ENGINE=myisam; +ALTER TABLE `t1` ADD COLUMN `b` INT; +CREATE UNIQUE INDEX `i1` ON `t1`(`b`); +CREATE UNIQUE INDEX `i2` ON `t1`(`a`); +ALTER TABLE `t1` ADD PRIMARY KEY (`a`); +--error ER_PARTITION_MGMT_ON_NONPARTITIONED +ALTER TABLE `t1` REMOVE PARTITIONING; +CHECK TABLE `t1` EXTENDED; +DROP TABLE t1; +