From 36680b648aab158555efbde8bf1ec30e9a2ed9c9 Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Fri, 17 Nov 2023 18:20:32 +0100 Subject: [PATCH] MDEV-20523: rpl.create_or_replace_mix, rpl.create_or_replace_statement failed in buildbot with wrong result Wait for the disconnect of the other connection to complete, before running SHOW BINLOG EVENTS. Otherwise the DROP TEMPORARY TABLE that is binlogged during disconnect may not have appeared yet depending on thread scheduling. Signed-off-by: Kristian Nielsen --- mysql-test/suite/rpl/t/create_or_replace.inc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mysql-test/suite/rpl/t/create_or_replace.inc b/mysql-test/suite/rpl/t/create_or_replace.inc index 35a6ead60ca..c07356f8b17 100644 --- a/mysql-test/suite/rpl/t/create_or_replace.inc +++ b/mysql-test/suite/rpl/t/create_or_replace.inc @@ -212,12 +212,19 @@ set @@session.binlog_format=default; drop temporary table if exists t9; --connect(con1,localhost,root,,) +--let $conid = `SELECT CONNECTION_ID()` set session binlog_format=default; create temporary table t9 (i int); --echo *** Must be no DROP logged for t9 when there was no CREATE, at disconnect too *** --disconnect con1 --connection server_1 +# The disconnect runs asynchroneously. Wait for it to complete, otherwise the +# DROP TEMPORARY TABLE may not have been binlogged yet when SHOW BINLOG EVENTS +# is run. +--let $wait_condition= SELECT COUNT(*)=0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE ID=$conid +--source include/wait_condition.inc + --source include/show_binlog_events.inc # Clean up