summaryrefslogtreecommitdiff
path: root/mysql-test/suite/binlog/t
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/binlog/t')
-rw-r--r--mysql-test/suite/binlog/t/binlog_base64_flag.test3
-rw-r--r--mysql-test/suite/binlog/t/binlog_bug23533.test50
-rw-r--r--mysql-test/suite/binlog/t/binlog_bug36391-master.opt1
-rw-r--r--mysql-test/suite/binlog/t/binlog_bug36391.test30
-rw-r--r--mysql-test/suite/binlog/t/binlog_drop_if_exists.test115
-rw-r--r--mysql-test/suite/binlog/t/binlog_index-master.opt1
-rw-r--r--mysql-test/suite/binlog/t/binlog_index.test30
-rw-r--r--mysql-test/suite/binlog/t/binlog_innodb_row.test26
-rw-r--r--mysql-test/suite/binlog/t/binlog_max_extension.test19
-rw-r--r--mysql-test/suite/binlog/t/binlog_mixed_cache_stat.test (renamed from mysql-test/suite/binlog/t/binlog_mix_innodb_stat.test)2
-rw-r--r--mysql-test/suite/binlog/t/binlog_old_versions.test4
-rw-r--r--mysql-test/suite/binlog/t/binlog_query_filter_rules-master.opt1
-rw-r--r--mysql-test/suite/binlog/t/binlog_query_filter_rules.test32
-rw-r--r--mysql-test/suite/binlog/t/binlog_reset_master.test26
-rw-r--r--mysql-test/suite/binlog/t/binlog_row_cache_stat.test (renamed from mysql-test/suite/binlog/t/binlog_row_innodb_stat.test)2
-rw-r--r--mysql-test/suite/binlog/t/binlog_row_mysqlbinlog_db_filter.test6
-rw-r--r--mysql-test/suite/binlog/t/binlog_server_id.test29
-rw-r--r--mysql-test/suite/binlog/t/binlog_sf.test191
-rw-r--r--mysql-test/suite/binlog/t/binlog_sql_mode.test5
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_binlog-master.opt1
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_cache_stat.test (renamed from mysql-test/suite/binlog/t/binlog_stm_innodb_stat.test)2
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_do_db-master.opt1
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test2
-rw-r--r--mysql-test/suite/binlog/t/binlog_unsafe.test34
-rw-r--r--mysql-test/suite/binlog/t/disabled.def5
25 files changed, 571 insertions, 47 deletions
diff --git a/mysql-test/suite/binlog/t/binlog_base64_flag.test b/mysql-test/suite/binlog/t/binlog_base64_flag.test
index 3f1e4e98bec..2ec979aade0 100644
--- a/mysql-test/suite/binlog/t/binlog_base64_flag.test
+++ b/mysql-test/suite/binlog/t/binlog_base64_flag.test
@@ -151,6 +151,9 @@ iONkSBcBAAAAKwAAAMQBAAAQABAAAAAAAAEAA//4AQAAAAMAMTIzAQAAAA==
drop table t1, char63_utf8, char128_utf8;
+call mtr.add_suppression("Slave SQL.*master suffers from this bug: http:..bugs.mysql.com.bug.php.id=37426.* Error_code: 1105");
+call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* Error_code: 1535");
+call mtr.add_suppression("Slave SQL.*Column 1 of table .test.char128_utf8. cannot be converted.* Error_code: 1677");
--echo #
--echo # Bug #54393: crash and/or valgrind errors in
diff --git a/mysql-test/suite/binlog/t/binlog_bug23533.test b/mysql-test/suite/binlog/t/binlog_bug23533.test
new file mode 100644
index 00000000000..ca610e399e4
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_bug23533.test
@@ -0,0 +1,50 @@
+#############################################################
+# Bug#23533: CREATE SELECT max_binlog_cache_size test
+# case needed
+#############################################################
+
+--source include/have_innodb.inc
+--source include/have_log_bin.inc
+--source include/have_binlog_format_row.inc
+
+SET AUTOCOMMIT=0;
+
+# Create 1st table
+CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b TEXT, PRIMARY KEY(a)) ENGINE=InnoDB;
+--disable_query_log
+let $i= 1000;
+while ($i)
+{
+ BEGIN;
+ eval INSERT INTO t1 VALUES($i, REPEAT('x', 4096));
+ COMMIT;
+ dec $i;
+}
+--enable_query_log
+SELECT COUNT(*) FROM t1;
+
+# Set small value for max_binlog_cache_size
+let $saved_binlog_cache_size= query_get_value(SELECT @@binlog_cache_size AS Value, Value, 1);
+let $saved_max_binlog_cache_size= query_get_value(SELECT @@max_binlog_cache_size AS Value, Value, 1);
+SET GLOBAL binlog_cache_size=4096;
+SET GLOBAL max_binlog_cache_size=4096;
+
+# New value of max_binlog_cache_size will apply to new session
+disconnect default;
+connect(default,localhost,root,,test);
+
+# Copied data from t1 into t2 large than max_binlog_cache_size
+START TRANSACTION;
+--error ER_TRANS_CACHE_FULL
+CREATE TABLE t2 SELECT * FROM t1;
+COMMIT;
+SHOW TABLES LIKE 't%';
+
+# 5.1 End of Test
+--disable_query_log
+eval SET GLOBAL max_binlog_cache_size=$saved_max_binlog_cache_size;
+eval SET GLOBAL binlog_cache_size=$saved_binlog_cache_size;
+--enable_query_log
+DROP TABLE t1;
+disconnect default;
+connect(default,localhost,root,,test);
diff --git a/mysql-test/suite/binlog/t/binlog_bug36391-master.opt b/mysql-test/suite/binlog/t/binlog_bug36391-master.opt
new file mode 100644
index 00000000000..56273241f14
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_bug36391-master.opt
@@ -0,0 +1 @@
+--sql_mode=NO_BACKSLASH_ESCAPES
diff --git a/mysql-test/suite/binlog/t/binlog_bug36391.test b/mysql-test/suite/binlog/t/binlog_bug36391.test
new file mode 100644
index 00000000000..64d91dfafd9
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_bug36391.test
@@ -0,0 +1,30 @@
+#
+# BUG#36391 and BUG#38731
+#
+# The fix for BUG#20103 "Escaping with backslash does not work as expected"
+# was implemented too greedy though in that it not only changes the behavior
+# of backslashes within strings but in general, so disabling command shortcuts
+# like \G or \C (which in turn leads to BUG#36391: "mysqlbinlog creates invalid charset statements".
+#
+# The test executes simple commands that are stored in the binary log and
+# re-execute them through the mysql client which should have to process
+# some command shortcuts. The backslashes within strings is disabled in the file
+# rpl_bug36391-master.opt by the option --sql_mode=NO_BACKSLASH_ESCAPES.
+#
+#
+
+--source include/have_log_bin.inc
+--source include/have_binlog_format_mixed.inc
+
+CREATE TABLE t1(id INT);
+let $binlog= query_get_value(SHOW MASTER STATUS, File, 1);
+let $binlog_path= `SELECT CONCAT(@@DATADIR, '$binlog')`;
+SHOW TABLES;
+FLUSH LOGS;
+DROP TABLE t1;
+
+--exec $MYSQL_BINLOG $binlog_path | $MYSQL test
+SHOW TABLES;
+
+# Clean up
+DROP TABLE t1;
diff --git a/mysql-test/suite/binlog/t/binlog_drop_if_exists.test b/mysql-test/suite/binlog/t/binlog_drop_if_exists.test
new file mode 100644
index 00000000000..6b2b37ae791
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_drop_if_exists.test
@@ -0,0 +1,115 @@
+# BUG#13684:
+# SP: DROP PROCEDURE|FUNCTION IF EXISTS not binlogged if routine
+# does not exist
+#
+# There is an inconsistency with DROP DATABASE IF EXISTS, DROP
+# TABLE IF EXISTS and DROP VIEW IF EXISTS: those are binlogged even
+# if the DB or TABLE does not exist, whereas DROP PROCEDURE IF
+# EXISTS does not. It would be nice or at least consistent if DROP
+# PROCEDURE/STATEMENT worked the same too.
+#
+# Description:
+# DROP PROCEDURE|FUNCTION IF EXISTS does not get binlogged whereas DROP
+# DATABASE|TABLE|TRIGGER|... IF EXISTS do.
+#
+# Fixed DROP PROCEDURE|FUNCTION IF EXISTS by adding a call to
+# write_bin_log in mysql_execute_command. Checked also if all
+# documented "DROP (...) IF EXISTS" get binlogged. Left out DROP
+# SERVER IF EXISTS because it seems that it only gets binlogged when
+# using row event (see BUG#25705).
+#
+# TODO: add DROP SERVER IF EXISTS to the test case when its
+# binlogging procedure gets fixed (BUG#25705). Furthermore, when
+# logging in RBR format the events that get logged are effectively in
+# RBR format and not in STATEMENT format meaning that one must needs
+# to be extra careful when writing a test for it, or change the CREATE
+# SERVER logging to always log as STATEMENT. You can quickly check this
+# by enabling the flag below $fixed_bug_25705=1 and watch the diff on
+# the STDOUT. More detail may be found on the generated reject file.
+#
+# Test is implemented as follows:
+#
+# i) test each "drop if exists" (DDL), found in MySQL 5.1 manual,
+# on inexistent objects (except for DROP SERVER);
+# ii) show binlog events;
+# iii) create an object for each drop if exists statement;
+# iv) issue "drop if exists" in existent objects.
+# v) show binlog events;
+#
+# References:
+# http://dev.mysql.com/doc/refman/5.1/en/sql-syntax-data-definition.html
+#
+--source include/have_log_bin.inc
+RESET MASTER;
+
+disable_warnings;
+
+# test all "drop if exists" in manual with inexistent objects
+DROP PROCEDURE IF EXISTS db_bug_13684.p;
+DROP FUNCTION IF EXISTS db_bug_13684.f;
+DROP TRIGGER IF EXISTS db_bug_13684.tr;
+DROP VIEW IF EXISTS db_bug_13684.v;
+DROP EVENT IF EXISTS db_bug_13684.e;
+DROP TABLE IF EXISTS db_bug_13684.t;
+DROP DATABASE IF EXISTS db_bug_13684;
+
+let $fixed_bug_25705 = 0;
+
+if($fixed_bug_25705)
+{
+ DROP SERVER IF EXISTS s_bug_13684;
+}
+--source include/show_binlog_events.inc
+
+# test drop with existing values
+
+# create
+CREATE DATABASE db_bug_13684;
+
+CREATE TABLE db_bug_13684.t (a int);
+
+CREATE EVENT db_bug_13684.e
+ ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR
+ DO
+ UPDATE db_bug_13684.t SET a = a + 1;
+
+CREATE VIEW db_bug_13684.v
+ AS SELECT * FROM db_bug_13684.t;
+
+CREATE TRIGGER db_bug_13684.tr BEFORE INSERT ON db_bug_13684.t
+ FOR EACH ROW BEGIN
+ END;
+
+CREATE PROCEDURE db_bug_13684.p (OUT p1 INT)
+ BEGIN
+ END;
+
+CREATE FUNCTION db_bug_13684.f (s CHAR(20))
+ RETURNS CHAR(50) DETERMINISTIC
+ RETURN s;
+
+if($fixed_bug_25705)
+{
+ CREATE SERVER s_bug_13684
+ FOREIGN DATA WRAPPER mysql
+ OPTIONS (USER 'Remote', HOST '192.168.1.106', DATABASE 'test');
+}
+
+--source include/show_binlog_events.inc
+
+# drop existing
+DROP PROCEDURE IF EXISTS db_bug_13684.p;
+DROP FUNCTION IF EXISTS db_bug_13684.f;
+DROP TRIGGER IF EXISTS db_bug_13684.tr;
+DROP VIEW IF EXISTS db_bug_13684.v;
+DROP EVENT IF EXISTS db_bug_13684.e;
+DROP TABLE IF EXISTS db_bug_13684.t;
+DROP DATABASE IF EXISTS db_bug_13684;
+if($fixed_bug_25705)
+{
+ DROP SERVER IF EXISTS s_bug_13684;
+}
+
+--source include/show_binlog_events.inc
+
+enable_warnings;
diff --git a/mysql-test/suite/binlog/t/binlog_index-master.opt b/mysql-test/suite/binlog/t/binlog_index-master.opt
new file mode 100644
index 00000000000..cef79bc8585
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_index-master.opt
@@ -0,0 +1 @@
+--force-restart
diff --git a/mysql-test/suite/binlog/t/binlog_index.test b/mysql-test/suite/binlog/t/binlog_index.test
index 3847e40aeb2..86c314e9236 100644
--- a/mysql-test/suite/binlog/t/binlog_index.test
+++ b/mysql-test/suite/binlog/t/binlog_index.test
@@ -6,15 +6,20 @@ source include/not_embedded.inc;
# Don't test this under valgrind, memory leaks will occur
--source include/not_valgrind.inc
source include/have_debug.inc;
+# Avoid CrashReporter popup on Mac
+--source include/not_crashrep.inc
call mtr.add_suppression('Attempting backtrace');
call mtr.add_suppression('MSYQL_BIN_LOG::purge_logs failed to process registered files that would be purged.');
call mtr.add_suppression('MSYQL_BIN_LOG::open failed to sync the index file');
call mtr.add_suppression('Turning logging off for the whole duration of the MySQL server process.');
+call mtr.add_suppression('Could not open .*');
call mtr.add_suppression('MSYQL_BIN_LOG::purge_logs failed to clean registers before purging logs.');
flush tables;
let $old=`select @@debug`;
+RESET MASTER;
+
let $MYSQLD_DATADIR= `select @@datadir`;
let $INDEX=$MYSQLD_DATADIR/master-bin.index;
@@ -208,12 +213,26 @@ SELECT @index;
--echo # This should put the server in unsafe state and stop
--echo # accepting any command. If we inject a fault at this
--echo # point and continue the execution the server crashes.
---echo # Besides the flush command does not report an error.
--echo #
+--chmod 0644 $INDEX
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval SET @index=LOAD_FILE('$index')
+-- replace_regex /\.[\\\/]master/master/
+SELECT @index;
+
--echo # fault_injection_registering_index
SET SESSION debug="+d,fault_injection_registering_index";
+-- replace_regex /\.[\\\/]master/master/
+-- error ER_CANT_OPEN_FILE
flush logs;
+
+--chmod 0644 $INDEX
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval SET @index=LOAD_FILE('$index')
+-- replace_regex /\.[\\\/]master/master/
+SELECT @index;
+
--source include/restart_mysqld.inc
--chmod 0644 $INDEX
@@ -224,7 +243,16 @@ SELECT @index;
--echo # fault_injection_updating_index
SET SESSION debug="+d,fault_injection_updating_index";
+-- replace_regex /\.[\\\/]master/master/
+-- error ER_CANT_OPEN_FILE
flush logs;
+
+--chmod 0644 $INDEX
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval SET @index=LOAD_FILE('$index')
+-- replace_regex /\.[\\\/]master/master/
+SELECT @index;
+
--source include/restart_mysqld.inc
--chmod 0644 $INDEX
diff --git a/mysql-test/suite/binlog/t/binlog_innodb_row.test b/mysql-test/suite/binlog/t/binlog_innodb_row.test
index b491510c9c9..f4ad1058a7e 100644
--- a/mysql-test/suite/binlog/t/binlog_innodb_row.test
+++ b/mysql-test/suite/binlog/t/binlog_innodb_row.test
@@ -77,3 +77,29 @@ DROP TEMPORARY TABLE t1;
-- echo ###############################################
-- source include/show_binlog_events.inc
-- echo ###############################################
+
+
+--echo #
+--echo # Bug#12346411 SQL/LOG.CC:6509: ASSERTION `PREPARED_XIDS > 0' FAILED
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2;
+--enable_warnings
+
+CREATE TABLE t1(a INT PRIMARY KEY) engine=innodb;
+CREATE TABLE t2(a INT) engine=myisam;
+
+INSERT INTO t1 VALUES (1);
+START TRANSACTION;
+INSERT INTO t2 VALUES (1);
+INSERT IGNORE INTO t1 VALUES (1);
+COMMIT;
+
+INSERT INTO t1 VALUES (2);
+START TRANSACTION;
+INSERT INTO t2 VALUES (2);
+UPDATE IGNORE t1 SET a=1 WHERE a=2;
+COMMIT;
+
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/binlog/t/binlog_max_extension.test b/mysql-test/suite/binlog/t/binlog_max_extension.test
index 9f52d195e21..e5274d87b85 100644
--- a/mysql-test/suite/binlog/t/binlog_max_extension.test
+++ b/mysql-test/suite/binlog/t/binlog_max_extension.test
@@ -38,9 +38,7 @@ RESET MASTER;
##########
# 1. Stop master server
--- write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-wait
-EOF
+-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-- shutdown_server 10
-- source include/wait_until_disconnected.inc
@@ -52,9 +50,7 @@ master-bin.2147483646
EOF
# 3. Restart the server
--- append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-restart
-EOF
+-- exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-- enable_reconnect
-- source include/wait_until_connected_again.inc
@@ -62,7 +58,8 @@ EOF
# Assertion
###########
-# assertion: should throw warning
+# assertion: should raise error
+-- error ER_NO_UNIQUE_LOGFILE
FLUSH LOGS;
##############
@@ -70,9 +67,7 @@ FLUSH LOGS;
##############
# 1. Stop the server
--- write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-wait
-EOF
+-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-- shutdown_server 10
-- source include/wait_until_disconnected.inc
@@ -85,8 +80,6 @@ EOF
-- remove_file $MYSQLD_DATADIR/master-bin.2147483647
# 3. Restart the server
--- append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-restart
-EOF
+-- exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-- enable_reconnect
-- source include/wait_until_connected_again.inc
diff --git a/mysql-test/suite/binlog/t/binlog_mix_innodb_stat.test b/mysql-test/suite/binlog/t/binlog_mixed_cache_stat.test
index 0be097c78ed..3e63fb3bc9c 100644
--- a/mysql-test/suite/binlog/t/binlog_mix_innodb_stat.test
+++ b/mysql-test/suite/binlog/t/binlog_mixed_cache_stat.test
@@ -2,4 +2,4 @@
# For both statement and row based bin logs 9/19/2005 [jbm]
-- source include/have_binlog_format_mixed.inc
--- source extra/binlog_tests/innodb_stat.test
+-- source extra/binlog_tests/binlog_cache_stat.test
diff --git a/mysql-test/suite/binlog/t/binlog_old_versions.test b/mysql-test/suite/binlog/t/binlog_old_versions.test
index 0ccea406a82..b294adbc69d 100644
--- a/mysql-test/suite/binlog/t/binlog_old_versions.test
+++ b/mysql-test/suite/binlog/t/binlog_old_versions.test
@@ -24,9 +24,6 @@
source include/not_embedded.inc;
---disable_warnings
-DROP TABLE IF EXISTS t1, t2, t3;
-
--echo ==== Read modern binlog (version 5.1.23) ====
@@ -161,3 +158,4 @@ DROP TABLE t1, t2, t3;
#SELECT * FROM t1 ORDER BY a;
#SELECT * FROM t2 ORDER BY a;
#SELECT COUNT(*) FROM t3;
+#--source include/rpl_end.inc
diff --git a/mysql-test/suite/binlog/t/binlog_query_filter_rules-master.opt b/mysql-test/suite/binlog/t/binlog_query_filter_rules-master.opt
new file mode 100644
index 00000000000..33632bf98e8
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_query_filter_rules-master.opt
@@ -0,0 +1 @@
+--replicate-do-db='impossible_database'
diff --git a/mysql-test/suite/binlog/t/binlog_query_filter_rules.test b/mysql-test/suite/binlog/t/binlog_query_filter_rules.test
new file mode 100644
index 00000000000..d56a32ce2bd
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_query_filter_rules.test
@@ -0,0 +1,32 @@
+# regression test for
+# Bug#36099 replicate-do-db affects replaying RBR events with mysqlbinlog
+# The test verifies that the slave side filtering rule does not affect
+# applying of row-events on master via mysqlbinlog
+
+-- source include/have_log_bin.inc
+-- source include/not_embedded.inc
+-- source include/have_binlog_format_row.inc
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+reset master;
+
+create table t1 (a int);
+insert into t1 values (1);
+
+let $MYSQLD_DATADIR= `select @@datadir`;
+flush logs;
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/bug36099.sql
+
+drop table t1;
+--exec $MYSQL -e "source $MYSQLTEST_VARDIR/tmp/bug36099.sql"
+
+--echo *** must be 1 ***
+select * from t1;
+
+# cleanup
+
+drop table t1;
+remove_file $MYSQLTEST_VARDIR/tmp/bug36099.sql;
diff --git a/mysql-test/suite/binlog/t/binlog_reset_master.test b/mysql-test/suite/binlog/t/binlog_reset_master.test
new file mode 100644
index 00000000000..b7ad69da3ea
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_reset_master.test
@@ -0,0 +1,26 @@
+# ==== Purpose ====
+#
+# Test bugs in RESET MASTER.
+
+--source include/have_debug.inc
+--source include/have_log_bin.inc
+
+#######################################################################
+# BUG#12574820: binlog.binlog_tmp_table timing out in daily and weekly trunk run
+# Problem: MYSQL_BIN_LOG::reset_logs acquired LOCK_thread_count and
+# LOCK_log in the wrong order. This could cause a deadlock when
+# RESET MASTER was run concurrently with a disconnecting thread.
+#######################################################################
+
+# We use sleep, not debug_sync, because the sync point needs to be in
+# the thread shut down code after the debug sync facility has been
+# shut down.
+--let $write_var= SET DEBUG="+d,sleep_after_lock_thread_count_before_delete_thd"; CREATE TEMPORARY TABLE test.t1 (a INT);
+--let $write_to_file= GENERATE
+--disable_query_log
+--source include/write_var_to_file.inc
+--enable_query_log
+
+--exec $MYSQL < $write_to_file
+RESET MASTER;
+--remove_file $write_to_file
diff --git a/mysql-test/suite/binlog/t/binlog_row_innodb_stat.test b/mysql-test/suite/binlog/t/binlog_row_cache_stat.test
index e4e6762226b..03f9c53f0cc 100644
--- a/mysql-test/suite/binlog/t/binlog_row_innodb_stat.test
+++ b/mysql-test/suite/binlog/t/binlog_row_cache_stat.test
@@ -2,4 +2,4 @@
# For both statement and row based bin logs 9/19/2005 [jbm]
-- source include/have_binlog_format_row.inc
--- source extra/binlog_tests/innodb_stat.test
+-- source extra/binlog_tests/binlog_cache_stat.test
diff --git a/mysql-test/suite/binlog/t/binlog_row_mysqlbinlog_db_filter.test b/mysql-test/suite/binlog/t/binlog_row_mysqlbinlog_db_filter.test
index 6682d84d9c9..2e3e53b86f1 100644
--- a/mysql-test/suite/binlog/t/binlog_row_mysqlbinlog_db_filter.test
+++ b/mysql-test/suite/binlog/t/binlog_row_mysqlbinlog_db_filter.test
@@ -83,17 +83,17 @@ while($i)
-- let $flags=--database=b42941
# construct CLI for mysqlbinlog
- if(`SELECT $i=3`)
+ if($i==3)
{
-- let $flags= $flags --verbose --hexdump
}
- if(`SELECT $i=2`)
+ if($i==2)
{
-- let $flags= $flags --verbose
}
-# if(`SELECT $i=1`)
+# if($i==1)
# {
# do nothing $flags is already set as it should be
# }
diff --git a/mysql-test/suite/binlog/t/binlog_server_id.test b/mysql-test/suite/binlog/t/binlog_server_id.test
new file mode 100644
index 00000000000..6e98ec6ee6d
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_server_id.test
@@ -0,0 +1,29 @@
+# Test for BUG#28908 Replication: set global server_id is not setting the session server_id
+
+-- source include/have_log_bin.inc
+
+let $saved_server_id=`select @@server_id`;
+set global server_id=1;
+reset master;
+
+-- disable_warnings
+drop table if exists t1,t2,t3;
+-- enable_warnings
+
+create table t1 (a int);
+select @@server_id;
+source include/show_binlog_events2.inc;
+
+set global server_id=2;
+create table t2 (b int);
+select @@server_id;
+source include/show_binlog_events2.inc;
+
+set global server_id=3;
+create table t3 (c int);
+select @@server_id;
+source include/show_binlog_events2.inc;
+
+# cleanup
+eval set global server_id=$saved_server_id;
+drop table t1,t2,t3;
diff --git a/mysql-test/suite/binlog/t/binlog_sf.test b/mysql-test/suite/binlog/t/binlog_sf.test
new file mode 100644
index 00000000000..05b31afcb58
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_sf.test
@@ -0,0 +1,191 @@
+-- source include/have_log_bin.inc
+
+# We change binlog format inside the test, so no need to re-run with
+# more than one binlog_format.
+-- source include/have_binlog_format_statement.inc
+
+# Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
+# BUG#41166 stored function requires "deterministic" if binlog_format is "statement"
+
+# save status
+
+let $oblf=`select @@SESSION.BINLOG_FORMAT`;
+let $otfc=`select @@log_bin_trust_function_creators`;
+
+set global log_bin_trust_function_creators=0;
+
+
+
+# fail *on definition*
+
+set binlog_format=STATEMENT;
+
+delimiter |;
+--error ER_BINLOG_UNSAFE_ROUTINE
+create function fn16456()
+ returns int
+begin
+ return unix_timestamp();
+end|
+delimiter ;|
+
+
+
+# force in definition, so we can see whether we fail on call
+
+set global log_bin_trust_function_creators=1;
+
+delimiter |;
+create function fn16456()
+ returns int
+begin
+ return unix_timestamp();
+end|
+delimiter ;|
+
+set global log_bin_trust_function_creators=0;
+
+
+
+# allow funcall in RBR
+
+set binlog_format=ROW;
+
+--replace_column 1 timestamp
+select fn16456();
+
+
+
+# fail funcall in SBR
+
+set binlog_format=STATEMENT;
+
+--error ER_BINLOG_UNSAFE_ROUTINE
+select fn16456();
+
+
+
+# clean
+
+drop function fn16456;
+
+
+
+# success in definition with deterministic
+
+set global log_bin_trust_function_creators=0;
+
+delimiter |;
+create function fn16456()
+ returns int deterministic
+begin
+ return unix_timestamp();
+end|
+delimiter ;|
+
+
+
+# allow funcall in RBR
+
+set binlog_format=ROW;
+
+--replace_column 1 timestamp
+select fn16456();
+
+
+
+# allow funcall in SBR
+
+set binlog_format=STATEMENT;
+
+--replace_column 1 timestamp
+select fn16456();
+
+
+
+# clean
+
+drop function fn16456;
+
+
+# success in definition with NO SQL
+
+set global log_bin_trust_function_creators=0;
+
+delimiter |;
+create function fn16456()
+ returns int no sql
+begin
+ return unix_timestamp();
+end|
+delimiter ;|
+
+
+
+# allow funcall in RBR
+
+set binlog_format=ROW;
+
+--replace_column 1 timestamp
+select fn16456();
+
+
+
+# allow funcall in SBR
+
+set binlog_format=STATEMENT;
+
+--replace_column 1 timestamp
+select fn16456();
+
+
+# clean
+
+drop function fn16456;
+
+
+
+# success in definition with reads sql data
+
+set global log_bin_trust_function_creators=0;
+
+delimiter |;
+create function fn16456()
+ returns int reads sql data
+begin
+ return unix_timestamp();
+end|
+delimiter ;|
+
+
+
+# allow funcall in RBR
+
+set binlog_format=ROW;
+
+--replace_column 1 timestamp
+select fn16456();
+
+
+
+# allow funcall in SBR
+
+set binlog_format=STATEMENT;
+
+--replace_column 1 timestamp
+select fn16456();
+
+
+
+# clean
+
+drop function fn16456;
+
+
+
+# restore status
+
+--disable_query_log
+eval set binlog_format=$oblf;
+eval set global log_bin_trust_function_creators=$otfc;
+--enable_query_log
diff --git a/mysql-test/suite/binlog/t/binlog_sql_mode.test b/mysql-test/suite/binlog/t/binlog_sql_mode.test
index 1777f8cb561..ab4f6450543 100644
--- a/mysql-test/suite/binlog/t/binlog_sql_mode.test
+++ b/mysql-test/suite/binlog/t/binlog_sql_mode.test
@@ -8,7 +8,6 @@
# Scan binlog file to check if the sql_mode is still set to 0 before generating binlog event
#
--- source include/master-slave.inc
-- source include/have_log_bin.inc
# BUG#39526 sql_mode not retained in binary log for CREATE PROCEDURE
@@ -50,10 +49,10 @@ CREATE EVENT testEvent ON SCHEDULE
END;|
DELIMITER ;|
---echo Chceck Result
+--echo Check Result
let $MYSQLD_DATADIR= `select @@datadir`;
---exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug39526.binlog
+--exec $MYSQL_BINLOG --force-if-open $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug39526.binlog
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval select
(@a:=load_file("$MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug39526.binlog"))
diff --git a/mysql-test/suite/binlog/t/binlog_stm_binlog-master.opt b/mysql-test/suite/binlog/t/binlog_stm_binlog-master.opt
index 099f07e5d4e..62409b9f6be 100644
--- a/mysql-test/suite/binlog/t/binlog_stm_binlog-master.opt
+++ b/mysql-test/suite/binlog/t/binlog_stm_binlog-master.opt
@@ -1 +1,2 @@
--max_binlog_size=4096 --default-storage-engine=MyISAM
+--force-restart
diff --git a/mysql-test/suite/binlog/t/binlog_stm_innodb_stat.test b/mysql-test/suite/binlog/t/binlog_stm_cache_stat.test
index c6017246e6d..0f5aa9f6013 100644
--- a/mysql-test/suite/binlog/t/binlog_stm_innodb_stat.test
+++ b/mysql-test/suite/binlog/t/binlog_stm_cache_stat.test
@@ -2,4 +2,4 @@
# For both statement and row based bin logs 9/19/2005 [jbm]
-- source include/have_binlog_format_statement.inc
--- source extra/binlog_tests/innodb_stat.test
+-- source extra/binlog_tests/binlog_cache_stat.test
diff --git a/mysql-test/suite/binlog/t/binlog_stm_do_db-master.opt b/mysql-test/suite/binlog/t/binlog_stm_do_db-master.opt
index e2cfcb299cf..2a1187d3fe4 100644
--- a/mysql-test/suite/binlog/t/binlog_stm_do_db-master.opt
+++ b/mysql-test/suite/binlog/t/binlog_stm_do_db-master.opt
@@ -1 +1,2 @@
--binlog-do-db=b42829
+--force-restart
diff --git a/mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test b/mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test
index 35e4dd57877..022341ae833 100644
--- a/mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test
+++ b/mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test
@@ -116,7 +116,7 @@ DROP TABLE t1;
SET GLOBAL log_warnings = @old_log_warnings;
let $log_error_= `SELECT @@GLOBAL.log_error`;
-if(!`select LENGTH('$log_error_')`)
+if(!$log_error_)
{
# MySQL Server on windows is started with --console and thus
# does not know the location of its .err log, use default location
diff --git a/mysql-test/suite/binlog/t/binlog_unsafe.test b/mysql-test/suite/binlog/t/binlog_unsafe.test
index 740649f0053..9fbdc9fc2c8 100644
--- a/mysql-test/suite/binlog/t/binlog_unsafe.test
+++ b/mysql-test/suite/binlog/t/binlog_unsafe.test
@@ -141,11 +141,11 @@ END|
# In each iteration of this loop, we select one method to make the
# statement unsafe.
--let $unsafe_type= 0
-while (`SELECT $unsafe_type < 9`) {
+while ($unsafe_type < 9) {
--echo
- if (`SELECT $unsafe_type = 0`) {
+ if ($unsafe_type == 0) {
--echo ==== Testing UUID() unsafeness ====
--let $desc_0= unsafe UUID() function
--let $stmt_sidef_0= INSERT INTO t0 VALUES (UUID())
@@ -155,7 +155,7 @@ while (`SELECT $unsafe_type < 9`) {
--let $CRC_ARG_expected_number_of_warnings= 1
}
- if (`SELECT $unsafe_type = 1`) {
+ if ($unsafe_type == 1) {
--echo ==== Testing @@hostname unsafeness ====
--let $desc_0= unsafe @@hostname variable
--let $stmt_sidef_0= INSERT INTO t0 VALUES (@@hostname)
@@ -168,7 +168,7 @@ while (`SELECT $unsafe_type < 9`) {
--let $CRC_ARG_expected_number_of_warnings= 1
}
- if (`SELECT $unsafe_type = 2`) {
+ if ($unsafe_type == 2) {
--echo ==== Testing SELECT...LIMIT unsafeness ====
--let $desc_0= unsafe SELECT...LIMIT statement
--let $stmt_sidef_0= INSERT INTO t0 SELECT * FROM data_table LIMIT 1
@@ -178,7 +178,7 @@ while (`SELECT $unsafe_type < 9`) {
--let $CRC_ARG_expected_number_of_warnings= 1
}
- if (`SELECT $unsafe_type = 3`) {
+ if ($unsafe_type == 3) {
--echo ==== Testing INSERT DELAYED safeness after BUG#54579 is fixed ====
--let $desc_0= unsafe INSERT DELAYED statement
--let $stmt_sidef_0= INSERT DELAYED INTO t0 VALUES (1), (2)
@@ -188,7 +188,7 @@ while (`SELECT $unsafe_type < 9`) {
--let $CRC_ARG_expected_number_of_warnings= 0
}
- if (`SELECT $unsafe_type = 4`) {
+ if ($unsafe_type == 4) {
--echo ==== Testing unsafeness of insert of two autoinc values ====
--let $desc_0= unsafe update of two autoinc columns
--let $stmt_sidef_0= INSERT INTO double_autoinc_table VALUES (NULL)
@@ -198,7 +198,7 @@ while (`SELECT $unsafe_type < 9`) {
--let $CRC_ARG_expected_number_of_warnings= 1
}
- if (`SELECT $unsafe_type = 5`) {
+ if ($unsafe_type == 5) {
--echo ==== Testing unsafeness of UDF's ====
--let $desc_0= unsafe UDF
--let $stmt_sidef_0= INSERT INTO t0 VALUES (myfunc_int(10))
@@ -208,7 +208,7 @@ while (`SELECT $unsafe_type < 9`) {
--let $CRC_ARG_expected_number_of_warnings= 1
}
- if (`SELECT $unsafe_type = 6`) {
+ if ($unsafe_type == 6) {
--echo ==== Testing unsafeness of access to mysql.general_log ====
--let $desc_0= unsafe use of mysql.general_log
--let $stmt_sidef_0= INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log
@@ -218,7 +218,7 @@ while (`SELECT $unsafe_type < 9`) {
--let $CRC_ARG_expected_number_of_warnings= 1
}
- if (`SELECT $unsafe_type = 7`) {
+ if ($unsafe_type == 7) {
--echo ==== Testing a statement that is unsafe in many ways ====
--let $desc_0= statement that is unsafe in many ways
# Concatenate three unsafe values, and then concatenate NULL to
@@ -230,7 +230,7 @@ while (`SELECT $unsafe_type < 9`) {
--let $CRC_ARG_expected_number_of_warnings= 6
}
- if (`SELECT $unsafe_type = 8`) {
+ if ($unsafe_type == 8) {
--echo ==== Testing a statement that is unsafe several times ====
--let $desc_0= statement that is unsafe several times
--let $stmt_sidef_0= INSERT INTO ta0 VALUES (multi_unsafe_func())
@@ -249,7 +249,7 @@ while (`SELECT $unsafe_type < 9`) {
# construct. Instead, we just invoke the unsafe statement directly.
--let $call_type_1= 0
- while (`SELECT $call_type_1 < 8`) {
+ while ($call_type_1 < 8) {
#--echo debug: level 1, types $call_type_1 -> $unsafe_type
--let $CRC_ARG_level= 1
--let $CRC_ARG_type= $call_type_1
@@ -280,7 +280,7 @@ while (`SELECT $unsafe_type < 9`) {
# construct.
--let $call_type_2= 0
- while (`SELECT $call_type_2 < 7`) {
+ while ($call_type_2 < 7) {
#--echo debug: level 2, types $call_type_2 -> $call_type_1 -> $unsafe_type
--let $CRC_ARG_level= 2
--let $CRC_ARG_type= $call_type_2
@@ -309,7 +309,7 @@ while (`SELECT $unsafe_type < 9`) {
# construct.
--let $call_type_3= 0
- while (`SELECT $call_type_3 < 7`) {
+ while ($call_type_3 < 7) {
#--echo debug: level 3, types $call_type_2 -> $call_type_2 -> $call_type_1 -> $unsafe_type
--let $CRC_ARG_level= 3
--let $CRC_ARG_type= $call_type_3
@@ -321,7 +321,7 @@ while (`SELECT $unsafe_type < 9`) {
--source extra/rpl_tests/create_recursive_construct.inc
# Drop created object.
- if (`SELECT '$drop_3' != ''`) {
+ if ($drop_3) {
--eval $drop_3
}
--inc $call_type_3
@@ -330,7 +330,7 @@ while (`SELECT $unsafe_type < 9`) {
} # if (!is_toplevel_2)
# Drop created object.
- if (`SELECT '$drop_2' != ''`) {
+ if ($drop_2) {
--eval $drop_2
}
--inc $call_type_2
@@ -338,7 +338,7 @@ while (`SELECT $unsafe_type < 9`) {
} # if (!is_toplevel_1)
# Drop created object.
- if (`SELECT '$drop_1' != ''`) {
+ if ($drop_1) {
--eval $drop_1
}
--inc $call_type_1
@@ -481,7 +481,7 @@ DROP TABLE t1,t2;
--echo "Should NOT have any warning message issued in the following func7() and trig"
CREATE TABLE t1 (a INT);
-CREATE TABLE t2 (a CHAR(40));
+CREATE TABLE t2 (a TEXT);
CREATE TABLE trigger_table (a CHAR(7));
DELIMITER |;
CREATE FUNCTION func7()
diff --git a/mysql-test/suite/binlog/t/disabled.def b/mysql-test/suite/binlog/t/disabled.def
index a9841f592f8..1abc9951322 100644
--- a/mysql-test/suite/binlog/t/disabled.def
+++ b/mysql-test/suite/binlog/t/disabled.def
@@ -9,6 +9,5 @@
# Do not use any TAB characters for whitespace.
#
##############################################################################
-
-binlog_truncate_innodb : BUG#42643 2009-02-06 mats Changes to InnoDB requires to complete fix for BUG#36763
-binlog_spurious_ddl_errors : BUG#54195 2010-06-03 alik binlog_spurious_ddl_errors.test fails, thus disabled
+binlog_truncate_innodb : BUG#11764459 2010-10-20 anitha Originally disabled due to BUG#42643. Product bug fixed, but test changes needed
+binlog_spurious_ddl_errors : BUG#11761680 2010-06-03 alik binlog_spurious_ddl_errors.test fails, thus disabled