Skip to content

Commit b3a2761

Browse files
committed
Remove warning when using ScopedStatementReplication
1 parent 3e03b3d commit b3a2761

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

sql/sql_class.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4078,6 +4078,16 @@ class THD :public Statement,
40784078
DBUG_VOID_RETURN;
40794079
}
40804080

4081+
inline enum_binlog_format get_current_stmt_binlog_format()
4082+
{
4083+
return current_stmt_binlog_format;
4084+
}
4085+
4086+
inline void set_current_stmt_binlog_format(enum_binlog_format format)
4087+
{
4088+
current_stmt_binlog_format= format;
4089+
}
4090+
40814091
inline void set_current_stmt_binlog_format_row()
40824092
{
40834093
DBUG_ENTER("set_current_stmt_binlog_format_row");

sql/sql_update.cc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2850,17 +2850,19 @@ bool multi_update::send_eof()
28502850
break;
28512851
}
28522852
}
2853-
ScopedStatementReplication scoped_stmt_rpl(force_stmt ? thd : NULL);
2853+
enum_binlog_format save_binlog_format;
2854+
save_binlog_format= thd->get_current_stmt_binlog_format();
2855+
if (force_stmt)
2856+
thd->set_current_stmt_binlog_format_stmt();
28542857

28552858
if (thd->binlog_query(THD::ROW_QUERY_TYPE, thd->query(),
28562859
thd->query_length(), transactional_tables, FALSE,
28572860
FALSE, errcode))
2858-
{
28592861
local_error= 1;// Rollback update
2860-
}
2862+
thd->set_current_stmt_binlog_format(save_binlog_format);
28612863
}
28622864
}
2863-
DBUG_ASSERT(trans_safe || !updated ||
2865+
DBUG_ASSERT(trans_safe || !updated ||
28642866
thd->transaction.stmt.modified_non_trans_table);
28652867

28662868
if (likely(local_error != 0))

0 commit comments

Comments
 (0)