mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
BUG#53437 @@session.sql_bin_log support in substatements is incorrect
The thd->variables.option_bits & OPTION_BIN_LOG is currently abused: it's both a system variable and an implementation switch. The current approach to this option bit breaks the session variable encapsulation. Besides it is allowed to change @@session.sql_bin_log within a transaction what may lead to not correctly logging a transaction. To fix the problems, we created a thd->variables variable to represent the "sql_log_bin" and prohibited its update inside a transaction or sub-statement.
This commit is contained in:
@ -428,6 +428,7 @@ typedef struct system_variables
|
||||
|
||||
uint binlog_format; ///< binlog format for this thd (see enum_binlog_format)
|
||||
my_bool binlog_direct_non_trans_update;
|
||||
my_bool sql_log_bin;
|
||||
uint completion_type;
|
||||
uint query_cache_type;
|
||||
uint tx_isolation;
|
||||
@ -1667,8 +1668,6 @@ public:
|
||||
|
||||
/* <> 0 if we are inside of trigger or stored function. */
|
||||
uint in_sub_stmt;
|
||||
/* TRUE when the current top has SQL_LOG_BIN ON */
|
||||
bool sql_log_bin_toplevel;
|
||||
|
||||
/* container for handler's private per-connection data */
|
||||
Ha_data ha_data[MAX_HA];
|
||||
|
Reference in New Issue
Block a user