File: rpl_row_sp003.test

package info (click to toggle)
mariadb 1%3A11.8.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 772,520 kB
  • sloc: ansic: 2,414,714; cpp: 1,791,394; asm: 381,336; perl: 62,905; sh: 49,647; pascal: 40,897; java: 39,363; python: 20,791; yacc: 20,432; sql: 17,907; xml: 12,344; ruby: 8,544; cs: 6,542; makefile: 6,145; ada: 1,879; lex: 1,193; javascript: 996; objc: 80; tcl: 73; awk: 46; php: 22
file content (81 lines) | stat: -rw-r--r-- 2,043 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
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