summaryrefslogtreecommitdiff
path: root/mysql-test/t/sp-security.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t/sp-security.test')
-rw-r--r--mysql-test/t/sp-security.test19
1 files changed, 18 insertions, 1 deletions
diff --git a/mysql-test/t/sp-security.test b/mysql-test/t/sp-security.test
index a2079e91440..a5df4859d6b 100644
--- a/mysql-test/t/sp-security.test
+++ b/mysql-test/t/sp-security.test
@@ -7,13 +7,13 @@
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
-
connect (con1root,localhost,root,,);
connection con1root;
use test;
# Create user user1 with no particular access rights
+create user user1@localhost;
grant usage on *.* to user1@localhost;
flush privileges;
@@ -57,10 +57,13 @@ call stamp(1);
select * from t1;
select db();
+create user user1@'%';
grant execute on procedure db1_secret.stamp to user1@'%';
grant execute on function db1_secret.db to user1@'%';
+set sql_mode='';
grant execute on procedure db1_secret.stamp to ''@'%';
grant execute on function db1_secret.db to ''@'%';
+set sql_mode=default;
connect (con2user1,localhost,user1,,);
connect (con3anon,localhost,anon,,);
@@ -175,6 +178,7 @@ insert into t2 values (0);
grant usage on db2.* to user1@localhost;
grant select on db2.* to user1@localhost;
+create user user2@localhost;
grant usage on db2.* to user2@localhost;
grant select,insert,update,delete,create routine on db2.* to user2@localhost;
grant create routine on db2.* to user1@localhost;
@@ -263,8 +267,11 @@ flush privileges;
#
# Test the new security acls
#
+create user usera@localhost;
grant usage on *.* to usera@localhost;
+create user userb@localhost;
grant usage on *.* to userb@localhost;
+create user userc@localhost;
grant usage on *.* to userc@localhost;
create database sptest;
create table t1 ( u varchar(64), i int );
@@ -340,11 +347,13 @@ connection root;
--disable_warnings
drop function if exists bug_9503;
+drop user if exists user1@localhost;
--enable_warnings
delimiter //;
create database mysqltest//
use mysqltest//
create table t1 (s1 int)//
+create user user1@localhost//
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//
@@ -420,6 +429,7 @@ begin
end//
delimiter ;//
+create user mysqltest_1@localhost;
grant usage on *.* to mysqltest_1@localhost;
connect (n1,localhost,mysqltest_1,,information_schema,$MASTER_MYPORT,$MASTER_MYSOCK);
@@ -1040,3 +1050,10 @@ drop database mysqltest_db;
# Wait till all disconnects are completed
--source include/wait_until_count_sessions.inc
+set password=password('foobar');
+create procedure sp1() select 1;
+show grants;
+grant execute on procedure sp1 to current_user() identified by 'barfoo';
+show grants;
+drop procedure sp1;
+set password='';