summaryrefslogtreecommitdiff
path: root/mysql-test/t/mysqlbinlog.test
diff options
context:
space:
mode:
authorTatiana A. Nurnberg <azundris@mysql.com>2009-02-23 13:14:17 +0100
committerTatiana A. Nurnberg <azundris@mysql.com>2009-02-23 13:14:17 +0100
commitec3decf6108a72e2d198882bf9ece2555229ea9c (patch)
tree7b5c08e7a4dd6e1f5eb424f1feff3dd237b55020 /mysql-test/t/mysqlbinlog.test
parentc1d73f3350e7a9e4cfeb953f0d3c368ebe805979 (diff)
parentfb20a7d6d0b21d69ff0941f3c0c57c1ae24fbbef (diff)
downloadmariadb-git-ec3decf6108a72e2d198882bf9ece2555229ea9c.tar.gz
auto-merge
Diffstat (limited to 'mysql-test/t/mysqlbinlog.test')
-rw-r--r--mysql-test/t/mysqlbinlog.test45
1 files changed, 42 insertions, 3 deletions
diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test
index 5b4a43c8fe8..5904115d023 100644
--- a/mysql-test/t/mysqlbinlog.test
+++ b/mysql-test/t/mysqlbinlog.test
@@ -1,5 +1,4 @@
# We are using .opt file since we need small binlog size
-
-- source include/have_log_bin.inc
# we need this for getting fixed timestamps inside of this test
@@ -174,7 +173,8 @@ delimiter ;//
flush logs;
call p1();
drop procedure p1;
---error 1305
+--error ER_SP_DOES_NOT_EXIST
+
call p1();
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/
--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000007
@@ -226,7 +226,26 @@ flush logs;
INSERT INTO t1 VALUES ('0123456789');
flush logs;
DROP TABLE t1;
---exec $MYSQL_BINLOG --hexdump --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLTEST_VARDIR/log/master-bin.000011 | grep 'Query' | sed 's/[0-9]\{1,\}/REMOVED/g'
+
+# We create a table, patch, and load the output into it
+# By using LINES STARTING BY '#' + SELECT WHERE a LIKE 'Query'
+# We can easily see if a 'Query' line is missing the '#' character
+# as described in the original bug
+
+--disable_query_log
+CREATE TABLE patch (a blob);
+--exec $MYSQL_BINLOG --hexdump --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLTEST_VARDIR/log/master-bin.000011 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_tmp.dat
+eval LOAD DATA LOCAL INFILE '$MYSQLTEST_VARDIR/tmp/mysqlbinlog_tmp.dat'
+ INTO TABLE patch FIELDS TERMINATED by '' LINES STARTING BY '#';
+--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_tmp.dat
+--enable_query_log
+
+--echo We expect this value to be 1
+--echo The bug being tested was that 'Query' lines were not preceded by '#'
+--echo If the line is in the table, it had to have been preceded by a '#'
+--echo
+SELECT COUNT(*) AS `BUG#28293_expect_1` FROM patch WHERE a LIKE '%Query%';
+DROP TABLE patch;
#
# Bug #29928: incorrect connection_id() restoring from mysqlbinlog out
@@ -253,4 +272,24 @@ echo shell> mysqlbinlog std_data/corrupt-relay-bin.000624 > var/tmp/bug31793.sql
error 1;
exec $MYSQL_BINLOG $MYSQL_TEST_DIR/std_data/corrupt-relay-bin.000624 > $MYSQLTEST_VARDIR/tmp/bug31793.sql;
+#
+# Bug #37313 BINLOG Contains Incorrect server id
+#
+
+let $save_server_id= `select @@global.server_id`;
+let $s_id_max=`select (1 << 32) - 1`;
+eval set @@global.server_id= $s_id_max;
+
+reset master;
+--exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug37313.binlog
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval select
+(@a:=load_file("$MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug37313.binlog"))
+is not null;
+let $s_id_unsigned= `select @a like "%server id $s_id_max%" /* must return 1 */`;
+echo *** Unsigned server_id $s_id_max is found: $s_id_unsigned ***;
+
+eval set @@global.server_id= $save_server_id;
+--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug37313.binlog
+
--echo End of 5.0 tests