diff options
author | Alfranio Correia <alfranio.correia@sun.com> | 2010-06-01 20:49:58 +0100 |
---|---|---|
committer | Alfranio Correia <alfranio.correia@sun.com> | 2010-06-01 20:49:58 +0100 |
commit | f11b030e1728744d345dca708819eaee09f43a7c (patch) | |
tree | ee51b952edd79fb74915ae3e49bee973f701a2a5 /sql/sql_class.cc | |
parent | 46bc8970c9b0afa3351cfacd58ce279b01c894dd (diff) | |
parent | 29c7acd6d41c5a7515b3757f87aedfe08accfe46 (diff) | |
download | mariadb-git-f11b030e1728744d345dca708819eaee09f43a7c.tar.gz |
auto-merge mysql-trunk-bugfixing (local) --> mysql-trunk-bugfixing
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) { |