Please sign in to comment.
Bug#67433: Using SET GLOBAL SQL_LOG_BIN should not be allowed
Earlier in MySQL 5.5 development cycle, the SQL_LOG_BIN variable was made to be both global and session-scoped, instead of only session as it was in previous releases. The problem is that usage of SQL_LOG_BIN at the global scope can be quite dangerous. When SQL_LOG_BIN is changed globally, it does not immediately take effect for any sessions. It takes effect by becoming the default value for new sessions, and this setting is kept and cached for the duration of that session (unless changed). Setting it intentionally is unlikely to have a useful effect under any circumstance; setting it unintentionally, such as while intending to use SET [SESSION] is potentially disastrous. Accidentally using SET GLOBAL SQL_LOG_BIN will not show an immediate effect to the user, it won't have the desired session-level effect, and might cause other potential problems with local-only maintenance being logged and executed on slaves. Furthermore, a bigger problem is with the long term and possibly permanent damage which may result in irrecoverable or difficult data loss with binary logging being disabled for new (and unrelated) sessions. The solution is to revert the change and again make SQL_LOG_BIN a session-only variable, generating an error if it is used with SET GLOBAL.
- Loading branch information...
Showing with 18 additions and 28 deletions.
- +1 −7 mysql-test/suite/binlog/r/binlog_switch_inside_trans.result
- +1 −2 mysql-test/suite/binlog/t/binlog_grant.test
- +1 −5 mysql-test/suite/binlog/t/binlog_switch_inside_trans.test
- +3 −4 mysql-test/suite/sys_vars/r/sql_log_bin_basic.result
- +3 −1 mysql-test/suite/sys_vars/t/sql_log_bin_basic.test
- +9 −9 sql/sys_vars.cc