diff options
-rw-r--r-- | mysql-test/r/sp_trans.result | 24 | ||||
-rw-r--r-- | mysql-test/t/sp-error.test | 9 | ||||
-rw-r--r-- | mysql-test/t/sp-threads.test | 12 | ||||
-rw-r--r-- | mysql-test/t/sp.test | 24 | ||||
-rw-r--r-- | mysql-test/t/sp_trans.test | 41 |
5 files changed, 80 insertions, 30 deletions
diff --git a/mysql-test/r/sp_trans.result b/mysql-test/r/sp_trans.result index 0a28fae3c0d..dee87979ff4 100644 --- a/mysql-test/r/sp_trans.result +++ b/mysql-test/r/sp_trans.result @@ -1,22 +1,22 @@ -drop procedure if exists sp1; +drop procedure if exists bug8850| create table t1 (a int) engine=innodb| -create procedure sp1 () +create procedure bug8850() begin truncate table t1; insert t1 values (1); rollback; end| -set autocommit=0; -insert t1 values (2); -call sp1(); +set autocommit=0| +insert t1 values (2)| +call bug8850()| ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction -commit; -select * from t1; +commit| +select * from t1| a 2 -call sp1(); +call bug8850()| ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction -set autocommit=1; -select * from t1; +set autocommit=1| +select * from t1| a 2 -drop table t1; -drop procedure sp1; +drop table t1| +drop procedure bug8850| diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test index 0f775958d7a..53783e7c9bf 100644 --- a/mysql-test/t/sp-error.test +++ b/mysql-test/t/sp-error.test @@ -680,6 +680,15 @@ begin end| +# +# BUG#NNNN: New bug synopsis +# +#--disable_warnings +#drop procedure if exists bugNNNN| +#--enable_warnings +#create procedure bugNNNN... + + drop table t1| delimiter ;| diff --git a/mysql-test/t/sp-threads.test b/mysql-test/t/sp-threads.test index 27888158f03..0ced60a610f 100644 --- a/mysql-test/t/sp-threads.test +++ b/mysql-test/t/sp-threads.test @@ -1,5 +1,6 @@ # -# Testing stored procedures with multiple connections +# Testing stored procedures with multiple connections, +# except security/privilege tests, they go to sp-security.test # connect (con1root,localhost,root,,); @@ -52,3 +53,12 @@ connection con1root; drop table t1; drop procedure bug4934; + +# +# BUG#NNNN: New bug synopsis +# +#--disable_warnings +#drop procedure if exists bugNNNN; +#--enable_warnings +#create procedure bugNNNN... + diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index fe00038a595..b8eb371931f 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -4,11 +4,22 @@ # Please keep this file free of --error cases and other # things that will not run in a single debugged mysqld # process (e.g. master-slave things). - --- source include/have_innodb.inc +# +# Test cases for bugs are added at the end. See template there. +# +# Tests that require --error go into sp-error.test +# Tests that require inndb go into sp_trans.test +# Tests that check privilege and security issues go to sp-security.test. +# Tests that require multiple connections, except security/privilege tests, +# go to sp-thread. use test; +# Test tables +# +# t1 and t2 are reused throughout the file, and dropped at the end. +# t3 and up are created and dropped when needed. +# --disable_warnings drop table if exists t1; --enable_warnings @@ -3387,6 +3398,15 @@ drop procedure bug8937| delete from t1| +# +# BUG#NNNN: New bug synopsis +# +#--disable_warnings +#drop procedure if exists bugNNNN| +#--enable_warnings +#create procedure bugNNNN... + + # Add bugs above this line. Use existing tables t1 and t2 when # practical, or create table t3, t3 etc temporarily (and drop them). delimiter ;| diff --git a/mysql-test/t/sp_trans.test b/mysql-test/t/sp_trans.test index 30622027a94..f5b38ada674 100644 --- a/mysql-test/t/sp_trans.test +++ b/mysql-test/t/sp_trans.test @@ -4,32 +4,43 @@ -- source include/have_innodb.inc +delimiter |; + # -# BUG#8850 +# BUG#8850: Truncate table in a stored procedure locks the tables # --disable_warnings -drop procedure if exists sp1; +drop procedure if exists bug8850| --enable_warnings -delimiter |; create table t1 (a int) engine=innodb| -create procedure sp1 () +create procedure bug8850() begin truncate table t1; insert t1 values (1); rollback; end| -delimiter ;| -set autocommit=0; -insert t1 values (2); + +set autocommit=0| +insert t1 values (2)| --error 1192 -call sp1(); -commit; -select * from t1; +call bug8850()| +commit| +select * from t1| # # when CALL will be fixed to not start a transaction, the error should # go away --error 1192 -call sp1(); -set autocommit=1; -select * from t1; -drop table t1; -drop procedure sp1; +call bug8850()| +set autocommit=1| +select * from t1| +drop table t1| +drop procedure bug8850| + +# +# BUG#NNNN: New bug synopsis +# +#--disable_warnings +#drop procedure if exists bugNNNN| +#--enable_warnings +#create procedure bugNNNN... + +delimiter ;| |