diff options
author | Alfranio Correia <alfranio.correia@sun.com> | 2010-06-01 14:49:31 +0100 |
---|---|---|
committer | Alfranio Correia <alfranio.correia@sun.com> | 2010-06-01 14:49:31 +0100 |
commit | c54aabc93bfef93d8da7c4d4852a1d124ce549f7 (patch) | |
tree | fd3e39e11c99318f0d9755c7c1abf6fa06afd139 /sql/sql_class.cc | |
parent | ff6cf4bb462cf2d6fc0b761c40639f268eb0b5f5 (diff) | |
parent | 835759603561e0a12443c760dfcae37961c1948d (diff) | |
download | mariadb-git-c54aabc93bfef93d8da7c4d4852a1d124ce549f7.tar.gz |
auto-merge mysql-trunk-bugfixing (local) --> mysql-trunk-bugfixing.merge
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r-- | sql/sql_class.cc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 814ef27e574..dfe17fe5779 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -491,7 +491,6 @@ THD::THD() rli_fake(0), lock_id(&main_lock_id), user_time(0), in_sub_stmt(0), - sql_log_bin_toplevel(false), binlog_unsafe_warning_flags(0), binlog_table_maps(0), table_map_for_update(0), arg_of_last_insert_id_function(FALSE), @@ -960,7 +959,11 @@ void THD::init(void) update_charset(); reset_current_stmt_binlog_format_row(); bzero((char *) &status_var, sizeof(status_var)); - sql_log_bin_toplevel= variables.option_bits & OPTION_BIN_LOG; + + if (variables.sql_log_bin) + variables.option_bits|= OPTION_BIN_LOG; + else + variables.option_bits&= ~OPTION_BIN_LOG; #if defined(ENABLED_DEBUG_SYNC) /* Initialize the Debug Sync Facility. See debug_sync.cc. */ @@ -4608,8 +4611,13 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype, char const *query_arg, because the warnings should be printed only if the statement is actually logged. When executing decide_logging_format(), we cannot know for sure if the statement will be logged. + + Besides, we should not try to print these warnings if it is not + possible to write statements to the binary log as it happens when + the execution is inside a function, or generaly speaking, when + the variables.option_bits & OPTION_BIN_LOG is false. */ - if (sql_log_bin_toplevel) + if (variables.option_bits & OPTION_BIN_LOG) issue_unsafe_warnings(); switch (qtype) { |