From 2e5b2a1abb543b4d328192b30a5c84eb7d5a1cd7 Mon Sep 17 00:00:00 2001 From: ParadoxV5 Date: Wed, 15 Apr 2026 16:02:15 -0600 Subject: [PATCH] MDEV-39190 mariadb-dump --dump-slave outputs partial output for old servers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When dumping from older servers, the MDEV-37146 optimization was clever to reuse the SHOW ALL SLAVES STATUS from an earlier step. But it forgot to rewind the tape before playing again, so it only saw a blank screen. It also left an extra “SHOW ALL SLAVES STATUS” text in dead code. This commit fixes both of these oversights. --- client/mysqldump.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/client/mysqldump.cc b/client/mysqldump.cc index 5ffff5ab45a5e..6136c514b97e1 100644 --- a/client/mysqldump.cc +++ b/client/mysqldump.cc @@ -6529,11 +6529,9 @@ static int do_show_slave_status(MYSQL *mysql_con, if (have_info_schema_slave_status) { - if (mysql_query_with_error_report( - mysql_con, &slave, have_info_schema_slave_status ? - "SELECT Connection_name, Master_Host, Master_Port, Relay_Master_Log_File," - " Exec_Master_Log_Pos FROM information_schema.SLAVE_STATUS" : - "SHOW ALL SLAVES STATUS" + if (mysql_query_with_error_report(mysql_con, &slave, + "SELECT Connection_name, Master_Host, Master_Port, Relay_Master_Log_File," + " Exec_Master_Log_Pos FROM information_schema.SLAVE_STATUS" )) { if (!ignore_errors) @@ -6544,7 +6542,11 @@ static int do_show_slave_status(MYSQL *mysql_con, } } else + { + // Reuse the SHOW ALL SLAVES STATUS results from do_stop_slave_sql() + mysql_data_seek(slave_status_res, 0); slave= slave_status_res; + } if (get_gtid_pos(gtid_pos, false)) {