From 13649d90ae90257620461cdd97bbf217bd1b1755 Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Fri, 3 Dec 2004 00:05:11 +0100 Subject: Prevent adding 'CREATE TABLE .. SELECT' query to the binary log when the insertion of new records partially failed. It would get logged because of the logic to log a partially-failed 'INSERT ... SELECT' (which can't be rolled back in non-transactional tables), but 'CREATE TABLE ... SELECT' is always rolled back on failure, even for non-transactional tables. (Bug #6682) (Original fix reimplemented after review by Serg and Guilhem.) --- sql/sql_class.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sql/sql_class.h') diff --git a/sql/sql_class.h b/sql/sql_class.h index 4250ebdd568..17d371d3dc0 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -637,6 +637,15 @@ public: #endif }; +# define tmp_disable_binlog(A) \ + ulong save_options= (A)->options, save_master_access= (A)->master_access; \ + (A)->options&= ~OPTION_BIN_LOG; \ + (A)->master_access|= SUPER_ACL; /* unneeded in 4.1 */ + +#define reenable_binlog(A) \ + (A)->options= save_options; \ + (A)->master_access= save_master_access; + /* Flags for the THD::system_thread (bitmap) variable */ #define SYSTEM_THREAD_DELAYED_INSERT 1 #define SYSTEM_THREAD_SLAVE_IO 2 @@ -781,6 +790,7 @@ public: {} int prepare(List &list); bool send_data(List &values); + void send_error(uint errcode,const char *err); bool send_eof(); void abort(); }; -- cgit v1.2.1