1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00
Files
mariadb/mysql-test/extra/rpl_tests/rpl_row_sp003.test
mats@romeo.(none) 7c187c2c9b WL#3464: Add replication event to denote gap in replication
Adding an event that can be used to denote that an incident occured
on the master. The event can be used to denote a gap in the replication
stream, but can also be used to denote other incidents.

In addition, the injector interface is extended with functions to
generate an incident event. The function will also rotate the binary
log after generating an incident event to get a fresh binary log.
2007-03-29 20:31:09 +02:00

76 lines
1.8 KiB
Plaintext

#############################################################################
# Original Author: JBM #
# Original Date: Aug/13/2005 Created from Bug 12335 #
#############################################################################
# Includes
-- source include/have_binlog_format_row.inc
-- source include/master-slave.inc
# Begin clean up test section
connection master;
--disable_warnings
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t1;
--enable_warnings
# End of cleanup
# Begin test section 1
eval CREATE TABLE test.t1(a INT,PRIMARY KEY(a))ENGINE=$engine_type;
delimiter |;
CREATE PROCEDURE test.p1()
BEGIN
INSERT INTO test.t1 VALUES (4);
SELECT get_lock("test", 100);
UPDATE test.t1 set a=a+4 WHERE a=4;
END|
CREATE PROCEDURE test.p2()
BEGIN
UPDATE test.t1 SET a=a+1;
END|
delimiter ;|
SELECT get_lock("test", 200);
connection master1;
send CALL test.p1();
connection master;
# To make sure tha the call on master1 arrived at the get_lock
sleep 1;
CALL test.p2();
SELECT release_lock("test");
SELECT * FROM test.t1;
#show binlog events;
# Added sleep for use with NDB to ensure that
# the injector thread will populate log before
# we switch to the slave.
sleep 5;
sync_slave_with_master;
connection slave;
SELECT * FROM test.t1;
connection master;
DROP TABLE IF EXISTS test.t1;
eval CREATE TABLE test.t1(a INT,PRIMARY KEY(a))ENGINE=$engine_type;
CALL test.p2();
CALL test.p1();
SELECT * FROM test.t1;
sync_slave_with_master;
connection slave;
SELECT * FROM test.t1;
connection master;
#show binlog events from 720;
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t1;
sync_slave_with_master;
# End of 5.0 test case