Debian Codegraph @

mysql-test/suite/sys_vars/inc/sysvar_session_grant.inc

raw
1 --source include/not_embedded.inc
2
3
4 --eval SET @session=@@session.$var
5
6 --echo # Test that "SET $var" is not allowed without $grant
7
8 CREATE USER user1@localhost;
9 GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
10 --eval REVOKE $grant ON *.* FROM user1@localhost
11 --connect(user1,localhost,user1,,)
12 --connection user1
13 --error ER_LOCAL_VARIABLE
14 --eval SET GLOBAL $var=$value
15 --error ER_SPECIFIC_ACCESS_DENIED_ERROR
16 --eval SET $var=$value
17 --error ER_SPECIFIC_ACCESS_DENIED_ERROR
18 --eval SET SESSION $var=$value
19 --disconnect user1
20 --connection default
21 DROP USER user1@localhost;
22
23 --echo # Test that "SET $var" is allowed with $grant
24
25 CREATE USER user1@localhost;
26 --eval GRANT $grant ON *.* TO user1@localhost
27 --connect(user1,localhost,user1,,)
28 --connection user1
29 --error ER_LOCAL_VARIABLE
30 --eval SET GLOBAL $var=$value
31 --eval SET $var=$value
32 --eval SET SESSION $var=$value
33 --disconnect user1
34 --connection default
35 DROP USER user1@localhost;
36
37 --eval SET @@session.$var=@session