Commit 2e06d79f authored by Luis Soares's avatar Luis Soares

Fixes two remaining test failures:

  - mysqld--help-win
    Updated result so that it contains missing
    value for slave-type-conversions

  - rpl_idempotency
    This seems a bad merge. In BUG#39934, the contents of
    this file had been split into rpl_row_idempontency and
    rpl_idempotency. The patch was pushed to 5.1-rep+3 which
    was later merged in rep+2-delivery1 which in turn was
    merged in 5.1-rpl-merge. Now while merging next-mr in
    5.1-rpl-merge, the file got back it's old content (which
    is in rpl_row_idempotency now because of BUG#39934). This
    cset reverts the bad merge:

    bzr merge -r revid:dao-gang.qu@sun.com-20100112120709-ioxp11yl9bvquaqd..\
    before:revid:dao-gang.qu@sun.com-20100112120709-ioxp11yl9bvquaqd\
    suite/rpl/t/rpl_idempotency.test
parent 67713449
......@@ -912,6 +912,7 @@ slave-load-tmpdir MYSQLTEST_VARDIR/tmp/
slave-net-timeout 3600
slave-skip-errors (No default value)
slave-transaction-retries 10
slave-type-conversions
slow-launch-time 2
slow-query-log FALSE
socket MySQL
......
......@@ -74,155 +74,4 @@ a
Last_SQL_Error
0
DROP TABLE t1, t2;
select @@global.slave_exec_mode /* must be IDEMPOTENT */;
@@global.slave_exec_mode
IDEMPOTENT
create table ti1 (b int primary key) engine = innodb;
create table ti2 (a int primary key, b int, foreign key (b) references ti1(b))
engine = innodb;
set foreign_key_checks=1 /* ensure the check */;
insert into ti1 values (1),(2),(3);
insert into ti2 set a=2, b=2;
select * from ti1 order by b /* must be (1),(2),(3) */;
b
1
2
3
insert into ti2 set a=1, b=1;
select * from ti2 order by b /* must be (1,1) (2,2) */;
a b
1 1
2 2
set @save_binlog_format= @@session.binlog_format;
set @@session.binlog_format= row;
delete from ti1 where b=1;
select * from ti1 order by b /* must be (2),(3) */;
b
2
3
select * from ti1 order by b /* must stays as were on master (1),(2),(3) */;
b
1
2
3
delete from ti1 where b=3;
insert into ti2 set a=3, b=3;
select * from ti2 order by b /* must be (1,1),(2,2) - not inserted */;
a b
1 1
2 2
set global slave_exec_mode='IDEMPOTENT';
set global slave_exec_mode='STRICT';
set global slave_exec_mode='IDEMPOTENT,STRICT';
ERROR 42000: Variable 'slave_exec_mode' can't be set to the value of 'IDEMPOTENT,STRICT'
select @@global.slave_exec_mode /* must be STRICT */;
@@global.slave_exec_mode
STRICT
*** foreign keys errors as above now forces to stop
set foreign_key_checks=0;
drop table ti2, ti1;
create table ti1 (b int primary key) engine = innodb;
create table ti2 (a int primary key, b int, foreign key (b) references ti1(b))
engine = innodb;
set foreign_key_checks=1 /* ensure the check */;
insert into ti1 values (1),(2),(3);
insert into ti2 set a=2, b=2;
select * from ti1 order by b /* must be (1),(2),(3) */;
b
1
2
3
*** conspire future problem
insert into ti2 set a=1, b=1;
select * from ti2 order by b /* must be (1,1) (2,2) */;
a b
1 1
2 2
delete from ti1 where b=1 /* offending delete event */;
select * from ti1 order by b /* must be (2),(3) */;
b
2
3
*** slave must stop (Trying to delete a referenced foreing key)
Last_SQL_Error
1451
select * from ti1 order by b /* must be (1),(2),(3) - not deleted */;
b
1
2
3
set foreign_key_checks= 0;
delete from ti2 where b=1;
set foreign_key_checks= 1;
set global slave_exec_mode='IDEMPOTENT';
start slave sql_thread;
set global slave_exec_mode='STRICT';
*** conspire the following insert failure
*** conspire future problem
delete from ti1 where b=3;
insert into ti2 set a=3, b=3 /* offending write event */;
*** slave must stop (Trying to insert an invalid foreign key)
Last_SQL_Error
1452
select * from ti2 order by b /* must be (2,2) */;
a b
2 2
set foreign_key_checks= 0;
insert into ti1 set b=3;
set foreign_key_checks= 1;
set global slave_exec_mode='IDEMPOTENT';
start slave sql_thread;
set global slave_exec_mode='STRICT';
select * from ti2 order by b /* must be (2,2),(3,3) */;
a b
2 2
3 3
*** other errors
*** conspiring query
insert into ti1 set b=1;
insert into ti1 set b=1 /* offending write event */;
*** slave must stop (Trying to insert a dupliacte key)
Last_SQL_Error
1062
set foreign_key_checks= 0;
delete from ti1 where b=1;
set foreign_key_checks= 1;
set global slave_exec_mode='IDEMPOTENT';
start slave sql_thread;
set global slave_exec_mode='STRICT';
CREATE TABLE t1 (a INT PRIMARY KEY);
CREATE TABLE t2 (a INT);
INSERT INTO t1 VALUES (-1),(-2),(-3);
INSERT INTO t2 VALUES (-1),(-2),(-3);
DELETE FROM t1 WHERE a = -2;
DELETE FROM t2 WHERE a = -2;
DELETE FROM t1 WHERE a = -2;
*** slave must stop (Key was not found)
Last_SQL_Error
1032
set global slave_exec_mode='IDEMPOTENT';
start slave sql_thread;
set global slave_exec_mode='STRICT';
DELETE FROM t2 WHERE a = -2;
*** slave must stop (Key was not found)
Last_SQL_Error
1032
set global slave_exec_mode='IDEMPOTENT';
start slave sql_thread;
set global slave_exec_mode='STRICT';
UPDATE t1 SET a = 1 WHERE a = -1;
UPDATE t2 SET a = 1 WHERE a = -1;
UPDATE t1 SET a = 1 WHERE a = -1;
*** slave must stop (Key was not found)
Last_SQL_Error
1032
set global slave_exec_mode='IDEMPOTENT';
start slave sql_thread;
set global slave_exec_mode='STRICT';
UPDATE t2 SET a = 1 WHERE a = -1;
*** slave must stop (Key was not found)
Last_SQL_Error
1032
set global slave_exec_mode='IDEMPOTENT';
start slave sql_thread;
SET @@global.slave_exec_mode= @old_slave_exec_mode;
......@@ -2,7 +2,6 @@
# work the same way under statement based as under row based.
source include/master-slave.inc;
source include/have_innodb.inc;
# Add suppression for expected warning(s) in slaves error log
call mtr.add_suppression("Slave: Can't find record in 't.' Error_code: 1032");
......@@ -88,306 +87,4 @@ connection master;
DROP TABLE t1, t2;
sync_slave_with_master;
# bug#31609 Not all RBR slave errors reported as errors
# bug#31552 Replication breaks when deleting rows from out-of-sync table
# without PK
#
# Idempotent applying is not default any longer.
# The default for slave-exec-mode option and server
# variable slave_exec_mode is 'STRICT'.
# When 'STRICT' mode is set, the slave SQL thread will stop whenever
# the row to change is not found. In 'IDEMPOTENT' mode, the SQL thread
# will continue running and apply the row - replace if it's Write_rows event -
# or skip to the next event.
# the previous part of the tests was with IDEMPOTENT slave's mode.
#
# Other than above idempotent errors dealing with foreign keys constraint
#
select @@global.slave_exec_mode /* must be IDEMPOTENT */;
connection master;
create table ti1 (b int primary key) engine = innodb;
create table ti2 (a int primary key, b int, foreign key (b) references ti1(b))
engine = innodb;
set foreign_key_checks=1 /* ensure the check */;
insert into ti1 values (1),(2),(3);
insert into ti2 set a=2, b=2;
sync_slave_with_master;
#connection slave;
select * from ti1 order by b /* must be (1),(2),(3) */;
insert into ti2 set a=1, b=1;
select * from ti2 order by b /* must be (1,1) (2,2) */;
connection master;
# from now on checking rbr specific idempotent errors
set @save_binlog_format= @@session.binlog_format;
set @@session.binlog_format= row;
delete from ti1 where b=1;
select * from ti1 order by b /* must be (2),(3) */;
# slave must catch up (expect some warnings in error.log)
sync_slave_with_master;
#connection slave;
select * from ti1 order by b /* must stays as were on master (1),(2),(3) */;
delete from ti1 where b=3;
connection master;
insert into ti2 set a=3, b=3;
# slave must catch up (expect some warnings in error.log)
sync_slave_with_master;
#connection slave;
select * from ti2 order by b /* must be (1,1),(2,2) - not inserted */;
#
# Checking the new global sys variable
#
connection slave;
set global slave_exec_mode='IDEMPOTENT';
set global slave_exec_mode='STRICT';
# checking mutual exclusion for the options
--error ER_WRONG_VALUE_FOR_VAR
set global slave_exec_mode='IDEMPOTENT,STRICT';
select @@global.slave_exec_mode /* must be STRICT */;
#
# Checking stops.
# In the following sections strict slave sql thread is going to
# stop when faces an idempotent error. In order to proceed
# the mode is temporarily switched to indempotent.
#
#
--echo *** foreign keys errors as above now forces to stop
#
connection master;
set foreign_key_checks=0;
drop table ti2, ti1;
create table ti1 (b int primary key) engine = innodb;
create table ti2 (a int primary key, b int, foreign key (b) references ti1(b))
engine = innodb;
set foreign_key_checks=1 /* ensure the check */;
insert into ti1 values (1),(2),(3);
insert into ti2 set a=2, b=2;
sync_slave_with_master;
#connection slave;
select * from ti1 order by b /* must be (1),(2),(3) */;
--echo *** conspire future problem
insert into ti2 set a=1, b=1;
select * from ti2 order by b /* must be (1,1) (2,2) */;
connection master;
delete from ti1 where b=1 /* offending delete event */;
select * from ti1 order by b /* must be (2),(3) */;
# foreign key: row is referenced
--echo *** slave must stop (Trying to delete a referenced foreing key)
connection slave;
source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log;
eval SELECT "$last_error" AS Last_SQL_Error;
enable_query_log;
select * from ti1 order by b /* must be (1),(2),(3) - not deleted */;
set foreign_key_checks= 0;
delete from ti2 where b=1;
set foreign_key_checks= 1;
set global slave_exec_mode='IDEMPOTENT';
start slave sql_thread;
connection master;
sync_slave_with_master;
#connection slave;
set global slave_exec_mode='STRICT';
connection master;
sync_slave_with_master;
#connection slave;
--echo *** conspire the following insert failure
# foreign key: no referenced row
--echo *** conspire future problem
delete from ti1 where b=3;
connection master;
insert into ti2 set a=3, b=3 /* offending write event */;
--echo *** slave must stop (Trying to insert an invalid foreign key)
connection slave;
source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log;
eval SELECT "$last_error" AS Last_SQL_Error;
enable_query_log;
select * from ti2 order by b /* must be (2,2) */;
set foreign_key_checks= 0;
insert into ti1 set b=3;
set foreign_key_checks= 1;
set global slave_exec_mode='IDEMPOTENT';
start slave sql_thread;
connection master;
sync_slave_with_master;
#connection slave;
set global slave_exec_mode='STRICT';
connection master;
sync_slave_with_master;
select * from ti2 order by b /* must be (2,2),(3,3) */;
#
--echo *** other errors
#
# dup key insert
#connection slave;
--echo *** conspiring query
insert into ti1 set b=1;
connection master;
insert into ti1 set b=1 /* offending write event */;
--echo *** slave must stop (Trying to insert a dupliacte key)
connection slave;
source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log;
eval SELECT "$last_error" AS Last_SQL_Error;
enable_query_log;
set foreign_key_checks= 0;
delete from ti1 where b=1;
set foreign_key_checks= 1;
set global slave_exec_mode='IDEMPOTENT';
start slave sql_thread;
connection master;
sync_slave_with_master;
#connection slave;
set global slave_exec_mode='STRICT';
# key not found
connection master;
CREATE TABLE t1 (a INT PRIMARY KEY);
CREATE TABLE t2 (a INT);
INSERT INTO t1 VALUES (-1),(-2),(-3);
INSERT INTO t2 VALUES (-1),(-2),(-3);
sync_slave_with_master;
#connection slave;
DELETE FROM t1 WHERE a = -2;
DELETE FROM t2 WHERE a = -2;
connection master;
DELETE FROM t1 WHERE a = -2;
--echo *** slave must stop (Key was not found)
connection slave;
source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log;
eval SELECT "$last_error" AS Last_SQL_Error;
enable_query_log;
set global slave_exec_mode='IDEMPOTENT';
start slave sql_thread;
connection master;
sync_slave_with_master;
#connection slave;
set global slave_exec_mode='STRICT';
connection master;
DELETE FROM t2 WHERE a = -2;
--echo *** slave must stop (Key was not found)
connection slave;
source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log;
eval SELECT "$last_error" AS Last_SQL_Error;
enable_query_log;
set global slave_exec_mode='IDEMPOTENT';
start slave sql_thread;
connection master;
sync_slave_with_master;
#connection slave;
set global slave_exec_mode='STRICT';
UPDATE t1 SET a = 1 WHERE a = -1;
UPDATE t2 SET a = 1 WHERE a = -1;
connection master;
UPDATE t1 SET a = 1 WHERE a = -1;
--echo *** slave must stop (Key was not found)
connection slave;
source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log;
eval SELECT "$last_error" AS Last_SQL_Error;
enable_query_log;
set global slave_exec_mode='IDEMPOTENT';
start slave sql_thread;
connection master;
sync_slave_with_master;
#connection slave;
set global slave_exec_mode='STRICT';
connection master;
UPDATE t2 SET a = 1 WHERE a = -1;
--echo *** slave must stop (Key was not found)
connection slave;
source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log;
eval SELECT "$last_error" AS Last_SQL_Error;
enable_query_log;
set global slave_exec_mode='IDEMPOTENT';
start slave sql_thread;
connection master;
sync_slave_with_master;
#connection slave;
SET @@global.slave_exec_mode= @old_slave_exec_mode;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment