Skip to content

Commit f4e4bff

Browse files
author
Jan Lindström
committed
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.
1 parent 1ea6ac3 commit f4e4bff

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

sql/sql_parse.cc

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3673,6 +3673,11 @@ mysql_execute_command(THD *thd)
36733673
Json_writer_object trace_command(thd);
36743674
Json_writer_array trace_command_steps(thd, "steps");
36753675

3676+
/* store old value of binlog format */
3677+
enum_binlog_format orig_binlog_format,orig_current_stmt_binlog_format;
3678+
3679+
thd->get_binlog_format(&orig_binlog_format,
3680+
&orig_current_stmt_binlog_format);
36763681
#ifdef WITH_WSREP
36773682
if (WSREP(thd))
36783683
{
@@ -3724,12 +3729,6 @@ mysql_execute_command(THD *thd)
37243729

37253730
DBUG_ASSERT(thd->transaction.stmt.modified_non_trans_table == FALSE);
37263731

3727-
/* store old value of binlog format */
3728-
enum_binlog_format orig_binlog_format,orig_current_stmt_binlog_format;
3729-
3730-
thd->get_binlog_format(&orig_binlog_format,
3731-
&orig_current_stmt_binlog_format);
3732-
37333732
/*
37343733
Assign system variables with values specified by the clause
37353734
SET STATEMENT var1=value1 [, var2=value2, ...] FOR <statement>
@@ -7552,9 +7551,14 @@ void THD::reset_for_next_command(bool do_clear_error)
75527551

75537552
save_prep_leaf_list= false;
75547553

7555-
DBUG_PRINT("debug",
7556-
("is_current_stmt_binlog_format_row(): %d",
7557-
is_current_stmt_binlog_format_row()));
7554+
#ifdef WITH_WSREP
7555+
#if !defined(DBUG_OFF)
7556+
if (mysql_bin_log.is_open())
7557+
#endif
7558+
#endif
7559+
DBUG_PRINT("debug",
7560+
("is_current_stmt_binlog_format_row(): %d",
7561+
is_current_stmt_binlog_format_row()));
75587562

75597563
DBUG_VOID_RETURN;
75607564
}

0 commit comments

Comments
 (0)