MDEV-28060 Online DDL fails while checking for instant alter condition

- InnoDB fails to skip newly created column while checking for
change column when table is in redundant row format. This issue
is caused the MDEV-18035 (ccb1acbd)
parent 8afabca6
......@@ -448,4 +448,13 @@ ALTER TABLE t ADD d INT;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
DROP TABLE t;
#
# MDEV-28060 Online DDL fails while checking for instant
# alter condition
#
CREATE TABLE t1(f1 CHAR(10) NOT NULL)ROW_FORMAT=REDUNDANT,ENGINE=InnoDB;
ALTER TABLE t1 ADD COLUMN(f2 INT NOT NULL, f3 INT NOT NULL,
f4 INT NOT NULL, f5 INT NOT NULL),
CHANGE COLUMN f1 f1 CHAR(10) DEFAULT NULL;
DROP TABLE t1;
SET GLOBAL innodb_purge_rseg_truncate_frequency=@save_frequency;
......@@ -466,4 +466,13 @@ ALTER TABLE t ADD d INT;
--disable_info
DROP TABLE t;
--echo #
--echo # MDEV-28060 Online DDL fails while checking for instant
--echo # alter condition
--echo #
CREATE TABLE t1(f1 CHAR(10) NOT NULL)ROW_FORMAT=REDUNDANT,ENGINE=InnoDB;
ALTER TABLE t1 ADD COLUMN(f2 INT NOT NULL, f3 INT NOT NULL,
f4 INT NOT NULL, f5 INT NOT NULL),
CHANGE COLUMN f1 f1 CHAR(10) DEFAULT NULL;
DROP TABLE t1;
SET GLOBAL innodb_purge_rseg_truncate_frequency=@save_frequency;
......@@ -1795,8 +1795,13 @@ instant_alter_column_possible(
Field** af = altered_table->field;
Field** const end = altered_table->field
+ altered_table->s->fields;
List_iterator_fast<Create_field> cf_it(
ha_alter_info->alter_info->create_list);
for (unsigned c = 0; af < end; af++) {
if (!(*af)->stored_in_db()) {
const Create_field* cf = cf_it++;
if (!cf->field || !(*af)->stored_in_db()) {
/* Ignore virtual or newly created
column */
continue;
}
......
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