Skip to content

Commit 10dac42

Browse files
kevgsdr-m
authored andcommitted
MDEV-18444 ROW_FORMAT=COMPRESSED unnecessarily requires NOCOPY for INSTANT operation
instant_alter_column_possible(): allow non-rebuilding operations for ROW_FORMAT=COMPRESSED
1 parent c949d61 commit 10dac42

File tree

3 files changed

+38
-3
lines changed

3 files changed

+38
-3
lines changed

mysql-test/suite/innodb/r/instant_alter_bugs.result

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,21 @@ HANDLER h READ `PRIMARY` PREV WHERE 0;
128128
pk f1 f2 f3 f4 f5 f6 f7 f8 filler
129129
HANDLER h CLOSE;
130130
DROP TABLE t1;
131+
create table t (
132+
a varchar(9),
133+
b int,
134+
c int,
135+
row_start bigint unsigned generated always as row start invisible,
136+
row_end bigint unsigned generated always as row end invisible,
137+
period for system_time (row_start, row_end)
138+
) engine=innodb row_format=compressed with system versioning;
139+
insert into t values (repeat('a', 9), 1, 1);
140+
set @@system_versioning_alter_history = keep;
141+
alter table t modify a varchar(10), algorithm=instant;
142+
alter table t change b bb int, algorithm=instant;
143+
alter table t modify c int without system versioning, algorithm=instant;
144+
set @@system_versioning_alter_history = error;
145+
check table t;
146+
Table Op Msg_type Msg_text
147+
test.t check status OK
148+
drop table t;

mysql-test/suite/innodb/t/instant_alter_bugs.test

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,21 @@ HANDLER h CLOSE;
136136
DROP TABLE t1;
137137
--let $datadir= `select @@datadir`
138138
--remove_file $datadir/test/load.data
139+
140+
141+
create table t (
142+
a varchar(9),
143+
b int,
144+
c int,
145+
row_start bigint unsigned generated always as row start invisible,
146+
row_end bigint unsigned generated always as row end invisible,
147+
period for system_time (row_start, row_end)
148+
) engine=innodb row_format=compressed with system versioning;
149+
insert into t values (repeat('a', 9), 1, 1);
150+
set @@system_versioning_alter_history = keep;
151+
alter table t modify a varchar(10), algorithm=instant;
152+
alter table t change b bb int, algorithm=instant;
153+
alter table t modify c int without system versioning, algorithm=instant;
154+
set @@system_versioning_alter_history = error;
155+
check table t;
156+
drop table t;

storage/innobase/handler/handler0alter.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1465,9 +1465,6 @@ instant_alter_column_possible(
14651465
const TABLE* table,
14661466
const TABLE* altered_table)
14671467
{
1468-
if (!ib_table.supports_instant()) {
1469-
return false;
1470-
}
14711468
#if 1 // MDEV-17459: adjust fts_fetch_doc_from_rec() and friends; remove this
14721469
if (ib_table.fts) {
14731470
return false;
@@ -1521,6 +1518,8 @@ instant_alter_column_possible(
15211518
&& alter_options_need_rebuild(ha_alter_info, table)) {
15221519
return false;
15231520
}
1521+
} else if (!ib_table.supports_instant()) {
1522+
return false;
15241523
}
15251524

15261525
/* At the moment, we disallow ADD [UNIQUE] INDEX together with

0 commit comments

Comments
 (0)