summaryrefslogtreecommitdiff
path: root/sql/sql_binlog.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_binlog.cc')
-rw-r--r--sql/sql_binlog.cc34
1 files changed, 21 insertions, 13 deletions
diff --git a/sql/sql_binlog.cc b/sql/sql_binlog.cc
index d96e4d6456e..3b91a68c341 100644
--- a/sql/sql_binlog.cc
+++ b/sql/sql_binlog.cc
@@ -1,5 +1,4 @@
-/*
- Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -12,13 +11,22 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-*/
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#include "mysql_priv.h"
+#include "sql_priv.h"
+#include "sql_binlog.h"
+#include "sql_parse.h" // check_global_access
+#include "sql_acl.h" // *_ACL
#include "rpl_rli.h"
#include "base64.h"
-
+#include "slave.h" // apply_event_and_update_pos
+#include "log_event.h" // Format_description_log_event,
+ // EVENT_LEN_OFFSET,
+ // EVENT_TYPE_OFFSET,
+ // FORMAT_DESCRIPTION_LOG_EVENT,
+ // START_EVENT_V3,
+ // Log_event_type,
+ // Log_event
/**
Execute a BINLOG statement.
@@ -53,11 +61,11 @@ void mysql_client_binlog_statement(THD* thd)
size_t decoded_len= base64_needed_decoded_length(coded_len);
/*
- thd->options will be changed when applying the event. But we don't expect
+ option_bits will be changed when applying the event. But we don't expect
it be changed permanently after BINLOG statement, so backup it first.
It will be restored at the end of this function.
*/
- ulonglong thd_options= thd->options;
+ ulonglong thd_options= thd->variables.option_bits;
/*
Allocation
@@ -74,7 +82,7 @@ void mysql_client_binlog_statement(THD* thd)
rli= thd->rli_fake;
if (!rli)
{
- rli= thd->rli_fake= new Relay_log_info;
+ rli= thd->rli_fake= new Relay_log_info(FALSE);
#ifdef HAVE_purify
rli->is_fake= TRUE;
#endif
@@ -234,7 +242,7 @@ void mysql_client_binlog_statement(THD* thd)
TODO: Maybe a better error message since the BINLOG statement
now contains several events.
*/
- my_error(ER_UNKNOWN_ERROR, MYF(0), "Error executing BINLOG statement");
+ my_error(ER_UNKNOWN_ERROR, MYF(0));
goto end;
}
}
@@ -245,8 +253,8 @@ void mysql_client_binlog_statement(THD* thd)
my_ok(thd);
end:
- thd->options= thd_options;
- rli->clear_tables_to_lock();
- my_free(buf, MYF(MY_ALLOW_ZERO_PTR));
+ thd->variables.option_bits= thd_options;
+ rli->slave_close_thread_tables(thd);
+ my_free(buf);
DBUG_VOID_RETURN;
}