diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 12:24:36 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 12:24:36 +0000 |
commit | 06eaf7232e9a920468c0f8d74dcf2fe8b555501c (patch) | |
tree | e2c7b5777f728320e5b5542b6213fd3591ba51e2 /mysql-test/suite/rpl/include/rpl_row_sp003.test | |
parent | Initial commit. (diff) | |
download | mariadb-06eaf7232e9a920468c0f8d74dcf2fe8b555501c.tar.xz mariadb-06eaf7232e9a920468c0f8d74dcf2fe8b555501c.zip |
Adding upstream version 1:10.11.6.upstream/1%10.11.6
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/suite/rpl/include/rpl_row_sp003.test')
-rw-r--r-- | mysql-test/suite/rpl/include/rpl_row_sp003.test | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/mysql-test/suite/rpl/include/rpl_row_sp003.test b/mysql-test/suite/rpl/include/rpl_row_sp003.test new file mode 100644 index 00000000..829e42f2 --- /dev/null +++ b/mysql-test/suite/rpl/include/rpl_row_sp003.test @@ -0,0 +1,81 @@ +############################################################################# +# Original Author: JBM # +# Original Date: Aug/13/2005 Created from Bug 12335 # +############################################################################# + +# 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 + +--disable_ps2_protocol +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; +# Make sure that the call on master1 arrived at the get_lock. +let $wait_condition= + select count(*) = 1 from information_schema.processlist + where state = 'User lock' and + info = 'SELECT get_lock("test", 100)'; +--source include/wait_condition.inc +CALL test.p2(); +SELECT release_lock("test"); + +connection master1; +# Reap CALL test.p1() to ensure that it has fully completed +# before doing any selects on test.t1. +--reap +# Release lock acquired by it. +SELECT release_lock("test"); + +connection master; +SELECT * FROM test.t1; +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 release_lock("test"); +SELECT * FROM test.t1; + +sync_slave_with_master; +connection slave; +SELECT * FROM test.t1; +connection master; +#show binlog events from 720; +--enable_ps2_protocol + +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 |