diff options
author | unknown <jimw@mysql.com> | 2005-03-29 17:17:46 -0800 |
---|---|---|
committer | unknown <jimw@mysql.com> | 2005-03-29 17:17:46 -0800 |
commit | 529f29379057d49abce56ee7bc18c3d326d09fc4 (patch) | |
tree | 5b4f57966d1a1dbc9789a2b148b4ad4a01328ceb /mysql-test/t/ps_grant.test | |
parent | 23105dba56bd0ac01d6d0c0871b361c4e7b648d8 (diff) | |
download | mariadb-git-529f29379057d49abce56ee7bc18c3d326d09fc4.tar.gz |
Eliminate most of the remaining hardcoded list of tests to skip
by adding check for embedded server within tests and splitting some
tests into multiple test files.
mysql-test/mysql-test-run.sh:
Remove most of hardcoded list of tests to skip
mysql-test/r/ps_1general.result:
Update results
mysql-test/r/timezone2.result:
Update results
mysql-test/r/user_var.result:
Update results
mysql-test/r/variables.result:
Update results
mysql-test/t/mix_innodb_myisam_binlog.test:
Disable test with embedded server
mysql-test/t/mysql_protocols.test:
Disable test with embedded server
mysql-test/t/mysqlbinlog.test:
Disable test with embedded server
mysql-test/t/mysqlbinlog2.test:
Disable test with embedded server
mysql-test/t/mysqldump.test:
Disable test with embedded server
mysql-test/t/packet.test:
Disable test with embedded server
mysql-test/t/ps_1general.test:
Move parts of test to new ps_grant
mysql-test/t/rename.test:
Disable test with embedded server
mysql-test/t/show_check.test:
Disable test with embedded server
mysql-test/t/system_mysql_db_fix.test:
Disable test with embedded server
mysql-test/t/timezone2.test:
Move part of test to timezone_grant
mysql-test/t/user_var.test:
Move part of test to new user_var-binlog
mysql-test/t/variables.test:
Move part of test to rpl_variables
Diffstat (limited to 'mysql-test/t/ps_grant.test')
-rw-r--r-- | mysql-test/t/ps_grant.test | 120 |
1 files changed, 120 insertions, 0 deletions
diff --git a/mysql-test/t/ps_grant.test b/mysql-test/t/ps_grant.test new file mode 100644 index 00000000000..283c06c9a8c --- /dev/null +++ b/mysql-test/t/ps_grant.test @@ -0,0 +1,120 @@ +# Can't test grants with embedded server +-- source include/not_embedded.inc + +# Tested here simply so it is not tested with embedded server +prepare stmt4 from ' show full processlist '; +--replace_column 1 number 6 time 3 localhost +execute stmt4; + +let $type= 'MYISAM' ; + +################ GRANT/REVOKE/DROP affecting a parallel session ################ +--disable_query_log +select '------ grant/revoke/drop affects a parallel session test ------' + as test_sequence ; +--enable_query_log + +#---------------------------------------------------------------------# +# Here we test that: +# 1. A new GRANT will be visible within another sessions. # +# # +# Let's assume there is a parallel session with an already prepared # +# statement for a table. # +# A DROP TABLE will affect the EXECUTE properties. # +# A REVOKE will affect the EXECUTE properties. # +#---------------------------------------------------------------------# + +# Who am I ? +# this is different across different systems: +# select current_user(), user() ; + +#### create a new user account #### +## There should be no grants for that non existing user +--error 1141 +show grants for second_user@localhost ; +## create a new user account by using GRANT statements on t9 +create database mysqltest; +# create the tables (t1 and t9) used in many tests +use mysqltest; +--disable_query_log +--source include/ps_create.inc +--source include/ps_renew.inc +--enable_query_log +eval use $DB; +grant usage on mysqltest.* to second_user@localhost +identified by 'looser' ; +grant select on mysqltest.t9 to second_user@localhost +identified by 'looser' ; +show grants for second_user@localhost ; + + +#### establish a second session to the new user account +connect (con3,localhost,second_user,looser,mysqltest); +## switch to the second session +connection con3; +# Who am I ? +select current_user(); +## check the access rights +show grants for current_user(); +prepare s_t9 from 'select c1 as my_col + from t9 where c1= 1' ; +execute s_t9 ; +# check that we cannot do a SELECT on the table t1; +--error 1142 +select a as my_col from t1; + + +#### give access rights to t1 and drop table t9 +## switch back to the first session +connection default; +grant select on mysqltest.t1 to second_user@localhost +identified by 'looser' ; +show grants for second_user@localhost ; +drop table mysqltest.t9 ; +show grants for second_user@localhost ; + + +#### check the access as new user +## switch to the second session +connection con3; +######## Question 1: The table t1 should be now accessible. ######## +show grants for second_user@localhost ; +prepare s_t1 from 'select a as my_col from t1' ; +execute s_t1 ; +######## Question 2: The table t9 does not exist. ######## +--error 1146 +execute s_t9 ; + + +#### revoke the access rights to t1 +## switch back to the first session +connection default; +revoke all privileges on mysqltest.t1 from second_user@localhost +identified by 'looser' ; +show grants for second_user@localhost ; + +#### check the access as new user +## switch to the second session +connection con3; +show grants for second_user@localhost ; +######## Question 2: The table t1 should be now not accessible. ######## +--error 1142 +execute s_t1 ; + +## cleanup +## switch back to the first session +connection default; +## disconnect the second session +disconnect con3 ; +## remove all rights of second_user@localhost +revoke all privileges, grant option from second_user@localhost ; +show grants for second_user@localhost ; +drop user second_user@localhost ; +commit ; +--error 1141 +show grants for second_user@localhost ; + +drop table t1,t9 ; +drop database mysqltest; + + |