~ubuntu-branches/ubuntu/precise/mysql-5.5/precise-201203300109

« back to all changes in this revision

Viewing changes to mysql-test/r/ps_grant.result

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2011-11-08 11:31:13 UTC
  • Revision ID: package-import@ubuntu.com-20111108113113-3ulw01fvi4vn8m25
Tags: upstream-5.5.17
ImportĀ upstreamĀ versionĀ 5.5.17

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
test_sequence
 
2
------ grant/revoke/drop affects a parallel session test ------
 
3
show grants for second_user@localhost ;
 
4
ERROR 42000: There is no such grant defined for user 'second_user' on host 'localhost'
 
5
create database mysqltest;
 
6
use mysqltest;
 
7
use test;
 
8
grant usage on mysqltest.* to second_user@localhost
 
9
identified by 'looser' ;
 
10
grant select on mysqltest.t9 to second_user@localhost
 
11
identified by 'looser' ;
 
12
show grants for second_user@localhost ;
 
13
Grants for second_user@localhost
 
14
GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
 
15
GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost'
 
16
select current_user();
 
17
current_user()
 
18
second_user@localhost
 
19
show grants for current_user();
 
20
Grants for second_user@localhost
 
21
GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
 
22
GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost'
 
23
prepare s_t9 from 'select c1 as my_col 
 
24
                                 from t9 where c1= 1' ;
 
25
execute s_t9 ;
 
26
my_col
 
27
1
 
28
select a as my_col from t1;
 
29
ERROR 42000: SELECT command denied to user 'second_user'@'localhost' for table 't1'
 
30
grant select on mysqltest.t1 to second_user@localhost
 
31
identified by 'looser' ;
 
32
show grants for second_user@localhost ;
 
33
Grants for second_user@localhost
 
34
GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
 
35
GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost'
 
36
GRANT SELECT ON `mysqltest`.`t1` TO 'second_user'@'localhost'
 
37
drop table mysqltest.t9 ;
 
38
show grants for second_user@localhost ;
 
39
Grants for second_user@localhost
 
40
GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
 
41
GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost'
 
42
GRANT SELECT ON `mysqltest`.`t1` TO 'second_user'@'localhost'
 
43
show grants for second_user@localhost ;
 
44
Grants for second_user@localhost
 
45
GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
 
46
GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost'
 
47
GRANT SELECT ON `mysqltest`.`t1` TO 'second_user'@'localhost'
 
48
prepare s_t1 from 'select a as my_col from t1' ;
 
49
execute s_t1 ;
 
50
my_col
 
51
1
 
52
2
 
53
3
 
54
4
 
55
execute s_t9 ;
 
56
ERROR 42S02: Table 'mysqltest.t9' doesn't exist
 
57
deallocate prepare s_t9;
 
58
revoke all privileges on mysqltest.t1 from second_user@localhost
 
59
identified by 'looser' ;
 
60
show grants for second_user@localhost ;
 
61
Grants for second_user@localhost
 
62
GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
 
63
GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost'
 
64
show grants for second_user@localhost ;
 
65
Grants for second_user@localhost
 
66
GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
 
67
GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost'
 
68
execute s_t1 ;
 
69
ERROR 42000: SELECT command denied to user 'second_user'@'localhost' for table 't1'
 
70
revoke all privileges, grant option from second_user@localhost ;
 
71
show grants for second_user@localhost ;
 
72
Grants for second_user@localhost
 
73
GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
 
74
drop user second_user@localhost ;
 
75
commit ;
 
76
show grants for second_user@localhost ;
 
77
ERROR 42000: There is no such grant defined for user 'second_user' on host 'localhost'
 
78
drop database mysqltest;
 
79
prepare stmt3 from ' grant all on test.t1 to drop_user@localhost
 
80
identified by ''looser'' ';
 
81
grant all on test.t1 to drop_user@localhost
 
82
identified by 'looser' ;
 
83
prepare stmt3 from ' revoke all privileges on test.t1 from 
 
84
drop_user@localhost ';
 
85
revoke all privileges on test.t1 from drop_user@localhost ;
 
86
prepare stmt3 from ' drop user drop_user@localhost ';
 
87
drop user drop_user@localhost;