diff options
author | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2010-08-09 11:32:50 +0300 |
---|---|---|
committer | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2010-08-09 11:32:50 +0300 |
commit | 97057115962d9dfbe989c799cff089aec5cbcc60 (patch) | |
tree | 55fa1ceccae107e55c0295dfe2174d04d41583fb /mysql-test/suite/funcs_1/t/is_user_privileges.test | |
parent | 81906cdf3805fe5fcea47fef11945f9adbcef4d8 (diff) | |
download | mariadb-git-97057115962d9dfbe989c799cff089aec5cbcc60.tar.gz |
WL#1054: Pluggable authentication support
Merged the implementation to a new base tree.
Diffstat (limited to 'mysql-test/suite/funcs_1/t/is_user_privileges.test')
-rw-r--r-- | mysql-test/suite/funcs_1/t/is_user_privileges.test | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/mysql-test/suite/funcs_1/t/is_user_privileges.test b/mysql-test/suite/funcs_1/t/is_user_privileges.test index 253323af9a7..0f0e398d75b 100644 --- a/mysql-test/suite/funcs_1/t/is_user_privileges.test +++ b/mysql-test/suite/funcs_1/t/is_user_privileges.test @@ -104,20 +104,26 @@ ORDER BY grantee, table_catalog, privilege_type; let $my_select2= SELECT * FROM mysql.user WHERE user LIKE 'testuser%' ORDER BY host, user; let $my_show= SHOW GRANTS; +--vertical_results eval $my_select1; eval $my_select2; +--horizontal_results --echo # --echo # Add GRANT OPTION db_datadict.* to testuser1; GRANT UPDATE ON db_datadict.* TO 'testuser1'@'localhost' WITH GRANT OPTION; +--vertical_results eval $my_select1; eval $my_select2; +--horizontal_results --echo # Establish connection testuser1 (user=testuser1) --replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK connect (testuser1, localhost, testuser1, , db_datadict); +--vertical_results eval $my_select1; eval $my_select2; +--horizontal_results eval $my_show; --echo @@ -128,36 +134,46 @@ connection default; GRANT SELECT ON *.* TO 'testuser1'@'localhost'; --echo # --echo # Here <SELECT NO> is shown correctly for testuser1; +--vertical_results eval $my_select1; eval $my_select2; +--horizontal_results GRANT SELECT ON *.* TO 'testuser1'@'localhost' WITH GRANT OPTION; --echo # --echo # Here <SELECT YES> is shown correctly for testuser1; +--vertical_results eval $my_select1; eval $my_select2; +--horizontal_results --echo # Switch to connection testuser1 # check that this appears connection testuser1; +--vertical_results eval $my_select1; eval $my_select2; +--horizontal_results eval $my_show; --echo # Establish connection testuser2 (user=testuser2) --replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK connect (testuser2, localhost, testuser2, , db_datadict); +--vertical_results eval $my_select1; --error ER_TABLEACCESS_DENIED_ERROR eval $my_select2; +--horizontal_results eval $my_show; --echo # Establish connection testuser3 (user=testuser3) --replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK connect (testuser3, localhost, testuser3, , test); +--vertical_results eval $my_select1; --error ER_TABLEACCESS_DENIED_ERROR eval $my_select2; +--horizontal_results eval $my_show; --echo @@ -165,23 +181,29 @@ eval $my_show; --echo # Switch to connection default connection default; REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'testuser1'@'localhost'; +--vertical_results eval $my_select1; eval $my_select2; +--horizontal_results --echo # Switch to connection testuser1 # check for changes connection testuser1; +--vertical_results eval $my_select1; --error ER_TABLEACCESS_DENIED_ERROR eval $my_select2; +--horizontal_results eval $my_show; # OK, testuser1 has no privs here --error ER_TABLEACCESS_DENIED_ERROR CREATE TABLE db_datadict.tb_55 ( c1 TEXT ); +--vertical_results eval $my_select1; --error ER_TABLEACCESS_DENIED_ERROR eval $my_select2; +--horizontal_results eval $my_show; # OK, testuser1 has no privs here --error ER_TABLEACCESS_DENIED_ERROR @@ -193,13 +215,17 @@ CREATE TABLE db_datadict.tb_66 ( c1 TEXT ); connection default; GRANT ALL ON db_datadict.* TO 'testuser1'@'localhost' WITH GRANT OPTION; GRANT SELECT ON mysql.user TO 'testuser1'@'localhost'; +--vertical_results eval $my_select1; eval $my_select2; +--horizontal_results --echo # Switch to connection testuser1 connection testuser1; +--vertical_results eval $my_select1; eval $my_select2; +--horizontal_results eval $my_show; # OK, testuser1 has no privs here @@ -208,8 +234,10 @@ CREATE TABLE db_datadict.tb_56 ( c1 TEXT ); # using 'USE' lets the server read the privileges new, so now the CREATE works USE db_datadict; +--vertical_results eval $my_select1; eval $my_select2; +--horizontal_results eval $my_show; --replace_result $other_engine_type <other_engine_type> eval @@ -221,15 +249,19 @@ ENGINE = $other_engine_type; --echo # Switch to connection default connection default; REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'testuser1'@'localhost'; +--vertical_results eval $my_select1; eval $my_select2; +--horizontal_results --echo # Switch to connection testuser1 # check for changes connection testuser1; +--vertical_results eval $my_select1; --error ER_TABLEACCESS_DENIED_ERROR eval $my_select2; +--horizontal_results eval $my_show; # WORKS, as the existing old privileges are used! --replace_result $other_engine_type <other_engine_type> @@ -273,19 +305,27 @@ DROP DATABASE IF EXISTS db_datadict; let $my_select = SELECT * FROM information_schema.user_privileges WHERE grantee = '''testuser1''@''localhost'''; let $my_show = SHOW GRANTS FOR 'testuser1'@'localhost'; +--vertical_results eval $my_select; +--horizontal_results --error ER_NONEXISTING_GRANT eval $my_show; --error 0,ER_CANNOT_USER DROP USER 'testuser1'@'localhost'; CREATE USER 'testuser1'@'localhost'; +--vertical_results eval $my_select; +--horizontal_results eval $my_show; GRANT SELECT, FILE ON *.* TO 'testuser1'@'localhost'; +--vertical_results eval $my_select; +--horizontal_results eval $my_show; DROP USER 'testuser1'@'localhost'; +--vertical_results eval $my_select; +--horizontal_results --error ER_NONEXISTING_GRANT eval $my_show; |