summaryrefslogtreecommitdiff
path: root/mysql-test/suite
diff options
context:
space:
mode:
authorunknown <anozdrin/alik@ibm.opbmk>2007-08-31 22:13:27 +0400
committerunknown <anozdrin/alik@ibm.opbmk>2007-08-31 22:13:27 +0400
commitd7463b5e1bd9955919b32b6a6b21a6c818c18b66 (patch)
treefb6c016fc7a630d75c1977d962eed2b910deb32c /mysql-test/suite
parented9dcfb2874c4f5c6c0c470fba9a4c5ee78e084a (diff)
parent7e0ad09edff587dadc3e9855fc81e1b7de8f2199 (diff)
downloadmariadb-git-d7463b5e1bd9955919b32b6a6b21a6c818c18b66.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into ibm.opbmk:/home/alik/Documents/MySQL/devel/5.1-rt-bug25843 sql/mysql_priv.h: Auto merged sql/sp.cc: Auto merged sql/sp_head.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_db.cc: Auto merged
Diffstat (limited to 'mysql-test/suite')
-rw-r--r--mysql-test/suite/rpl/r/rpl_ps.result39
-rw-r--r--mysql-test/suite/rpl/t/rpl_ps.test68
2 files changed, 107 insertions, 0 deletions
diff --git a/mysql-test/suite/rpl/r/rpl_ps.result b/mysql-test/suite/rpl/r/rpl_ps.result
index 73c36af4862..dd3ed165226 100644
--- a/mysql-test/suite/rpl/r/rpl_ps.result
+++ b/mysql-test/suite/rpl/r/rpl_ps.result
@@ -26,5 +26,44 @@ from-master-2-'',
from-var-from-master-3
drop table t1;
stop slave;
+
+########################################################################
+#
+# BUG#25843: Changing default database between PREPARE and EXECUTE of
+# statement breaks binlog.
+#
+########################################################################
+
+#
+# Check that binlog is filled properly.
+#
+
+CREATE DATABASE mysqltest1;
+CREATE TABLE t1(c INT);
+
+RESET MASTER;
+RESET SLAVE;
+
+PREPARE stmt_d_1 FROM 'INSERT INTO t1 VALUES(1)';
+
+EXECUTE stmt_d_1;
+
+use mysqltest1;
+
+EXECUTE stmt_d_1;
+
+FLUSH LOGS;
+
+SHOW BINLOG EVENTS FROM 106;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000001 106 Query 2 193 use `test`; INSERT INTO t1 VALUES(1)
+slave-bin.000001 193 Query 2 280 use `test`; INSERT INTO t1 VALUES(1)
+slave-bin.000001 280 Rotate 2 323 slave-bin.000002;pos=4
+
+DROP DATABASE mysqltest1;
+
+use test;
+
+########################################################################
reset master;
reset slave;
diff --git a/mysql-test/suite/rpl/t/rpl_ps.test b/mysql-test/suite/rpl/t/rpl_ps.test
index b8792722192..0c8a499c9fe 100644
--- a/mysql-test/suite/rpl/t/rpl_ps.test
+++ b/mysql-test/suite/rpl/t/rpl_ps.test
@@ -46,6 +46,74 @@ stop slave;
# End of 4.1 tests
+#
+# Bug #25843 Changing default database between PREPARE and EXECUTE of statement
+# breaks binlog.
+#
+# There were actually two problems discovered by this bug:
+#
+# 1. Default (current) database is not fixed at the creation time.
+# That leads to wrong output of DATABASE() function.
+#
+# 2. Database attributes (@@collation_database) are not fixed at the creation
+# time. That leads to wrong resultset.
+#
+# Binlog breakage and Query Cache wrong output happened because of the first
+# problem.
+#
+
+--echo
+--echo ########################################################################
+--echo #
+--echo # BUG#25843: Changing default database between PREPARE and EXECUTE of
+--echo # statement breaks binlog.
+--echo #
+--echo ########################################################################
+
+###############################################################################
+
+--echo
+--echo #
+--echo # Check that binlog is filled properly.
+--echo #
+
+--echo
+CREATE DATABASE mysqltest1;
+CREATE TABLE t1(c INT);
+
+--echo
+RESET MASTER;
+RESET SLAVE;
+
+--echo
+PREPARE stmt_d_1 FROM 'INSERT INTO t1 VALUES(1)';
+
+--echo
+EXECUTE stmt_d_1;
+
+--echo
+use mysqltest1;
+
+--echo
+EXECUTE stmt_d_1;
+
+--echo
+FLUSH LOGS;
+
+--echo
+SHOW BINLOG EVENTS FROM 106;
+
+--echo
+DROP DATABASE mysqltest1;
+
+--echo
+use test;
+
+--echo
+--echo ########################################################################
+
+###############################################################################
+
reset master;
reset slave;
disconnect master;