From db06c5dd07e6ffd6a569afe6950fa77c2f02f811 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 13 May 2024 11:09:55 +0200 Subject: [PATCH] main.alter_table_online fails in --view disable view protocol (DROP VIEW doesn't work very well with transactions) and cosmetic cleanups --- mysql-test/main/alter_table_online.result | 15 ++++----------- mysql-test/main/alter_table_online.test | 19 +++++++------------ 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/mysql-test/main/alter_table_online.result b/mysql-test/main/alter_table_online.result index c8c0c782115..fb5f2abf984 100644 --- a/mysql-test/main/alter_table_online.result +++ b/mysql-test/main/alter_table_online.result @@ -241,22 +241,17 @@ drop sequence s; # # MDEV-33348 ALTER TABLE lock waiting stages are indistinguishable # -connect con2, localhost, root,,; -create or replace table t1 (a int); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +connect con2, localhost, root; +create table t1 (a int); insert t1 values (5); -connection con2; -begin; +start transaction; select * from t1; a 5 connection default; alter table t1 add b int NULL, algorithm= copy, lock= none; connection con2; +set @con= $con; select stage, state, info from information_schema.processlist where id = @con; stage 4 state Waiting for table metadata lock @@ -265,6 +260,4 @@ rollback; connection default; drop table t1; disconnect con2; -# # End of 11.2 tests -# diff --git a/mysql-test/main/alter_table_online.test b/mysql-test/main/alter_table_online.test index f0d70b05884..4d8f831186f 100644 --- a/mysql-test/main/alter_table_online.test +++ b/mysql-test/main/alter_table_online.test @@ -250,25 +250,21 @@ drop sequence s; --echo # --echo # MDEV-33348 ALTER TABLE lock waiting stages are indistinguishable --echo # ---connect (con2, localhost, root,,) +--disable_view_protocol +--connect con2, localhost, root -create or replace table t1 (a int); -show create table t1; +create table t1 (a int); insert t1 values (5); ---connection con2 -begin; +start transaction; select * from t1; + --connection default --let $con= `select connection_id()` send alter table t1 add b int NULL, algorithm= copy, lock= none; - --connection con2 -disable_query_log; -eval set @con= $con; -enable_query_log; - +evalp set @con= $con; let $wait_condition= select stage = 4 and progress = 100 and state= "Waiting for table metadata lock" @@ -284,7 +280,6 @@ reap; drop table t1; --disconnect con2 +--enable_view_protocol ---echo # --echo # End of 11.2 tests ---echo #