~stewart/drizzle/embedded-innodb-create-select-transaction-arrgh

« back to all changes in this revision

Viewing changes to mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result

  • Committer: brian
  • Date: 2008-06-25 05:29:13 UTC
  • Revision ID: brian@localhost.localdomain-20080625052913-6upwo0jsrl4lnapl
clean slate

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
stop slave;
 
2
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 
3
reset master;
 
4
reset slave;
 
5
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 
6
start slave;
 
7
create database if not exists mysqltest1;
 
8
DROP PROCEDURE IF EXISTS mysqltest1.p1;
 
9
DROP PROCEDURE IF EXISTS mysqltest1.p2;
 
10
DROP TABLE IF EXISTS mysqltest1.t2;
 
11
DROP TABLE IF EXISTS mysqltest1.t1;
 
12
CREATE TABLE IF NOT EXISTS mysqltest1.t1(name CHAR(16), birth DATE,PRIMARY KEY(name))ENGINE=InnoDB;
 
13
CREATE TABLE IF NOT EXISTS mysqltest1.t2(name CHAR(16), age INT ,PRIMARY KEY(name))ENGINE=InnoDB;
 
14
CREATE PROCEDURE mysqltest1.p1()
 
15
BEGIN
 
16
DECLARE done INT DEFAULT 0;
 
17
DECLARE spa CHAR(16);
 
18
DECLARE spb INT;
 
19
DECLARE cur1 CURSOR FOR SELECT name, 
 
20
(YEAR(CURDATE())-YEAR(birth))-(RIGHT(CURDATE(),5)<RIGHT(birth,5)) 
 
21
FROM mysqltest1.t1;
 
22
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;
 
23
OPEN cur1;
 
24
SET AUTOCOMMIT=0;
 
25
REPEAT
 
26
FETCH cur1 INTO spa, spb;
 
27
IF NOT done THEN
 
28
START TRANSACTION;
 
29
INSERT INTO mysqltest1.t2 VALUES (spa,spb);
 
30
COMMIT;
 
31
END IF;
 
32
UNTIL done END REPEAT;
 
33
SET AUTOCOMMIT=1;
 
34
CLOSE cur1;
 
35
END|
 
36
CREATE PROCEDURE mysqltest1.p2()
 
37
BEGIN
 
38
INSERT INTO mysqltest1.t1 VALUES ('MySQL','1993-02-04'),('ROCKS', '1990-08-27'),('Texas', '1999-03-30'),('kyle','2005-1-1');
 
39
END|
 
40
CALL mysqltest1.p2();
 
41
CALL mysqltest1.p1();
 
42
DROP PROCEDURE IF EXISTS mysqltest1.p1;
 
43
DROP PROCEDURE IF EXISTS mysqltest1.p2;
 
44
DROP TABLE IF EXISTS mysqltest1.t1;
 
45
DROP TABLE IF EXISTS mysqltest1.t2;
 
46
DROP DATABASE mysqltest1;