1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

don't crash if ALTER TABLE fails and a long transaction blocks MDL upgrade

This commit is contained in:
Sergei Golubchik
2022-06-01 21:52:27 +02:00
parent 332f41aae3
commit b2be2e39a6
6 changed files with 77 additions and 31 deletions

View File

@@ -34,6 +34,38 @@ set debug_sync= 'now SIGNAL end';
--reap
select * from t1;
--echo # Insert, error
create or replace table t1 (a int);
insert t1 values (5), (5);
--connection con2
--send
set debug_sync= 'now WAIT_FOR ended';
--connection default
set session lock_wait_timeout=1;
set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
--send
alter table t1 add unique (a), algorithm= copy, lock= none;
--connection con2
--reap
start transaction;
insert into t1 values (123), (456), (789);
set debug_sync= 'now SIGNAL end';
--connection default
--error ER_DUP_ENTRY
--reap
--connection con2
commit;
--connection default
select variable_value into @otd from information_schema.session_status where variable_name='Opened_table_definitions';
select * from t1;
select variable_value-@otd from information_schema.session_status where variable_name='Opened_table_definitions';
set session lock_wait_timeout=default;
--echo # long transaction and add column
create or replace table t1 (a int);
insert t1 values (5);