MDEV-31161 Assertion failures upon adding a too long key to table with COMPRESSED row

Problem:
=======
During InnoDB non-rebuild online alter operation, InnoDB set the
dummy log to clustered index online log. This can be used by
concurrent DML to identify whether the table undergoes online DDL.
InnoDB fails to reset the dummy log of clustered index in case
of error happened during prepare phase.

Solution:
========
Reset the InnoDB clustered index online log in case of error during
prepare phase.
parent 814dc467
91a92
> ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 1982. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
......@@ -82,3 +82,11 @@ f29(10), f30(10), f31(10), f32(10),
f33(10)))
ENGINE=InnoDB;
ERROR 42000: Too many key parts specified; max 32 parts allowed
#
# MDEV-31161 Assertion failures upon adding a too long key
# to table with COMPRESSED row format
#
CREATE TABLE t1(pk INT PRIMARY KEY, f1 INT, f2 TEXT)ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
INSERT INTO t1 (pk) VALUES (1);
ALTER TABLE t1 ADD KEY (f1), ADD KEY (f2(1000));
DROP TABLE t1;
......@@ -85,3 +85,19 @@ CREATE TABLE t1(f1 char(200), f2 char(200), f3 char(200),
f29(10), f30(10), f31(10), f32(10),
f33(10)))
ENGINE=InnoDB;
--echo #
--echo # MDEV-31161 Assertion failures upon adding a too long key
--echo # to table with COMPRESSED row format
--echo #
--let $page_size= `SELECT @@GLOBAL.innodb_page_size`
CREATE TABLE t1(pk INT PRIMARY KEY, f1 INT, f2 TEXT)ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
INSERT INTO t1 (pk) VALUES (1);
let $error_code = 0;
if ($page_size == 4096) {
let $error_code = ER_TOO_BIG_ROWSIZE;
}
--error $error_code
ALTER TABLE t1 ADD KEY (f1), ADD KEY (f2(1000));
DROP TABLE t1;
......@@ -7436,6 +7436,7 @@ prepare_inplace_alter_table_dict(
row_mysql_lock_data_dictionary(ctx->trx);
} else {
row_merge_drop_indexes(ctx->trx, user_table, true);
user_table->indexes.start->online_log = nullptr;
ctx->trx->commit();
}
......
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