3
3
# Test for Bug #534806 - SAVEPOINT without active transaction
4
4
# triggers assert in InnoDB handler
6
--echo Start Test of Bug 534806
7
9
CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY);
9
11
UPDATE t1 SET id = 2 WHERE id != 2 LIMIT 0;
14
--echo End Test of Bug 534806
14
18
# Let's test the non-edge case for SAVEPOINTS:
18
22
# and committing without any rollbacks or savepoint releases.
20
24
CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY);
24
26
INSERT INTO t1 VALUES (1);
28
28
INSERT INTO t1 VALUES (2);
32
30
INSERT INTO t1 VALUES (3);
36
33
# t1 should now have 1,2,3 in it.
41
38
# work done in all savepoints should be rolled back.
45
41
INSERT INTO t1 VALUES (4);
49
43
INSERT INTO t1 VALUES (5);
53
45
INSERT INTO t1 VALUES (6);
57
48
# t1 should still have 1,2,3 in it.
61
52
# ROLLBACK work to a specific SAVEPOINT and then COMMIT.
65
55
INSERT INTO t1 VALUES (4);
69
57
INSERT INTO t1 VALUES (5);
73
59
INSERT INTO t1 VALUES (6);
75
60
ROLLBACK TO SAVEPOINT A;
79
63
# t1 should have 1,2,3,4 in it.
68
# Test for Bug #542299
70
# segfault on ROLLBACK TO SAVEPOINT A - during randgen
72
--echo Start Test of Bug 542299
74
CREATE TABLE t1 (a int,id integer auto_increment,b int,/*Indices*/key (a ),primary key (id)) ENGINE=innodb;
75
INSERT INTO t1 VALUES (100, NULL, 100) , (100, NULL, 100) , (100, NULL, 100) , (100, NULL, 100) , (100, NULL, 100) , (100, NULL, 100) , (100, NULL, 100) , (100, NULL, 100);
77
DELETE FROM t1 WHERE 1 = 1 LIMIT 1;
78
COMMIT; /* OR ROLLBACK... */
80
INSERT INTO t1 ( a, b ) VALUES ( 1 , 9 );
81
ROLLBACK TO SAVEPOINT A;
83
--echo End Test of Bug 542299