Commit 10dac429 authored by Eugene Kosov's avatar Eugene Kosov Committed by Marko Mäkelä

MDEV-18444 ROW_FORMAT=COMPRESSED unnecessarily requires NOCOPY for INSTANT operation

instant_alter_column_possible(): allow non-rebuilding operations for
ROW_FORMAT=COMPRESSED
parent c949d61e
...@@ -128,3 +128,21 @@ HANDLER h READ `PRIMARY` PREV WHERE 0; ...@@ -128,3 +128,21 @@ HANDLER h READ `PRIMARY` PREV WHERE 0;
pk f1 f2 f3 f4 f5 f6 f7 f8 filler pk f1 f2 f3 f4 f5 f6 f7 f8 filler
HANDLER h CLOSE; HANDLER h CLOSE;
DROP TABLE t1; DROP TABLE t1;
create table t (
a varchar(9),
b int,
c int,
row_start bigint unsigned generated always as row start invisible,
row_end bigint unsigned generated always as row end invisible,
period for system_time (row_start, row_end)
) engine=innodb row_format=compressed with system versioning;
insert into t values (repeat('a', 9), 1, 1);
set @@system_versioning_alter_history = keep;
alter table t modify a varchar(10), algorithm=instant;
alter table t change b bb int, algorithm=instant;
alter table t modify c int without system versioning, algorithm=instant;
set @@system_versioning_alter_history = error;
check table t;
Table Op Msg_type Msg_text
test.t check status OK
drop table t;
...@@ -136,3 +136,21 @@ HANDLER h CLOSE; ...@@ -136,3 +136,21 @@ HANDLER h CLOSE;
DROP TABLE t1; DROP TABLE t1;
--let $datadir= `select @@datadir` --let $datadir= `select @@datadir`
--remove_file $datadir/test/load.data --remove_file $datadir/test/load.data
create table t (
a varchar(9),
b int,
c int,
row_start bigint unsigned generated always as row start invisible,
row_end bigint unsigned generated always as row end invisible,
period for system_time (row_start, row_end)
) engine=innodb row_format=compressed with system versioning;
insert into t values (repeat('a', 9), 1, 1);
set @@system_versioning_alter_history = keep;
alter table t modify a varchar(10), algorithm=instant;
alter table t change b bb int, algorithm=instant;
alter table t modify c int without system versioning, algorithm=instant;
set @@system_versioning_alter_history = error;
check table t;
drop table t;
...@@ -1465,9 +1465,6 @@ instant_alter_column_possible( ...@@ -1465,9 +1465,6 @@ instant_alter_column_possible(
const TABLE* table, const TABLE* table,
const TABLE* altered_table) const TABLE* altered_table)
{ {
if (!ib_table.supports_instant()) {
return false;
}
#if 1 // MDEV-17459: adjust fts_fetch_doc_from_rec() and friends; remove this #if 1 // MDEV-17459: adjust fts_fetch_doc_from_rec() and friends; remove this
if (ib_table.fts) { if (ib_table.fts) {
return false; return false;
...@@ -1521,6 +1518,8 @@ instant_alter_column_possible( ...@@ -1521,6 +1518,8 @@ instant_alter_column_possible(
&& alter_options_need_rebuild(ha_alter_info, table)) { && alter_options_need_rebuild(ha_alter_info, table)) {
return false; return false;
} }
} else if (!ib_table.supports_instant()) {
return false;
} }
/* At the moment, we disallow ADD [UNIQUE] INDEX together with /* At the moment, we disallow ADD [UNIQUE] INDEX together with
......
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