From 728371c56e3e0a3f421425a9db9e5bab289670cc Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Jun 2006 15:50:44 +0500 Subject: Bug#15298 SHOW GRANTS FOR CURRENT_USER: Incorrect output in DEFINER context user name is calculated on function execution stage instead of parse stage mysql-test/r/sp_notembedded.result: Bug#15298 SHOW GRANTS FOR CURRENT_USER: Incorrect output in DEFINER context test case mysql-test/t/sp_notembedded.test: Bug#15298 SHOW GRANTS FOR CURRENT_USER: Incorrect output in DEFINER context test case sql/mysql_priv.h: Bug#15298 SHOW GRANTS FOR CURRENT_USER: Incorrect output in DEFINER context new get_current_user(THD *thd, LEX_USER *user) function sql/sql_acl.cc: Bug#15298 SHOW GRANTS FOR CURRENT_USER: Incorrect output in DEFINER context user name is calculated using get_current_user() function sql/sql_parse.cc: Bug#15298 SHOW GRANTS FOR CURRENT_USER: Incorrect output in DEFINER context new get_current_user() function user name is calculated using get_current_user() function sql/sql_yacc.yy: Bug#15298 SHOW GRANTS FOR CURRENT_USER: Incorrect output in DEFINER context empty LEX_USER struct for CURRENT USER, user name is calculated on function execution stage --- mysql-test/t/sp_notembedded.test | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'mysql-test/t/sp_notembedded.test') diff --git a/mysql-test/t/sp_notembedded.test b/mysql-test/t/sp_notembedded.test index 0adbeb2d98b..b087f699f86 100644 --- a/mysql-test/t/sp_notembedded.test +++ b/mysql-test/t/sp_notembedded.test @@ -265,3 +265,23 @@ drop view v1| drop table t3| delimiter ;| + +# +# Bug#15298 SHOW GRANTS FOR CURRENT_USER: Incorrect output in DEFINER context +# +--disable_warnings +drop procedure if exists bug15298_1; +drop procedure if exists bug15298_2; +--enable_warnings +grant all privileges on test.* to 'mysqltest_1'@'localhost'; +create procedure 15298_1 () sql security definer show grants for current_user; +create procedure 15298_2 () sql security definer show grants; + +connect (con1,localhost,mysqltest_1,,test); +call 15298_1(); +call 15298_2(); + +connection default; +drop user mysqltest_1@localhost; +drop procedure 15298_1; +drop procedure 15298_2; -- cgit v1.2.1