| 1 |
############################################################################# |
| 2 |
# Original Author: JBM # |
| 3 |
# Original Date: Aug/18/2005 # |
| 4 |
# Update: 08/29/2005 remove sleep added master pos save and sync # |
| 5 |
############################################################################# |
| 6 |
#TEST: Taken and modfied from http://bugs.mysql.com/bug.php?id=11126 # |
| 7 |
############################################################################# |
| 8 |
|
| 9 |
# Includes |
| 10 |
-- source include/have_binlog_format_row.inc |
| 11 |
-- source include/set_privilege_checks_user_as_system_user.inc |
| 12 |
-- source include/master-slave.inc |
| 13 |
|
| 14 |
|
| 15 |
# Begin clean up test section |
| 16 |
connection master; |
| 17 |
|
| 18 |
# Begin test section 1 |
| 19 |
delimiter |; |
| 20 |
CREATE PROCEDURE test.p1() |
| 21 |
BEGIN |
| 22 |
INSERT INTO test.t1 VALUES(2); |
| 23 |
END| |
| 24 |
CREATE PROCEDURE test.p2() |
| 25 |
BEGIN |
| 26 |
DROP TEMPORARY TABLE IF EXISTS test.t1; |
| 27 |
CREATE TEMPORARY TABLE test.t1 (a int, PRIMARY KEY(a)); |
| 28 |
INSERT INTO test.t1 VALUES(1); |
| 29 |
CALL test.p1(); |
| 30 |
END| |
| 31 |
delimiter ;| |
| 32 |
CALL test.p2(); |
| 33 |
SELECT * FROM test.t1 ORDER BY a; |
| 34 |
|
| 35 |
--source include/sync_slave_sql_with_master.inc |
| 36 |
show tables; |
| 37 |
|
| 38 |
connection master; |
| 39 |
delimiter |; |
| 40 |
CREATE PROCEDURE test.p3() |
| 41 |
BEGIN |
| 42 |
INSERT INTO test.t2 VALUES(7); |
| 43 |
END| |
| 44 |
CREATE PROCEDURE test.p4() |
| 45 |
BEGIN |
| 46 |
DROP TABLE IF EXISTS test.t2; |
| 47 |
CREATE TABLE test.t2 (a int, PRIMARY KEY(a)); |
| 48 |
INSERT INTO test.t2 VALUES(6); |
| 49 |
CALL test.p3(); |
| 50 |
END| |
| 51 |
delimiter ;| |
| 52 |
CALL test.p4(); |
| 53 |
SELECT * FROM test.t2 ORDER BY a; |
| 54 |
|
| 55 |
--source include/sync_slave_sql_with_master.inc |
| 56 |
SELECT * FROM test.t2 ORDER BY a; |
| 57 |
|
| 58 |
# Cleanup |
| 59 |
connection master; |
| 60 |
#show binlog events; |
| 61 |
DROP PROCEDURE IF EXISTS test.p1; |
| 62 |
DROP PROCEDURE IF EXISTS test.p2; |
| 63 |
DROP PROCEDURE IF EXISTS test.p3; |
| 64 |
DROP PROCEDURE IF EXISTS test.p4; |
| 65 |
DROP TABLE IF EXISTS test.t1; |
| 66 |
DROP TABLE IF EXISTS test.t2; |
| 67 |
--source include/sync_slave_sql_with_master.inc |
| 68 |
|
| 69 |
# End of 5.0 test case |
| 70 |
--source include/rpl_end.inc |