summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <skozlov/ksm@mysql.com/virtop.(none)>2008-01-31 16:23:27 +0300
committerunknown <skozlov/ksm@mysql.com/virtop.(none)>2008-01-31 16:23:27 +0300
commit6a873248d1d226b7610d2f3f0fa3c8d7e023ab87 (patch)
tree6bdf64c2ab6c59246e18988afc9a03decc11152d /mysql-test
parent360bd3653b13f400381c1e15c21d045c7d9d64ab (diff)
downloadmariadb-git-6a873248d1d226b7610d2f3f0fa3c8d7e023ab87.tar.gz
Test case for bug#12691
mysql-test/suite/bugs/data/rpl_bug12691.dat: Data file for test case mysql-test/suite/bugs/r/rpl_bug12691.result: Result file
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/suite/bugs/data/rpl_bug12691.dat3
-rw-r--r--mysql-test/suite/bugs/r/rpl_bug12691.result34
-rw-r--r--mysql-test/suite/bugs/t/rpl_bug12691.test53
3 files changed, 90 insertions, 0 deletions
diff --git a/mysql-test/suite/bugs/data/rpl_bug12691.dat b/mysql-test/suite/bugs/data/rpl_bug12691.dat
new file mode 100644
index 00000000000..de980441c3a
--- /dev/null
+++ b/mysql-test/suite/bugs/data/rpl_bug12691.dat
@@ -0,0 +1,3 @@
+a
+b
+c
diff --git a/mysql-test/suite/bugs/r/rpl_bug12691.result b/mysql-test/suite/bugs/r/rpl_bug12691.result
new file mode 100644
index 00000000000..69d5e8009b0
--- /dev/null
+++ b/mysql-test/suite/bugs/r/rpl_bug12691.result
@@ -0,0 +1,34 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+
+**** On Master ****
+CREATE TABLE t1 (b CHAR(10));
+
+**** On Slave ****
+STOP SLAVE;
+
+**** On Master ****
+LOAD DATA INFILE FILENAME
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+3
+SHOW BINLOG EVENTS;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Format_desc 1 # Server ver: #
+master-bin.000001 # Query 1 # use `test`; CREATE TABLE t1 (b CHAR(10))
+master-bin.000001 # Begin_load_query 1 # ;file_id=#;block_len=#
+master-bin.000001 # Execute_load_query 1 # use `test`; LOAD DATA INFILE FILENAME ;file_id=#
+
+**** On Slave ****
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
+START SLAVE;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+0
+
+**** On Master ****
+DROP TABLE t1;
diff --git a/mysql-test/suite/bugs/t/rpl_bug12691.test b/mysql-test/suite/bugs/t/rpl_bug12691.test
new file mode 100644
index 00000000000..b29c85584a5
--- /dev/null
+++ b/mysql-test/suite/bugs/t/rpl_bug12691.test
@@ -0,0 +1,53 @@
+# Bug#12691: Exec_master_log_pos corrupted with SQL_SLAVE_SKIP_COUNTER
+# Date: 01/31/2008
+# Added: Serge Kozlov <skozlov@mysql.com>
+
+--source include/master-slave.inc
+--connection master
+--source include/have_binlog_format_mixed_or_statement.inc
+
+--echo
+--echo **** On Master ****
+CREATE TABLE t1 (b CHAR(10));
+--echo
+--echo **** On Slave ****
+--sync_slave_with_master
+STOP SLAVE;
+--source include/wait_for_slave_to_stop.inc
+
+--connection master
+
+--echo
+--echo **** On Master ****
+--exec cp $MYSQL_TEST_DIR/suite/bugs/data/rpl_bug12691.dat $MYSQLTEST_VARDIR/tmp/
+--echo LOAD DATA INFILE FILENAME
+--disable_query_log
+--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/rpl_bug12691.dat' INTO TABLE t1 FIELDS TERMINATED BY '|'
+--enable_query_log
+--remove_file $MYSQLTEST_VARDIR/tmp/rpl_bug12691.dat
+
+SELECT COUNT(*) FROM t1;
+
+--replace_column 2 # 5 #
+--replace_regex /Server ver: .+/Server ver: #/ /table_id: [0-9]+/table_id: #/ /COMMIT.+xid=[0-9]+.+/#/ /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/ /'.+'/FILENAME/
+SHOW BINLOG EVENTS;
+
+--save_master_pos
+
+--connection slave
+--echo
+--echo **** On Slave ****
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
+START SLAVE;
+--source include/wait_for_slave_to_start.inc
+--sync_with_master
+
+SELECT COUNT(*) FROM t1;
+
+# Clean up
+--connection master
+--echo
+--echo **** On Master ****
+DROP TABLE t1;
+--sync_slave_with_master
+