Commit b233b15c authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-9868 Altering a partitioned table comment does a full copy

let handler::check_if_supported_inplace_alter()
(that detects frm-only changes) to work for partitioned
tables too.
parent 97728e10
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')); 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); insert into t1 (a) values (1),(2),(3);
alter online table t1 modify b int default 5; 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 ...@@ -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); alter online table t3 union=(t1,t2);
ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE. ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE.
drop table t1,t2,t3; 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;
...@@ -3,9 +3,7 @@ ...@@ -3,9 +3,7 @@
# #
--source include/have_innodb.inc --source include/have_innodb.inc
--disable_warnings --source include/have_partition.inc
drop table if exists t1,t2,t3;
--enable_warnings
# #
# Test of things that can be done online # 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 ...@@ -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 --error ER_ALTER_OPERATION_NOT_SUPPORTED
alter online table t3 union=(t1,t2); alter online table t3 union=(t1,t2);
drop table t1,t2,t3; 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;
...@@ -4209,6 +4209,7 @@ handler::check_if_supported_inplace_alter(TABLE *altered_table, ...@@ -4209,6 +4209,7 @@ handler::check_if_supported_inplace_alter(TABLE *altered_table,
Alter_inplace_info::ALTER_COLUMN_DEFAULT | Alter_inplace_info::ALTER_COLUMN_DEFAULT |
Alter_inplace_info::ALTER_COLUMN_OPTION | Alter_inplace_info::ALTER_COLUMN_OPTION |
Alter_inplace_info::CHANGE_CREATE_OPTION | Alter_inplace_info::CHANGE_CREATE_OPTION |
Alter_inplace_info::ALTER_PARTITIONED |
Alter_inplace_info::ALTER_RENAME; Alter_inplace_info::ALTER_RENAME;
/* Is there at least one operation that requires copy algorithm? */ /* Is there at least one operation that requires copy algorithm? */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment