From 2e99b0bef3654e6b230faecd52d88025bfb327a3 Mon Sep 17 00:00:00 2001 From: Alfranio Correia Date: Wed, 21 Apr 2010 14:28:00 +0100 Subject: [PATCH 1/3] BUG#51894 Replication failure with SBR on DROP TEMPORARY TABLE inside a transaction BUG#52616 Temp table prevents switch binlog format from STATEMENT to ROW Post-merge fixes. --- mysql-test/include/commit.inc | 4 ++-- mysql-test/r/commit_1innodb.result | 4 ++-- mysql-test/r/ctype_cp932_binlog_stm.result | 4 ---- mysql-test/t/ctype_cp932_binlog_stm.test | 2 ++ mysql-test/t/mysqlbinlog.test | 9 ++++++++- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/mysql-test/include/commit.inc b/mysql-test/include/commit.inc index 59d4f6be524..c0d30b56ef7 100644 --- a/mysql-test/include/commit.inc +++ b/mysql-test/include/commit.inc @@ -640,9 +640,9 @@ call p_verify_status_increment(2, 0, 1, 0); --echo # 25. DDL: DROP TEMPORARY TABLE, does not start a transaction --echo # drop temporary table t2; -call p_verify_status_increment(1, 0, 0, 0); +call p_verify_status_increment(1, 0, 1, 0); commit; -call p_verify_status_increment(1, 0, 0, 0); +call p_verify_status_increment(1, 0, 1, 0); --echo # 26. Verify that SET AUTOCOMMIT issues an implicit commit --echo # diff --git a/mysql-test/r/commit_1innodb.result b/mysql-test/r/commit_1innodb.result index f789e412233..0ebe74dbb78 100644 --- a/mysql-test/r/commit_1innodb.result +++ b/mysql-test/r/commit_1innodb.result @@ -709,11 +709,11 @@ SUCCESS # 25. DDL: DROP TEMPORARY TABLE, does not start a transaction # drop temporary table t2; -call p_verify_status_increment(1, 0, 0, 0); +call p_verify_status_increment(1, 0, 1, 0); SUCCESS commit; -call p_verify_status_increment(1, 0, 0, 0); +call p_verify_status_increment(1, 0, 1, 0); SUCCESS # 26. Verify that SET AUTOCOMMIT issues an implicit commit diff --git a/mysql-test/r/ctype_cp932_binlog_stm.result b/mysql-test/r/ctype_cp932_binlog_stm.result index cf5c41f4153..8aebe343fbb 100644 --- a/mysql-test/r/ctype_cp932_binlog_stm.result +++ b/mysql-test/r/ctype_cp932_binlog_stm.result @@ -78,11 +78,7 @@ CREATE TABLE t1 (b VARCHAR(2)); INSERT INTO t1 VALUES ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7'); INSERT INTO t1 VALUES ('8'),('9'),('A'),('B'),('C'),('D'),('E'),('F'); CREATE TEMPORARY TABLE head AS SELECT concat(b1.b, b2.b) AS head FROM t1 b1, t1 b2; -Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. CREATE TEMPORARY TABLE tail AS SELECT concat(b1.b, b2.b) AS tail FROM t1 b1, t1 b2; -Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe. DROP TABLE t1; CREATE TABLE t1 AS SELECT concat(head, tail) AS code, ' ' AS a diff --git a/mysql-test/t/ctype_cp932_binlog_stm.test b/mysql-test/t/ctype_cp932_binlog_stm.test index b251f6d9984..d429ae4a24f 100644 --- a/mysql-test/t/ctype_cp932_binlog_stm.test +++ b/mysql-test/t/ctype_cp932_binlog_stm.test @@ -64,8 +64,10 @@ INSERT INTO t1 VALUES ('8'),('9'),('A'),('B'),('C'),('D'),('E'),('F'); # # Populate tables head and tail with values '00'-'FF' # +--disable_warnings CREATE TEMPORARY TABLE head AS SELECT concat(b1.b, b2.b) AS head FROM t1 b1, t1 b2; CREATE TEMPORARY TABLE tail AS SELECT concat(b1.b, b2.b) AS tail FROM t1 b1, t1 b2; +--enable_warnings DROP TABLE t1; # # Populate table t1 with all codes [80..FF][20..FF] diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index a280d89f7aa..111a697a5e8 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -145,7 +145,14 @@ EOF # must be digestable for both client and server. In 4.1 the client # should use default-character-set same as the server. flush logs; ---exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000004 | $MYSQL +# Due to BUG#18337 that wrongly suppresses the BINLOG EVENTS when +# --short-form is used, the "insert into t5 select * from `äöüÄÖÜ`" +# which is unsafe and thus written to the binary log in the row +# format is not executed. This makes the assertion select * from t5 +# /* must be (1),(1) */; to fail. To temporary fix the bug, we +# removed the option --short-form. +#--exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000004 | $MYSQL +--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000004 | $MYSQL select * from t5 /* must be (1),(1) */; drop table t5; From fd64b18545d8e6dd9f4493162df068d174ffb24c Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Wed, 21 Apr 2010 23:58:54 +0400 Subject: [PATCH 2/3] Patch for Bug#53022: Compilation of "embedded" is broken. The bug was a side effect of WL#5030 (fix header files) and WL#5161 (CMake). The problem was that CMake-generated config.h (and my_config.h as a copy of it) had a header guard. GNU autotools-generated [my_]config.h did not. During WL#5030 the order of header files was changed, so the following started to happen (using GNU autotools, in embedded server): - my_config.h included, defining HAVE_OPENSSL - my_global.h included, un-defining HAVE_OPENSSL - zlib.h included, including config.h, defining HAVE_OPENSSL again. The fix is to change the order of header file, moving zlib.h to the top of the header list. More proper fix would be to wrap unguarded auto-generated [my_]config.h by guarded non-generated header file. --- sql/item_strfunc.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 32baae87c50..7025cf1af56 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -29,6 +29,13 @@ #pragma implementation // gcc: Class implementation #endif +/* + NOTE: zlib.h must be included *before* my_global.h because my_global.h + may undef some HAVE_ macros. Including zlib.h after my_global.h may lead + to re-defining undefined macros, thus to compile errors. +*/ +#include // Must be before my_global.h + /* May include caustic 3rd-party defs. Use early, so it can override nothing. */ #include "sha2.h" #include "my_global.h" // HAVE_* @@ -51,7 +58,6 @@ #include "my_md5.h" #include "sha1.h" #include "my_aes.h" -#include C_MODE_START #include "../mysys/my_static.h" // For soundex_map C_MODE_END From dbe6981b30caac4856368a61a861dac9f0a73d87 Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Wed, 21 Apr 2010 23:59:19 +0400 Subject: [PATCH 3/3] Ignoring auto-generated libmysqld/des_key_file.cc. --- .bzrignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.bzrignore b/.bzrignore index a4f1e919ab5..d51ffc7265b 100644 --- a/.bzrignore +++ b/.bzrignore @@ -3084,3 +3084,4 @@ libmysqld/keycaches.cc client/dtoa.c libmysqld/sql_audit.cc configure.am +libmysqld/des_key_file.cc