1 #############################################################################
2 # Original Author: JBM #
3 # Original Date: Aug/18/2005 #
4 # Updated: 08/29/2005 removed sleeps and added master pos save and snyc #
5 #############################################################################
6 #TEST: Taken and modfied from http://bugs.mysql.com/bug.php?id=12168 #
7 #############################################################################
8 # 2006-02-08 By JBM : Added order by for ndb engine use
9 #############################################################################
12 -- source include/have_binlog_format_row.inc
13 -- source include/master-slave.inc
16 # Begin clean up test section
19 DROP PROCEDURE IF EXISTS test.p1;
20 DROP TABLE IF EXISTS test.t1;
21 DROP TABLE IF EXISTS test.t2;
24 # Begin test section 1
25 CREATE TABLE test.t1 (a INT, PRIMARY KEY(a));
26 INSERT INTO test.t1 VALUES (1),(2),(3),(4);
27 CREATE TABLE test.t2 (a INT, PRIMARY KEY(a));
30 CREATE PROCEDURE test.p1 (arg1 CHAR(1))
35 DECLARE cur1 CURSOR FOR SELECT A FROM test.t1 WHERE a % 2;
36 DECLARE continue handler for not found set b = 1;
45 INSERT INTO test.t2 VALUES (c);
53 DECLARE cur2 CURSOR FOR SELECT a FROM test.t1 WHERE NOT a % 2;
54 DECLARE continue handler for not found set b = 1;
63 INSERT INTO test.t2 VALUES (c);
73 SELECT * FROM test.t2 ORDER BY a;
77 SELECT * FROM test.t2 ORDER BY a;
81 # this next call fails, but should not
83 select * from test.t2 ORDER BY a;
87 SELECT * FROM test.t2 ORDER BY a;
91 SELECT * FROM test.t2 ORDER BY a;
95 SELECT * FROM test.t2 ORDER BY a;
100 DROP PROCEDURE test.p1;
103 sync_slave_with_master;
105 # End of 5.0 test case
106 --source include/rpl_end.inc