mariadb/mysql-test/suite/tokudb/t/savepoint-4.test
Rich Prohaska 405692c694 refs #6440 move some more mysql tests for tokudb
git-svn-id: file:///svn/mysql/tests/mysql-test@55004 c7de825b-a66e-492c-adef-691d508d4ae1
2013-04-02 20:51:18 +00:00

82 lines
1.5 KiB
Text
Executable file

--source include/have_tokudb.inc
SET DEFAULT_STORAGE_ENGINE = 'TokuDB';
delimiter |;
--disable_warnings
drop function if exists bug13825_2|
drop function if exists f_2|
drop function if exists f_3|
drop function if exists f_4|
drop table if exists t1,t2|
--enable_warnings
create table t1 (i int, primary key (i)) |
create function bug13825_2() returns int
begin
savepoint x;
insert into t1 values (2);
savepoint y;
insert into t1 values (3);
#rollback to savepoint x;
insert into t1 values (4);
insert into t1 values (2);
return 1;
end|
create function f_2() returns int
begin
insert into t1 values (2);
savepoint y;
insert into t1 values (3);
rollback to savepoint y;
insert into t1 values (4);
return 1;
end|
create function f_3() returns int
begin
insert into t1 values (20);
savepoint y;
insert into t1 values (30);
release savepoint y;
insert into t1 values (40);
insert into t1 values (20);
return 1;
end|
create function f_4() returns int
begin
insert into t1 values (20);
savepoint y;
insert into t1 values (30);
release savepoint y;
insert into t1 values (40);
return 1;
end|
set autocommit= 0|
--error ER_DUP_ENTRY
set @a:= bug13825_2()|
select * from t1|
set @a:= f_2()|
select * from t1|
--error ER_DUP_ENTRY
set @a:= f_3()|
select * from t1|
set @a:= f_4()|
select * from t1|
set autocommit= 1|
# Cleanup
drop function bug13825_2|
drop function f_2|
drop function f_3|
drop function f_4|
drop table t1|
delimiter ;|