| 1 |
############################################################################# |
| 2 |
# Original Author: JBM # |
| 3 |
# Original Date: Aug/15/2005 # |
| 4 |
# Update: 08/29/2005 Remove sleep # |
| 5 |
############################################################################# |
| 6 |
# TEST: Use SQL_CALC_FOUND_ROWS and insert results into a table inside a sp # |
| 7 |
############################################################################# |
| 8 |
|
| 9 |
|
| 10 |
# Includes |
| 11 |
-- source include/have_binlog_format_row.inc |
| 12 |
-- source include/set_privilege_checks_user_as_system_user.inc |
| 13 |
-- source include/master-slave.inc |
| 14 |
|
| 15 |
# Begin clean up test section |
| 16 |
connection master; |
| 17 |
--disable_warnings |
| 18 |
DROP PROCEDURE IF EXISTS test.p1; |
| 19 |
DROP TABLE IF EXISTS test.t2; |
| 20 |
--enable_warnings |
| 21 |
# End of cleanup |
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
# Begin test section 1 |
| 26 |
CREATE TABLE test.t1 (a INT,PRIMARY KEY(a)); |
| 27 |
CREATE TABLE test.t2 (a INT,PRIMARY KEY(a)); |
| 28 |
INSERT INTO test.t1 VALUES(1),(2); |
| 29 |
|
| 30 |
delimiter |; |
| 31 |
CREATE PROCEDURE test.p1() |
| 32 |
BEGIN |
| 33 |
SELECT SQL_CALC_FOUND_ROWS * FROM test.t1 LIMIT 1; |
| 34 |
INSERT INTO test.t2 VALUES(FOUND_ROWS()); |
| 35 |
END| |
| 36 |
delimiter ;| |
| 37 |
|
| 38 |
let $message=< ---- Master selects-- >; |
| 39 |
--source include/show_msg.inc |
| 40 |
CALL test.p1(); |
| 41 |
SELECT * FROM test.t2; |
| 42 |
|
| 43 |
let $message=< ---- Slave selects-- >; |
| 44 |
--source include/show_msg.inc |
| 45 |
--source include/sync_slave_sql_with_master.inc |
| 46 |
SELECT * FROM test.t2; |
| 47 |
|
| 48 |
# Cleanup |
| 49 |
|
| 50 |
connection master; |
| 51 |
DROP PROCEDURE IF EXISTS test.p1; |
| 52 |
DROP TABLE IF EXISTS test.t1; |
| 53 |
DROP TABLE IF EXISTS test.t2; |
| 54 |
--source include/sync_slave_sql_with_master.inc |
| 55 |
|
| 56 |
# End of 5.0 test case |
| 57 |
--source include/rpl_end.inc |