3
3
# Test for Bug #534806 - SAVEPOINT without active transaction
4
4
# triggers assert in InnoDB handler
6
--echo Start Test of Bug 534806
9
7
CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY);
11
9
UPDATE t1 SET id = 2 WHERE id != 2 LIMIT 0;
14
--echo End Test of Bug 534806
18
14
# Let's test the non-edge case for SAVEPOINTS:
22
18
# and committing without any rollbacks or savepoint releases.
24
20
CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY);
26
24
INSERT INTO t1 VALUES (1);
28
28
INSERT INTO t1 VALUES (2);
30
32
INSERT INTO t1 VALUES (3);
33
36
# t1 should now have 1,2,3 in it.
38
41
# work done in all savepoints should be rolled back.
41
45
INSERT INTO t1 VALUES (4);
43
49
INSERT INTO t1 VALUES (5);
45
53
INSERT INTO t1 VALUES (6);
48
57
# t1 should still have 1,2,3 in it.
52
61
# ROLLBACK work to a specific SAVEPOINT and then COMMIT.
55
65
INSERT INTO t1 VALUES (4);
57
69
INSERT INTO t1 VALUES (5);
59
73
INSERT INTO t1 VALUES (6);
60
75
ROLLBACK TO SAVEPOINT A;
63
79
# 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