diff options
Diffstat (limited to 'sql/set_var.cc')
-rw-r--r-- | sql/set_var.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sql/set_var.cc b/sql/set_var.cc index 5f3ceb725ea..8981e32777a 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -1316,6 +1316,14 @@ void fix_slave_exec_mode(enum_var_type type) bool sys_var_thd_binlog_format::check(THD *thd, set_var *var) { /* + Make the session variable 'binlog_format' read-only inside a transaction. + */ + if (thd->active_transaction() && (var->type == OPT_SESSION)) + { + my_error(ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT, MYF(0)); + return 1; + } + /* All variables that affect writing to binary log (either format or turning logging on and off) use the same checking. We call the superclass ::check function to assign the variable correctly, and |