summaryrefslogtreecommitdiff
path: root/storage/tokudb/mysql-test/tokudb/r/savepoint-3.result
blob: e7e9fa332abc95bb0293cddd8b1ffb783b5032cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
SET DEFAULT_STORAGE_ENGINE = 'TokuDB';
drop function if exists bug13825_0|
drop function if exists bug13825_1|
drop function if exists bug13825_2|
drop function if exists bug13825_3|
drop function if exists bug13825_4|
drop function if exists bug13825_5|
drop procedure if exists bug13825_0|
drop procedure if exists bug13825_1|
drop procedure if exists bug13825_2|
drop table if exists t1,t2|
create table t1 (i int) |
create table t2 (i int) |
create function bug13825_0() returns int
begin
rollback to savepoint x;
return 1;
end|
create function bug13825_1() returns int
begin
release savepoint x;
return 1;
end|
create function bug13825_2() returns int
begin
insert into t1 values (2);
savepoint x;
insert into t1 values (3);
rollback to savepoint x;
insert into t1 values (4);
return 1;
end|
create procedure bug13825_0()
begin
rollback to savepoint x;
end|
create procedure bug13825_1()
begin
release savepoint x;
end|
create procedure bug13825_2()
begin
savepoint x;
end|
insert into t2 values (1)|
create trigger t2_bi before insert on t2 for each row
rollback to savepoint x|
create trigger t2_bu before update on t2 for each row
release savepoint x|
create trigger t2_bd before delete on t2 for each row
begin
insert into t1 values (2);
savepoint x;
insert into t1 values (3);
rollback to savepoint x;
insert into t1 values (4);
end|
create function bug13825_3(rb int) returns int
begin
insert into t1 values(1);
savepoint x;
insert into t1 values(2);
if rb then
rollback to savepoint x;
end if;
insert into t1 values(3);
return rb;
end|
create function bug13825_4() returns int
begin
savepoint x;
insert into t1 values(2);
rollback to savepoint x;
return 0;
end|
create function bug13825_5(p int) returns int
begin
savepoint x;
insert into t2 values(p);
rollback to savepoint x;
insert into t2 values(p+1);
return p;
end|
set autocommit= 0|
begin |
insert into t1 values (1)|
savepoint x|
set @a:= bug13825_0()|
ERROR 42000: SAVEPOINT x does not exist
insert into t2 values (2)|
ERROR 42000: SAVEPOINT x does not exist
set @a:= bug13825_1()|
ERROR 42000: SAVEPOINT x does not exist
update t2 set i = 2|
ERROR 42000: SAVEPOINT x does not exist
set @a:= bug13825_2()|
select * from t1|
i
1
2
4
rollback to savepoint x|
select * from t1|
i
1
delete from t2|
select * from t1|
i
1
2
4
rollback to savepoint x|
select * from t1|
i
1
release savepoint x|
set @a:= bug13825_2()|
select * from t1|
i
1
2
4
rollback to savepoint x|
ERROR 42000: SAVEPOINT x does not exist
delete from t1|
commit|
begin|
insert into t1 values (5)|
savepoint x|
insert into t1 values (6)|
call bug13825_0()|
select * from t1|
i
5
call bug13825_1()|
rollback to savepoint x|
ERROR 42000: SAVEPOINT x does not exist
savepoint x|
insert into t1 values (7)|
call bug13825_2()|
rollback to savepoint x|
select * from t1|
i
5
7
delete from t1|
commit|
set autocommit= 1|
select bug13825_3(0)|
bug13825_3(0)
0
select * from t1|
i
1
2
3
delete from t1|
select bug13825_3(1)|
bug13825_3(1)
1
select * from t1|
i
1
3
delete from t1|
set autocommit= 0|
begin|
insert into t1 values (1)|
set @a:= bug13825_4()|
select * from t1|
i
1
delete from t1|
commit|
set autocommit= 1|
drop table t2|
create table t2 (i int) |
insert into t1 values (1), (bug13825_5(2)), (3)|
select * from t1|
i
1
2
3
select * from t2|
i
3
drop function bug13825_0|
drop function bug13825_1|
drop function bug13825_2|
drop function bug13825_3|
drop function bug13825_4|
drop function bug13825_5|
drop procedure bug13825_0|
drop procedure bug13825_1|
drop procedure bug13825_2|
drop table t1, t2|