Skip to content

Commit c9ba668

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 f4e14f0 commit c9ba668

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

sql/sql_parse.cc

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3336,6 +3336,11 @@ mysql_execute_command(THD *thd)
33363336
#ifdef HAVE_REPLICATION
33373337
} /* endif unlikely slave */
33383338
#endif
3339+
/* store old value of binlog format */
3340+
enum_binlog_format orig_binlog_format,orig_current_stmt_binlog_format;
3341+
3342+
thd->get_binlog_format(&orig_binlog_format,
3343+
&orig_current_stmt_binlog_format);
33393344
#ifdef WITH_WSREP
33403345
if (wsrep && WSREP(thd))
33413346
{
@@ -3387,12 +3392,6 @@ mysql_execute_command(THD *thd)
33873392

33883393
DBUG_ASSERT(thd->transaction.stmt.modified_non_trans_table == FALSE);
33893394

3390-
/* store old value of binlog format */
3391-
enum_binlog_format orig_binlog_format,orig_current_stmt_binlog_format;
3392-
3393-
thd->get_binlog_format(&orig_binlog_format,
3394-
&orig_current_stmt_binlog_format);
3395-
33963395
/*
33973396
Assign system variables with values specified by the clause
33983397
SET STATEMENT var1=value1 [, var2=value2, ...] FOR <statement>
@@ -7361,8 +7360,13 @@ void THD::reset_for_next_command(bool do_clear_error)
73617360

73627361
thd->save_prep_leaf_list= false;
73637362

7364-
DBUG_PRINT("debug",
7365-
("is_current_stmt_binlog_format_row(): %d",
7363+
#ifdef WITH_WSREP
7364+
#if !defined(DBUG_OFF)
7365+
if (mysql_bin_log.is_open())
7366+
#endif
7367+
#endif
7368+
DBUG_PRINT("debug",
7369+
("is_current_stmt_binlog_format_row(): %d",
73667370
thd->is_current_stmt_binlog_format_row()));
73677371

73687372
DBUG_VOID_RETURN;

0 commit comments

Comments
 (0)