Commit d7b0c6d8 authored by Nikita Malyavin's avatar Nikita Malyavin Committed by Sergei Golubchik

MDEV-30987 main.alter_table_online times out with view-protocol

disabie view-protocol for certain places:
1. While a transaction is in progress: a view gets locked for a
transaction duration, so DROP VIEW from a servicing conneciton
deadlocks. We can't just disable servicing connection, as
CREATE VIEW and DROP VIEW commit implicitly.
2. For querying Opened_table_definitions: the actual query executed
is `SELECT * FROM mysqltest_tmp_v`, then the view is dropped
parent 55d1645d
...@@ -46,6 +46,7 @@ set sql_mode=default; ...@@ -46,6 +46,7 @@ set sql_mode=default;
--echo # --echo #
--echo # MDEV-28944 XA assertions failing in binlog_rollback and binlog_commit --echo # MDEV-28944 XA assertions failing in binlog_rollback and binlog_commit
--echo # --echo #
--disable_view_protocol
CREATE TABLE t (a INT) ENGINE=MyISAM; CREATE TABLE t (a INT) ENGINE=MyISAM;
INSERT INTO t VALUES (1); INSERT INTO t VALUES (1);
...@@ -65,6 +66,7 @@ XA COMMIT 'xid' ONE PHASE; ...@@ -65,6 +66,7 @@ XA COMMIT 'xid' ONE PHASE;
DROP TABLE t; DROP TABLE t;
--disconnect con1 --disconnect con1
--connection default --connection default
--enable_view_protocol
--echo # --echo #
--echo # MDEV-29068 Cascade foreign key updates do not apply in online alter --echo # MDEV-29068 Cascade foreign key updates do not apply in online alter
......
...@@ -61,9 +61,11 @@ set debug_sync= 'now SIGNAL end'; ...@@ -61,9 +61,11 @@ set debug_sync= 'now SIGNAL end';
--connection con2 --connection con2
commit; commit;
--connection default --connection default
--disable_view_protocol
select variable_value into @otd from information_schema.session_status where variable_name='Opened_table_definitions'; select variable_value into @otd from information_schema.session_status where variable_name='Opened_table_definitions';
select * from t1; select * from t1;
select variable_value-@otd from information_schema.session_status where variable_name='Opened_table_definitions'; select variable_value-@otd from information_schema.session_status where variable_name='Opened_table_definitions';
--enable_view_protocol
--echo # long transaction and add column --echo # long transaction and add column
create or replace table t1 (a int); create or replace table t1 (a int);
...@@ -693,6 +695,7 @@ alter table t1 add b int NULL, algorithm= copy, lock= none; ...@@ -693,6 +695,7 @@ alter table t1 add b int NULL, algorithm= copy, lock= none;
--connection con2 --connection con2
--reap --reap
update t1 set a= 222 where a = 2; update t1 set a= 222 where a = 2;
--disable_view_protocol
savepoint whoopsie; savepoint whoopsie;
update t1 set a= 123 where a = 1; update t1 set a= 123 where a = 1;
insert t3 values (2); insert t3 values (2);
...@@ -702,6 +705,7 @@ rollback to savepoint whoopsie; ...@@ -702,6 +705,7 @@ rollback to savepoint whoopsie;
select * from t1; select * from t1;
select * from t3; select * from t3;
commit; commit;
--enable_view_protocol
set debug_sync= 'now SIGNAL end'; set debug_sync= 'now SIGNAL end';
......
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