diff --git a/mysql-test/r/alter_table_online.result b/mysql-test/r/alter_table_online.result index db7319cadf1..7254fbec413 100644 --- a/mysql-test/r/alter_table_online.result +++ b/mysql-test/r/alter_table_online.result @@ -1,4 +1,3 @@ -drop table if exists t1,t2,t3; create table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b')); insert into t1 (a) values (1),(2),(3); alter online table t1 modify b int default 5; @@ -62,3 +61,6 @@ create table t3 (a int not null primary key, b int, c varchar(80)) engine=merge alter online table t3 union=(t1,t2); ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE. drop table t1,t2,t3; +create table t1 (i int) partition by hash(i) partitions 2; +alter online table t1 comment 'test'; +drop table t1; diff --git a/mysql-test/t/alter_table_online.test b/mysql-test/t/alter_table_online.test index a160abc8fe2..9ff2f766803 100644 --- a/mysql-test/t/alter_table_online.test +++ b/mysql-test/t/alter_table_online.test @@ -3,9 +3,7 @@ # --source include/have_innodb.inc ---disable_warnings -drop table if exists t1,t2,t3; ---enable_warnings +--source include/have_partition.inc # # Test of things that can be done online # @@ -101,3 +99,10 @@ create table t3 (a int not null primary key, b int, c varchar(80)) engine=merge --error ER_ALTER_OPERATION_NOT_SUPPORTED alter online table t3 union=(t1,t2); drop table t1,t2,t3; + +# +# MDEV-9868 Altering a partitioned table comment does a full copy +# +create table t1 (i int) partition by hash(i) partitions 2; +alter online table t1 comment 'test'; +drop table t1; diff --git a/sql/handler.cc b/sql/handler.cc index 9b217c60100..61d2b37c90f 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -4209,6 +4209,7 @@ handler::check_if_supported_inplace_alter(TABLE *altered_table, Alter_inplace_info::ALTER_COLUMN_DEFAULT | Alter_inplace_info::ALTER_COLUMN_OPTION | Alter_inplace_info::CHANGE_CREATE_OPTION | + Alter_inplace_info::ALTER_PARTITIONED | Alter_inplace_info::ALTER_RENAME; /* Is there at least one operation that requires copy algorithm? */