From e007fcf59dd02407277b130dbd3984a7b5352c5e Mon Sep 17 00:00:00 2001 From: Sujatha Date: Tue, 8 Dec 2020 11:59:58 +0530 Subject: [PATCH] MDEV-19716: ASAN use-after-poison in Query_log_event::Query_log_event / THD::log_events_and_free_tmp_shares Post push fix to address test failure. Problem: ======= rpl.rpl_drop_temp_table_invaid_lex added as part bug fix has occasional failures in build bot. MTR's internal check of the test case 'rpl.rpl_drop_temp_table_invaid_lex' failed. Variable_name Value -Slave_open_temp_tables 0 +Slave_open_temp_tables 1 Analysis: ========= The reason for the failure is that the DROP TEMPORARY TABLE command which gets generated on connection disconnect might not have reached the slave and hence the temp table remains on the slave. Fix: === On master, upon disconnect, wait till connection is completely gone. Then ensure that DROP TEMPORARY table statement is available in the binary log. Sync the slave with master and check that temporary table count is zero on slave. Fixed a typo in test name. --- ...sult => rpl_drop_temp_table_invalid_lex.result} | 5 ++++- ...x.test => rpl_drop_temp_table_invalid_lex.test} | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) rename mysql-test/suite/rpl/r/{rpl_drop_temp_table_invaid_lex.result => rpl_drop_temp_table_invalid_lex.result} (62%) rename mysql-test/suite/rpl/t/{rpl_drop_temp_table_invaid_lex.test => rpl_drop_temp_table_invalid_lex.test} (64%) diff --git a/mysql-test/suite/rpl/r/rpl_drop_temp_table_invaid_lex.result b/mysql-test/suite/rpl/r/rpl_drop_temp_table_invalid_lex.result similarity index 62% rename from mysql-test/suite/rpl/r/rpl_drop_temp_table_invaid_lex.result rename to mysql-test/suite/rpl/r/rpl_drop_temp_table_invalid_lex.result index 49e9195ed35..f3c4cb4def2 100644 --- a/mysql-test/suite/rpl/r/rpl_drop_temp_table_invaid_lex.result +++ b/mysql-test/suite/rpl/r/rpl_drop_temp_table_invalid_lex.result @@ -4,5 +4,8 @@ connect con1,localhost,root,,; CREATE TEMPORARY TABLE tmp (a INT); CREATE TABLE non_existing_db.t SELECT 1 AS b; disconnect con1; -connection default; +connection master; +connection slave; +connection slave; +include/assert.inc ["Slave_open_temp_tables count should be 0"] include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_drop_temp_table_invaid_lex.test b/mysql-test/suite/rpl/t/rpl_drop_temp_table_invalid_lex.test similarity index 64% rename from mysql-test/suite/rpl/t/rpl_drop_temp_table_invaid_lex.test rename to mysql-test/suite/rpl/t/rpl_drop_temp_table_invalid_lex.test index 2d3031da544..475afef12fc 100644 --- a/mysql-test/suite/rpl/t/rpl_drop_temp_table_invaid_lex.test +++ b/mysql-test/suite/rpl/t/rpl_drop_temp_table_invalid_lex.test @@ -17,15 +17,25 @@ # MDEV-19716: ASAN use-after-poison in Query_log_event::Query_log_event / # THD::log_events_and_free_tmp_shares +--source include/have_binlog_format_mixed_or_statement.inc --source include/master-slave.inc --connect (con1,localhost,root,,) - CREATE TEMPORARY TABLE tmp (a INT); --send CREATE TABLE non_existing_db.t SELECT 1 AS b --disconnect con1 +--source include/wait_until_disconnected.inc ---connection default +--connection master +--let $wait_binlog_event= DROP +--source include/wait_for_binlog_event.inc +sync_slave_with_master; + +--connection slave +--let $open_temp_tbl_count=query_get_value(show status like 'Slave_open_temp_tables', Value, 1) +--let $assert_cond= "open_temp_tbl_count" = 0 +--let $assert_text= "Slave_open_temp_tables count should be 0" +--source include/assert.inc --source include/rpl_end.inc