Debian Codegraph @

mysql-test/suite/rpl/r/rpl_stm_found_rows.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 ==== Initialize ====
7 **** On Master ****
8 CREATE TABLE t1 (a INT) ENGINE = InnoDB;
9 CREATE TABLE logtbl (sect INT, test INT, count INT) ENGINE = InnoDB;
10 INSERT INTO t1 VALUES (1),(2),(3);
11 INSERT INTO t1 SELECT 2*a+3 FROM t1;
12 INSERT INTO t1 SELECT 2*a+3 FROM t1;
13 INSERT INTO t1 SELECT 2*a+3 FROM t1;
14 INSERT INTO t1 SELECT 2*a+3 FROM t1;
15 INSERT INTO t1 SELECT 2*a+3 FROM t1;
16 INSERT INTO t1 SELECT 2*a+3 FROM t1;
17 ==== Simple test ====
18 SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1;
19 a
20 7
21 Warnings:
22 Warning 1287 SQL_CALC_FOUND_ROWS is deprecated and will be removed in a future release. Consider using two separate queries instead.
23 SELECT FOUND_ROWS() INTO @a;
24 Warnings:
25 Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead.
26 INSERT INTO logtbl VALUES(1,1,@a);
27 SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a < 5 ORDER BY a LIMIT 1;
28 a
29 1
30 Warnings:
31 Warning 1287 SQL_CALC_FOUND_ROWS is deprecated and will be removed in a future release. Consider using two separate queries instead.
32 SELECT FOUND_ROWS() INTO @a;
33 Warnings:
34 Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead.
35 INSERT INTO logtbl VALUES(1,2,@a);
36 SELECT * FROM logtbl WHERE sect = 1 ORDER BY sect,test;
37 sect test count
38 1 1 183
39 1 2 3
40 **** On Slave ****
41 include/sync_slave_sql_with_master.inc
42 SELECT * FROM logtbl WHERE sect = 1 ORDER BY sect,test;
43 sect test count
44 1 1 183
45 1 2 3
46 ==== Stored procedure ====
47 **** On Master ****
48 CREATE PROCEDURE calc_and_log(sect INT, test INT) BEGIN
49 DECLARE cnt INT;
50 SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a < 5 ORDER BY a LIMIT 1;
51 SELECT FOUND_ROWS() INTO cnt;
52 INSERT INTO logtbl VALUES(sect,test,cnt);
53 SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1;
54 SELECT FOUND_ROWS() INTO cnt;
55 INSERT INTO logtbl VALUES(sect,test+1,cnt);
56 END $$
57 Warnings:
58 Warning 1287 SQL_CALC_FOUND_ROWS is deprecated and will be removed in a future release. Consider using two separate queries instead.
59 Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead.
60 Warning 1287 SQL_CALC_FOUND_ROWS is deprecated and will be removed in a future release. Consider using two separate queries instead.
61 Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead.
62 CALL calc_and_log(2,1);
63 a
64 1
65 a
66 7
67 CREATE PROCEDURE just_log(sect INT, test INT, found_rows INT) BEGIN
68 INSERT INTO logtbl VALUES (sect,test,found_rows);
69 END $$
70 SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1;
71 a
72 7
73 Warnings:
74 Warning 1287 SQL_CALC_FOUND_ROWS is deprecated and will be removed in a future release. Consider using two separate queries instead.
75 SELECT FOUND_ROWS() INTO @found_rows;
76 Warnings:
77 Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead.
78 CALL just_log(2,3,@found_rows);
79 SELECT * FROM logtbl WHERE sect = 2 ORDER BY sect,test;
80 sect test count
81 2 1 3
82 2 2 183
83 2 3 183
84 **** On Slave ****
85 include/sync_slave_sql_with_master.inc
86 SELECT * FROM logtbl WHERE sect = 2 ORDER BY sect,test;
87 sect test count
88 2 1 3
89 2 2 183
90 2 3 183
91 ==== Stored functions ====
92 **** On Master ****
93 CREATE FUNCTION log_rows(sect INT, test INT, found_rows INT)
94 RETURNS INT
95 BEGIN
96 INSERT INTO logtbl VALUES(sect,test,found_rows);
97 RETURN found_rows;
98 END $$
99 SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1;
100 a
101 7
102 Warnings:
103 Warning 1287 SQL_CALC_FOUND_ROWS is deprecated and will be removed in a future release. Consider using two separate queries instead.
104 SELECT FOUND_ROWS() INTO @found_rows;
105 Warnings:
106 Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead.
107 SELECT log_rows(3,1,@found_rows), log_rows(3,2,@found_rows);
108 log_rows(3,1,@found_rows) log_rows(3,2,@found_rows)
109 183 183
110 SELECT * FROM logtbl WHERE sect = 3 ORDER BY sect,test;
111 sect test count
112 3 1 183
113 3 2 183
114 **** On Slave ****
115 include/sync_slave_sql_with_master.inc
116 SELECT * FROM logtbl WHERE sect = 3 ORDER BY sect,test;
117 sect test count
118 3 1 183
119 3 2 183
120 ==== Cleanup ====
121 **** On Master ****
122 DROP TABLE t1, logtbl;
123 DROP PROCEDURE just_log;
124 DROP PROCEDURE calc_and_log;
125 DROP FUNCTION log_rows;
126 include/rpl_end.inc