Debian Codegraph @

mysql-test/suite/binlog/r/binlog_transaction_write_set_savepoint_level.result

raw
1 SET @save_session_debug= @@SESSION.debug;
2 SET @@SESSION.debug = "+d,transaction_write_set_savepoint_level";
3 CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY);
4 CREATE TABLE t2 (c1 INT NOT NULL PRIMARY KEY);
5 CREATE TABLE t3 (c1 INT NOT NULL PRIMARY KEY);
6 CREATE TABLE t4 (c1 INT NOT NULL PRIMARY KEY);
7 CREATE TRIGGER t1_tr1 BEFORE INSERT ON t1 FOR EACH ROW
8 BEGIN
9 SAVEPOINT S1;
10 INSERT INTO t2 VALUES (NEW.c1);
11 END|
12 CREATE FUNCTION f1(x INT) RETURNS INT
13 BEGIN
14 INSERT INTO t2 VALUES (x);
15 SAVEPOINT S1;
16 INSERT INTO t1 VALUES (100);
17 ROLLBACK TO S1;
18 RETURN (1);
19 END|
20 BEGIN;
21 SAVEPOINT S1;
22 INSERT INTO t1 VALUES (1);
23 ROLLBACK TO S1;
24 SELECT f1(102);
25 f1(102)
26 1
27 SET @@SESSION.debug = "+d,transaction_write_set_size_2";
28 SELECT f1(101);
29 f1(101)
30 1
31 COMMIT;
32 SET @@SESSION.debug= @save_session_debug;
33 CREATE TRIGGER t3_tr1 AFTER INSERT ON t3 FOR EACH ROW
34 BEGIN
35 DECLARE EXIT HANDLER FOR SQLEXCEPTION
36 BEGIN
37 ROLLBACK TO SAVEPOINT inside_trigger;
38 INSERT INTO t4 VALUES (NEW.c1*20);
39 END;
40 SAVEPOINT inside_trigger;
41 INSERT INTO t4 VALUES (NEW.c1);
42 RELEASE SAVEPOINT inside_trigger;
43 END|
44 INSERT INTO t3 values (1);
45 INSERT INTO t4 values (2);
46 INSERT INTO t3 values (2);
47 SELECT * FROM t1;
48 SELECT * FROM t2;
49 c1 101
50 c1 102
51 SELECT * FROM t3;
52 c1 1
53 c1 2
54 SELECT * FROM t4;
55 c1 1
56 c1 2
57 c1 40
58 include/assert.inc ['There are no values in table t1']
59 include/assert.inc ['There are 2 values in table t2']
60 include/assert.inc ['There are 2 values in table t3']
61 include/assert.inc ['There are 3 values in table t4']
62 DROP FUNCTION f1;
63 DROP TABLE t1;
64 DROP TABLE t2;
65 DROP TABLE t3;
66 DROP TABLE t4;