diff options
author | Jan Lindström <jan.lindstrom@mariadb.com> | 2021-03-16 13:02:44 +0200 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@mariadb.com> | 2021-03-18 11:25:28 +0200 |
commit | c9ba668992a682502d939226f27c5a1c5aa98bb2 (patch) | |
tree | c93f07d0c651c625a6c1691d3117dbc4532ed6ec | |
parent | f4e14f0e2402fba24fa328dcc316f172a39dcfe2 (diff) | |
download | mariadb-git-c9ba668992a682502d939226f27c5a1c5aa98bb2.tar.gz |
MDEV-24916 : Assertion `current_stmt_binlog_format == BINLOG_FORMAT_STMT || current_stmt_binlog_format == BINLOG_FORMAT_ROW' failed in THD::is_current_stmt_binlog_format_row
Store old value of binlog format before wsrep code so that
if we bail out because wsrep is not ready for connections
we can restore binlog format correctly.
-rw-r--r-- | sql/sql_parse.cc | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index e8ab9a2511c..573df24cb33 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -3336,6 +3336,11 @@ mysql_execute_command(THD *thd) #ifdef HAVE_REPLICATION } /* endif unlikely slave */ #endif + /* store old value of binlog format */ + enum_binlog_format orig_binlog_format,orig_current_stmt_binlog_format; + + thd->get_binlog_format(&orig_binlog_format, + &orig_current_stmt_binlog_format); #ifdef WITH_WSREP if (wsrep && WSREP(thd)) { @@ -3387,12 +3392,6 @@ mysql_execute_command(THD *thd) DBUG_ASSERT(thd->transaction.stmt.modified_non_trans_table == FALSE); - /* store old value of binlog format */ - enum_binlog_format orig_binlog_format,orig_current_stmt_binlog_format; - - thd->get_binlog_format(&orig_binlog_format, - &orig_current_stmt_binlog_format); - /* Assign system variables with values specified by the clause SET STATEMENT var1=value1 [, var2=value2, ...] FOR <statement> @@ -7361,8 +7360,13 @@ void THD::reset_for_next_command(bool do_clear_error) thd->save_prep_leaf_list= false; - DBUG_PRINT("debug", - ("is_current_stmt_binlog_format_row(): %d", +#ifdef WITH_WSREP +#if !defined(DBUG_OFF) + if (mysql_bin_log.is_open()) +#endif +#endif + DBUG_PRINT("debug", + ("is_current_stmt_binlog_format_row(): %d", thd->is_current_stmt_binlog_format_row())); DBUG_VOID_RETURN; |