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.
This commit is contained in:
Thirunarayanan Balathandayuthapani 2024-04-30 20:39:29 +05:30
parent 814dc46748
commit 156761db3b
4 changed files with 27 additions and 0 deletions

View file

@ -0,0 +1,2 @@
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

View file

@ -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;

View file

@ -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;

View file

@ -7436,6 +7436,7 @@ error_handled:
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();
}