Debian Codegraph @

mysql-test/suite/rpl/r/rpl_stm_user_variables_innodb.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 SET sql_mode = default;
7
8 # The GET DIAGNOSTICS itself is not replicated, but it can set
9 # variables which can be used in statements that are replicated.
10
11 include/rpl_reset.inc
12 CREATE TABLE t1 (a INT, b INT);
13 GET DIAGNOSTICS @var1 = NUMBER;
14 INSERT INTO t1 VALUES (@var1, 0), (@var1, 0);
15 CREATE PROCEDURE p1()
16 LANGUAGE SQL
17 BEGIN
18 DECLARE count INT;
19 UPDATE t1 SET b = 2 WHERE a = 0;
20 GET DIAGNOSTICS count = ROW_COUNT;
21 INSERT INTO t1 VALUES (1, count);
22 END|
23 CALL p1();
24 include/sync_slave_sql_with_master.inc
25 # On slave, check if the statement was replicated.
26 SELECT * FROM t1 ORDER BY a;
27 a b
28 0 2
29 0 2
30 1 2
31 # Show events and cleanup
32 include/show_binlog_events.inc
33 Log_name Pos Event_type Server_id End_log_pos Info
34 master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b INT)
35 master-bin.000001 # Query # # BEGIN
36 master-bin.000001 # User var # # @`var1`=0
37 master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (@var1, 0), (@var1, 0)
38 master-bin.000001 # Query # # COMMIT
39 master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
40 BEGIN
41 DECLARE count INT;
42 UPDATE t1 SET b = 2 WHERE a = 0;
43 GET DIAGNOSTICS count = ROW_COUNT;
44 INSERT INTO t1 VALUES (1, count);
45 END
46 master-bin.000001 # Query # # BEGIN
47 master-bin.000001 # Query # # use `test`; UPDATE t1 SET b = 2 WHERE a = 0
48 master-bin.000001 # Query # # COMMIT
49 master-bin.000001 # Query # # BEGIN
50 master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1, NAME_CONST('count',2))
51 master-bin.000001 # Query # # COMMIT
52 DROP TABLE t1;
53 DROP PROCEDURE p1;
54 include/sync_slave_sql_with_master.inc
55 include/rpl_end.inc