summaryrefslogtreecommitdiff
path: root/mysql-test/t/mysqlbinlog.test
diff options
context:
space:
mode:
authorMatthias Leich <Matthias.Leich@sun.com>2009-03-06 15:56:17 +0100
committerMatthias Leich <Matthias.Leich@sun.com>2009-03-06 15:56:17 +0100
commit2417d31045cde81881a9dd7991263210687d5fc8 (patch)
tree88da5851e80389eb99993e7f017a4a90b48f7a00 /mysql-test/t/mysqlbinlog.test
parent16c0631f0b785e82aef63429b5a4e7179b8aa52e (diff)
parent0183d4d8422ba29a632eebb1e856391f2b9a289f (diff)
downloadmariadb-git-2417d31045cde81881a9dd7991263210687d5fc8.tar.gz
Merge 5.0 -> 5.1 of fix for Bug#42003 and Bug#43114
Diffstat (limited to 'mysql-test/t/mysqlbinlog.test')
-rw-r--r--mysql-test/t/mysqlbinlog.test90
1 files changed, 47 insertions, 43 deletions
diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test
index d73f4356877..46060649784 100644
--- a/mysql-test/t/mysqlbinlog.test
+++ b/mysql-test/t/mysqlbinlog.test
@@ -24,7 +24,7 @@ insert into t2 values ();
# set @a:=1
# insert into t2 values (@a);
-# test for load data and load data distributed among the several
+# test for load data and load data distributed among the several
# files (we need to fill up first binlog)
load data infile '../../std_data/words.dat' into table t1;
load data infile '../../std_data/words.dat' into table t1;
@@ -109,7 +109,7 @@ select "--- --position --" as "";
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --position=239 --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002
-# Bug#7853 (mysqlbinlog does not accept input from stdin)
+# Bug#7853 mysqlbinlog does not accept input from stdin
--disable_query_log
select "--- reading stdin --" as "";
--enable_query_log
@@ -123,7 +123,7 @@ select "--- reading stdin --" as "";
drop table t1,t2;
#
-#BUG#14157: utf8 encoding in binlog without set character_set_client
+# Bug#14157 utf8 encoding in binlog without set character_set_client
#
flush logs;
--write_file $MYSQLTEST_VARDIR/tmp/bug14157.sql
@@ -136,8 +136,8 @@ EOF
--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/bug14157.sql
--remove_file $MYSQLTEST_VARDIR/tmp/bug14157.sql
-# resulted binlog, parly consisting of multi-byte utf8 chars,
-# must be digestable for both client and server. In 4.1 the client
+# resulted binlog, parly consisting of multi-byte utf8 chars,
+# 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
@@ -164,7 +164,7 @@ select * from t5 order by c1;
drop table t5;
#
-# Bug#20396 Bin Log does not get DELIMETER cmd - Recover StoredProc fails
+# Bug#20396 Bin Log does not get DELIMETER cmd - Recover StoredProc fails
#
--disable_warnings
drop procedure if exists p1;
@@ -180,7 +180,7 @@ delimiter ;//
flush logs;
call p1();
drop procedure p1;
---error ER_SP_DOES_NOT_EXIST
+--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 $MYSQLD_DATADIR/master-bin.000008
@@ -223,14 +223,14 @@ flush logs;
#
# Bug#28293 missed '#' sign in the hex dump when the dump length
-# is divisible by 16.
+# is divisible by 16.
#
CREATE TABLE t1 (c1 CHAR(10));
# we need this for getting fixed timestamps inside of this test
-flush logs;
+FLUSH LOGS;
INSERT INTO t1 VALUES ('0123456789');
-flush logs;
+FLUSH LOGS;
DROP TABLE t1;
# We create a table, patch, and load the output into it
@@ -238,11 +238,11 @@ DROP TABLE t1;
# 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);
+--disable_query_log
+CREATE TABLE patch (a BLOB);
--exec $MYSQL_BINLOG --hexdump --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLD_DATADIR/master-bin.000012 > $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 '#';
+ INTO TABLE patch FIELDS TERMINATED BY '' LINES STARTING BY '#';
--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_tmp.dat
--enable_query_log
@@ -254,40 +254,42 @@ 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
+# Bug#29928 incorrect connection_id() restoring from mysqlbinlog out
#
-flush logs;
-create table t1(a int);
-insert into t1 values(connection_id());
-let $a= `select a from t1`;
-flush logs;
---exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000014 > $MYSQLTEST_VARDIR/tmp/bug29928.sql
-drop table t1;
-connect (con1, localhost, root, , test);
+FLUSH LOGS;
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES(connection_id());
+let $a= `SELECT a FROM t1`;
+FLUSH LOGS;
+let $outfile= $MYSQLTEST_VARDIR/tmp/bug29928.sql;
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000014 > $outfile
+DROP TABLE t1;
+connect (con1, localhost, root, , test);
connection con1;
---exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/bug29928.sql
---remove_file $MYSQLTEST_VARDIR/tmp/bug29928.sql
-let $b= `select a from t1`;
+--exec $MYSQL test < $outfile
+--remove_file $outfile
+let $b= `SELECT a FROM t1`;
disconnect con1;
connection default;
-let $c= `select $a=$b`;
+let $c= `SELECT $a=$b`;
--echo $c
-drop table t1;
+DROP TABLE t1;
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;
+--remove_file $MYSQLTEST_VARDIR/tmp/bug31793.sql
#
# Test --disable-force-if-open and --force-if-open
#
-flush logs;
+FLUSH LOGS;
--error 1
--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000016 >/dev/null 2>/dev/null
--exec $MYSQL_BINLOG --force-if-open $MYSQLD_DATADIR/master-bin.000016 >/dev/null 2>/dev/null
---echo BUG#31611: Security risk with BINLOG statement
+--echo Bug#31611 Security risk with BINLOG statement
SET BINLOG_FORMAT=ROW;
CREATE DATABASE mysqltest1;
@@ -306,6 +308,7 @@ connect (unsecure,localhost,untrusted,,mysqltest1);
echo mysql mysqltest1 -uuntrusted < var/tmp/bug31611.sql;
error 1;
exec $MYSQL mysqltest1 -uuntrusted < $MYSQLTEST_VARDIR/tmp/bug31611.sql;
+--remove_file $MYSQLTEST_VARDIR/tmp/bug31611.sql
connection unsecure;
error ER_TABLEACCESS_DENIED_ERROR;
INSERT INTO t1 VALUES (1,USER());
@@ -315,7 +318,7 @@ connection default;
DROP DATABASE mysqltest1;
DROP USER untrusted@localhost;
---echo BUG#32580: mysqlbinlog cannot read binlog event with user variables
+--echo Bug#32580 mysqlbinlog cannot read binlog event with user variables
# Testing that various kinds of events can be read and restored properly.
@@ -343,24 +346,25 @@ query_vertical SELECT * FROM t1;
DROP TABLE t1;
#
-# Bug #37313 BINLOG Contains Incorrect server id
+# 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;
+let $binlog_file= $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug37313.binlog;
+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;
-flush logs;
---exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug37313.binlog
+RESET MASTER;
+FLUSH LOGS;
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 > $binlog_file
--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 */`;
+eval SELECT
+(@a:=LOAD_FILE("$binlog_file"))
+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
+eval SET @@global.server_id= $save_server_id;
+--remove_file $binlog_file
--echo End of 5.1 tests