summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2021-03-16 13:02:44 +0200
committerJan Lindström <jan.lindstrom@mariadb.com>2021-03-16 13:02:44 +0200
commitf4e4bff9928e7a2d9864cf401d5aacbe428cfb05 (patch)
tree63fe36a222f83631d1bf7e2e940131c9215c0bde
parent1ea6ac3c953f847da033254d5df67f57987a1884 (diff)
downloadmariadb-git-f4e4bff9928e7a2d9864cf401d5aacbe428cfb05.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_rowbb-10.4-MDEV-24916
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.cc22
1 files changed, 13 insertions, 9 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index bcd091d620b..dad7b804e7e 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -3673,6 +3673,11 @@ mysql_execute_command(THD *thd)
Json_writer_object trace_command(thd);
Json_writer_array trace_command_steps(thd, "steps");
+ /* 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(thd))
{
@@ -3724,12 +3729,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>
@@ -7552,9 +7551,14 @@ void THD::reset_for_next_command(bool do_clear_error)
save_prep_leaf_list= false;
- DBUG_PRINT("debug",
- ("is_current_stmt_binlog_format_row(): %d",
- is_current_stmt_binlog_format_row()));
+#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",
+ is_current_stmt_binlog_format_row()));
DBUG_VOID_RETURN;
}