Debian Codegraph @

mysql-test/suite/rpl/r/rpl_row_sp009.result

raw
1 include/master-slave.inc
2 Warnings:
3 Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
4 Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information.
5 [connection master]
6 CREATE TABLE test.t1 (a INT, PRIMARY KEY(a));
7 INSERT INTO test.t1 VALUES (1),(2),(3),(4);
8 CREATE TABLE test.t2 (a INT, PRIMARY KEY(a));
9 CREATE PROCEDURE test.p1 (arg1 CHAR(1))
10 BEGIN
11 DECLARE b, c INT;
12 IF arg1 = 'a' THEN
13 BEGIN
14 DECLARE cur1 CURSOR FOR SELECT A FROM test.t1 WHERE a % 2;
15 DECLARE continue handler for not found set b = 1;
16 SET b = 0;
17 OPEN cur1;
18 c1_repeat: REPEAT
19 FETCH cur1 INTO c;
20 IF (b = 1) THEN
21 LEAVE c1_repeat;
22 END IF;
23 INSERT INTO test.t2 VALUES (c);
24 UNTIL b = 1
25 END REPEAT;
26 CLOSE cur1;
27 END;
28 END IF;
29 IF arg1 = 'b' THEN
30 BEGIN
31 DECLARE cur2 CURSOR FOR SELECT a FROM test.t1 WHERE NOT a % 2;
32 DECLARE continue handler for not found set b = 1;
33 SET b = 0;
34 OPEN cur2;
35 c2_repeat: REPEAT
36 FETCH cur2 INTO c;
37 IF (b = 1) THEN
38 LEAVE c2_repeat;
39 END IF;
40 INSERT INTO test.t2 VALUES (c);
41 UNTIL b = 1
42 END REPEAT;
43 CLOSE cur2;
44 END;
45 END IF;
46 END|
47 CALL test.p1('a');
48 SELECT * FROM test.t2 ORDER BY a;
49 a
50 1
51 3
52 include/sync_slave_sql_with_master.inc
53 SELECT * FROM test.t2 ORDER BY a;
54 a
55 1
56 3
57 truncate test.t2;
58 call test.p1('b');
59 select * from test.t2 ORDER BY a;
60 a
61 2
62 4
63 include/sync_slave_sql_with_master.inc
64 SELECT * FROM test.t2 ORDER BY a;
65 a
66 2
67 4
68 truncate test.t2;
69 SELECT * FROM test.t2 ORDER BY a;
70 a
71 include/sync_slave_sql_with_master.inc
72 SELECT * FROM test.t2 ORDER BY a;
73 a
74 DROP PROCEDURE test.p1;
75 DROP TABLE test.t1;
76 DROP TABLE test.t2;
77 include/sync_slave_sql_with_master.inc
78 include/rpl_end.inc