diff options
author | unknown <bell@sanja.is.com.ua> | 2005-06-23 18:29:10 +0300 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2005-06-23 18:29:10 +0300 |
commit | a5e742fedd4324d29867a15a6cabb54959108fbb (patch) | |
tree | c77bf7e6fffbe90308dfb1d0b58b5d2d64ffba2b /mysql-test/t/sp-security.test | |
parent | 6487eb814ff3d162a70ff6d4d90c442256a931dd (diff) | |
download | mariadb-git-a5e742fedd4324d29867a15a6cabb54959108fbb.tar.gz |
fixed environment restoring in case of error during SP function execution (BUG#9503)
#define macro improvement
mysql-test/r/sp-security.result:
BUG#9503: reseting correct parameters of thread after error in SP function
mysql-test/t/sp-security.test:
BUG#9503: reseting correct parameters of thread after error in SP function
sql/item_func.cc:
fixed environment restoring in case of error during SP function execution
sql/protocol.cc:
added debug print
sql/sql_class.h:
fixed #defines to force them to be alvaise in piar, and variable name made more complex for accident repeating in other code
Diffstat (limited to 'mysql-test/t/sp-security.test')
-rw-r--r-- | mysql-test/t/sp-security.test | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/mysql-test/t/sp-security.test b/mysql-test/t/sp-security.test index e1d8043ccda..72fe6c332bf 100644 --- a/mysql-test/t/sp-security.test +++ b/mysql-test/t/sp-security.test @@ -304,3 +304,39 @@ drop database sptest; delete from mysql.user where user='usera' or user='userb' or user='userc'; delete from mysql.procs_priv where user='usera' or user='userb' or user='userc'; +# +# BUG#9503: reseting correct parameters of thread after error in SP function +# +connect (root,localhost,root,,test); +connection root; + +--disable_warnings +drop function if exists bug_9503; +--enable_warnings +delimiter //; +create database mysqltest// +use mysqltest// +create table t1 (s1 int)// +grant select on t1 to user1@localhost// +create function bug_9503 () returns int sql security invoker begin declare v int; +select min(s1) into v from t1; return v; end// +delimiter ;// + +connect (user1,localhost,user1,,test); +connection user1; +use mysqltest; +-- error 1370 +select bug_9503(); + +connection root; +grant execute on function bug_9503 to user1@localhost; + +connection user1; +do 1; +use test; + +connection root; +REVOKE ALL PRIVILEGES, GRANT OPTION FROM user1@localhost; +drop function bug_9503; +use test; +drop database mysqltest; |