mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
MDEV-29013 ER_KEY_NOT_FOUND/lock timeout upon online alter with long unique
1. ER_KEY_NOT_FOUND general replcation problem, already fixed earlier. test added. 2. ER_LOCK_WAIT_TIMEOUT This is a long unique specific problem. Sometimes, lookup_handler is created for to->file. To properly free it, ha_reset should be called. It is usually done by calling close_thread_table, but ALTER TABLE makes it differently. Hence, a single ha_reset call is added to mysql_alter_table. Also, event_mem_root is removed. Normally, no per-event data should be allocated on thd->mem_root, that would mean a leak. And otherwise, lookup_handler is lazily allocated, but its lifetime matches statement, not event.
This commit is contained in:
committed by
Sergei Golubchik
parent
d6e0d29f84
commit
6e0f456090
@ -1059,6 +1059,60 @@ select * from t1;
|
||||
drop table t1;
|
||||
set debug_sync= 'reset';
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-29013 ER_KEY_NOT_FOUND/lock timeout upon online alter
|
||||
--echo # with long unique indexes
|
||||
--echo #
|
||||
create table t1 (b text not null, unique(b));
|
||||
insert into t1 values ('foo'),('bar');
|
||||
--send
|
||||
set debug_sync= 'now wait_for downgraded';
|
||||
|
||||
--connection con2
|
||||
set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
|
||||
--send
|
||||
alter table t1 add c int, algorithm=copy, lock=none;
|
||||
|
||||
--connection default
|
||||
--reap
|
||||
delete from t1;
|
||||
set debug_sync= 'now signal goforit';
|
||||
|
||||
--connection con2
|
||||
--reap
|
||||
|
||||
--connection default
|
||||
drop table t1;
|
||||
set debug_sync= reset;
|
||||
|
||||
--echo ###
|
||||
|
||||
create table t1 (a text, unique(a)) engine=innodb;
|
||||
create table t2 (b text, unique(b)) engine=innodb;
|
||||
insert into t2 values (null),(null);
|
||||
--send
|
||||
set debug_sync= 'now wait_for downgraded';
|
||||
|
||||
--connection con2
|
||||
set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
|
||||
--send
|
||||
alter table t2 add column c int, algorithm=copy, lock=none;
|
||||
|
||||
--connection default
|
||||
--reap
|
||||
delete from t2;
|
||||
set debug_sync= 'now signal goforit';
|
||||
|
||||
--connection con2
|
||||
--reap
|
||||
|
||||
--connection default
|
||||
alter table t2 force;
|
||||
alter table t1 force;
|
||||
|
||||
drop table t1, t2;
|
||||
set debug_sync= reset;
|
||||
|
||||
--echo #
|
||||
--echo # End of 11.2 tests
|
||||
--echo #
|
||||
|
Reference in New Issue
Block a user