Debian Codegraph @

mysql-test/suite/rpl_nogtid/t/rpl_auto_increment_bug33029.test

raw
1 # BUG#33029 5.0 to 5.1 replication fails on dup key when inserting
2 # using a trig in SP
3
4 # For all 5.0 up to 5.0.58 exclusive, and 5.1 up to 5.1.12 exclusive,
5 # if one statement in a SP generated AUTO_INCREMENT value by the top
6 # statement, all statements after it would be considered generated
7 # AUTO_INCREMENT value by the top statement, and a erroneous INSERT_ID
8 # value might be associated with these statement, which could cause
9 # duplicate entry error and stop the slave.
10
11 # Test if the slave can replicate from such a buggy master
12
13 # The bug33029-slave-relay-bin.000001 file is the
14 # slave-replay-bin.000003 file generated by run the
15 # rpl_auto_increment_bug33029.test with clean up statements at the end
16 # of the test case removed on a buggy 5.0 server
17
18 --source include/not_group_replication_plugin.inc
19 --let $rpl_skip_start_slave= 1
20 --source include/not_have_privilege_checks_user.inc
21 --source include/master-slave.inc
22
23 --echo ==== Initialize ====
24 --connection slave
25
26 # The binlog we read does funny things with triggers and causes this warning.
27 --disable_query_log
28 CALL mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT');
29 CALL mtr.add_suppression("Either event.*is from an old source");
30 --enable_query_log
31
32 # Need to restore this at the end; CHANGE MASTER modifies it (see the
33 # manual for CHANGE MASTER).
34 SET @old_relay_log_purge= @@global.relay_log_purge;
35
36 # the relay log contains create t1, t2 tables and load data infile
37 --let $fake_relay_log = $MYSQL_TEST_DIR/std_data/bug33029-slave-relay-bin.000001
38 --source include/setup_fake_relay_log.inc
39
40 --echo ==== Test ====
41 start slave sql_thread;
42 --let $slave_param= Exec_Master_Log_Pos
43 --let $slave_param_value= 3776
44 --source include/wait_for_slave_param.inc
45
46
47 echo # Result on slave;
48 SELECT * FROM t1;
49 SELECT * FROM t2;
50
51 --echo ==== Clean up ====
52
53 stop slave sql_thread;
54 --source include/cleanup_fake_relay_log.inc
55
56 DROP TABLE t1, t2;
57 DROP PROCEDURE p1;
58 DROP PROCEDURE p2;
59 DROP FUNCTION f1;
60
61 SET @@global.relay_log_purge= @old_relay_log_purge;
62 --let $rpl_only_running_threads= 1
63 --source include/rpl_end.inc