~vkolesnikov/pbxt/pbxt-07-diskfull

« back to all changes in this revision

Viewing changes to pbxt/mysql-test-update/mysql-test/extra/rpl_tests/rpl_row_sp003.test

  • Committer: paul-mccullagh
  • Date: 2006-10-23 09:14:04 UTC
  • Revision ID: paul-mccullagh-918861e03d351978a9541168a96e58cc826734ee
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#############################################################################
 
2
# Original Author: JBM                                                      #
 
3
# Original Date: Aug/13/2005 Created from Bug 12335                         #
 
4
#############################################################################
 
5
 
 
6
# Includes
 
7
-- source include/have_binlog_format_row.inc
 
8
-- source include/master-slave.inc
 
9
 
 
10
 
 
11
# Begin clean up test section
 
12
connection master;
 
13
--disable_warnings
 
14
DROP PROCEDURE IF EXISTS test.p1;
 
15
DROP PROCEDURE IF EXISTS test.p2;
 
16
DROP TABLE IF EXISTS test.t1;
 
17
--enable_warnings
 
18
# End of cleanup
 
19
 
 
20
# Begin test section 1
 
21
 
 
22
eval CREATE TABLE test.t1(a INT,PRIMARY KEY(a))ENGINE=$engine_type;
 
23
 
 
24
delimiter |;
 
25
CREATE PROCEDURE test.p1()
 
26
BEGIN
 
27
  INSERT INTO test.t1 VALUES (4);
 
28
  SELECT  get_lock("test", 100);
 
29
  UPDATE test.t1 set a=a+4 WHERE a=4;
 
30
END|
 
31
CREATE PROCEDURE test.p2()
 
32
BEGIN
 
33
  UPDATE test.t1 SET a=a+1;
 
34
END|
 
35
delimiter ;|
 
36
 
 
37
SELECT get_lock("test", 200);
 
38
 
 
39
connection master1;
 
40
send CALL test.p1();
 
41
 
 
42
connection master;
 
43
# To make sure tha the call on master1 arrived at the get_lock
 
44
sleep 1;
 
45
CALL test.p2();
 
46
SELECT release_lock("test");
 
47
SELECT * FROM test.t1; 
 
48
#show binlog events;
 
49
# Added sleep for use with NDB to ensure that
 
50
# the injector thread will populate log before
 
51
# we switch to the slave.
 
52
sleep 5;
 
53
sync_slave_with_master;
 
54
connection slave;
 
55
SELECT * FROM test.t1;
 
56
 
 
57
connection master;
 
58
DROP TABLE IF EXISTS test.t1;
 
59
eval CREATE TABLE test.t1(a INT,PRIMARY KEY(a))ENGINE=$engine_type;
 
60
CALL test.p2();
 
61
CALL test.p1();
 
62
SELECT * FROM test.t1;
 
63
 
 
64
sync_slave_with_master;
 
65
connection slave;
 
66
SELECT * FROM test.t1;
 
67
connection master;
 
68
#show binlog events from 719;
 
69
 
 
70
DROP PROCEDURE IF EXISTS test.p1;
 
71
DROP PROCEDURE IF EXISTS test.p2;
 
72
DROP TABLE IF EXISTS test.t1;
 
73
sync_slave_with_master;
 
74
 
 
75
# End of 5.0 test case