summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <hezx@mail.hezx.com>2008-02-01 10:27:03 +0800
committerunknown <hezx@mail.hezx.com>2008-02-01 10:27:03 +0800
commitc89590f15743c6a0fc9362cc031d2baf4373f5b3 (patch)
treefa7fc6e5737e6a16eca2fca6ed2cf4314e850484 /mysql-test
parentc8839950911c7b455a6053b268374475a177d568 (diff)
parent14de473881fa34ad357a58f41afe3cad953d87e2 (diff)
downloadmariadb-git-c89590f15743c6a0fc9362cc031d2baf4373f5b3.tar.gz
Merge zhe@bk-internal.mysql.com:/home/bk/mysql-5.1-new-rpl
into mail.hezx.com:/media/sda3/work/mysql/bkwork/bug33862_failed_drop_user/5.1 mysql-test/include/show_binlog_events2.inc: Auto merged
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_tabledefs.test6
-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
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result16
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result16
6 files changed, 109 insertions, 19 deletions
diff --git a/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test b/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test
index b5795cf525d..0e391cb0f37 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test
@@ -46,7 +46,7 @@ ALTER TABLE t1_bit
ALTER TABLE t1_char ADD x CHAR(20) DEFAULT 'Just a test';
# ... and add one non-nullable INT column last in table 't1_text'
# with no default,
-ALTER TABLE t1_nodef ADD x INT NOT NULL;
+ALTER TABLE t1_nodef ADD x INT NOT NULL, ADD y INT NOT NULL, ADD z INT NOT NULL;
# ... and remove the last column in t2
ALTER TABLE t2 DROP b;
# ... change the type of the single column in table 't4'
@@ -222,8 +222,8 @@ sync_slave_with_master;
--echo **** On Slave ****
connection slave;
-INSERT INTO t1_nodef VALUES (1,2,3);
-INSERT INTO t1_nodef VALUES (2,4,6);
+INSERT INTO t1_nodef VALUES (1,2,3,4,5);
+INSERT INTO t1_nodef VALUES (2,4,6,8,10);
--echo **** On Master ****
connection master;
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
+
diff --git a/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
index 6859a406b16..e81d4f7454e 100644
--- a/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
@@ -26,7 +26,7 @@ ADD x BIT(3) DEFAULT b'011',
ADD y BIT(5) DEFAULT b'10101',
ADD z BIT(2) DEFAULT b'10';
ALTER TABLE t1_char ADD x CHAR(20) DEFAULT 'Just a test';
-ALTER TABLE t1_nodef ADD x INT NOT NULL;
+ALTER TABLE t1_nodef ADD x INT NOT NULL, ADD y INT NOT NULL, ADD z INT NOT NULL;
ALTER TABLE t2 DROP b;
ALTER TABLE t4 MODIFY a FLOAT;
ALTER TABLE t5 MODIFY b FLOAT;
@@ -393,8 +393,8 @@ INSERT INTO t1_nodef VALUES (1,2);
INSERT INTO t1_nodef VALUES (2,4);
SET SQL_LOG_BIN=1;
**** On Slave ****
-INSERT INTO t1_nodef VALUES (1,2,3);
-INSERT INTO t1_nodef VALUES (2,4,6);
+INSERT INTO t1_nodef VALUES (1,2,3,4,5);
+INSERT INTO t1_nodef VALUES (2,4,6,8,10);
**** On Master ****
UPDATE t1_nodef SET b=2*b WHERE a=1;
SELECT * FROM t1_nodef ORDER BY a;
@@ -403,9 +403,9 @@ a b
2 4
**** On Slave ****
SELECT * FROM t1_nodef ORDER BY a;
-a b x
-1 4 3
-2 4 6
+a b x y z
+1 4 3 4 5
+2 4 6 8 10
**** On Master ****
DELETE FROM t1_nodef WHERE a=2;
SELECT * FROM t1_nodef ORDER BY a;
@@ -413,8 +413,8 @@ a b
1 4
**** On Slave ****
SELECT * FROM t1_nodef ORDER BY a;
-a b x
-1 4 3
+a b x y z
+1 4 3 4 5
**** Cleanup ****
DROP TABLE IF EXISTS t1_int,t1_bit,t1_char,t1_nodef;
DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t7,t8,t9;
diff --git a/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
index 17b2a2f7b52..a6834be5a86 100644
--- a/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
@@ -26,7 +26,7 @@ ADD x BIT(3) DEFAULT b'011',
ADD y BIT(5) DEFAULT b'10101',
ADD z BIT(2) DEFAULT b'10';
ALTER TABLE t1_char ADD x CHAR(20) DEFAULT 'Just a test';
-ALTER TABLE t1_nodef ADD x INT NOT NULL;
+ALTER TABLE t1_nodef ADD x INT NOT NULL, ADD y INT NOT NULL, ADD z INT NOT NULL;
ALTER TABLE t2 DROP b;
ALTER TABLE t4 MODIFY a FLOAT;
ALTER TABLE t5 MODIFY b FLOAT;
@@ -393,8 +393,8 @@ INSERT INTO t1_nodef VALUES (1,2);
INSERT INTO t1_nodef VALUES (2,4);
SET SQL_LOG_BIN=1;
**** On Slave ****
-INSERT INTO t1_nodef VALUES (1,2,3);
-INSERT INTO t1_nodef VALUES (2,4,6);
+INSERT INTO t1_nodef VALUES (1,2,3,4,5);
+INSERT INTO t1_nodef VALUES (2,4,6,8,10);
**** On Master ****
UPDATE t1_nodef SET b=2*b WHERE a=1;
SELECT * FROM t1_nodef ORDER BY a;
@@ -403,9 +403,9 @@ a b
2 4
**** On Slave ****
SELECT * FROM t1_nodef ORDER BY a;
-a b x
-1 4 3
-2 4 6
+a b x y z
+1 4 3 4 5
+2 4 6 8 10
**** On Master ****
DELETE FROM t1_nodef WHERE a=2;
SELECT * FROM t1_nodef ORDER BY a;
@@ -413,8 +413,8 @@ a b
1 4
**** On Slave ****
SELECT * FROM t1_nodef ORDER BY a;
-a b x
-1 4 3
+a b x y z
+1 4 3 4 5
**** Cleanup ****
DROP TABLE IF EXISTS t1_int,t1_bit,t1_char,t1_nodef;
DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t7,t8,t9;