Current Path : /home/usr.opt/mysql57/mysql-test/suite/x/r/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //home/usr.opt/mysql57/mysql-test/suite/x/r/connection_default_schema.result |
# ## Preamble # install plugin mysqlx soname "mysqlx.so"; call mtr.add_suppression("Plugin mysqlx reported: .Failed at SSL configuration: .SSL context is not usable without certificate and private key.."); call mtr.add_suppression("Plugin mysqlx reported: .SSL_CTX_load_verify_locations failed."); # ## Testcase prepare # call mtr.add_suppression("Plugin mysqlx reported: '.*: Unsuccessful login attempt"); CREATE DATABASE xdb; CREATE DATABASE ydb; CREATE USER 'user_with_access_to_xdb'@'%'; CREATE USER 'user_with_access_to_ydb'@'%'; GRANT SELECT ON xdb.* TO 'user_with_access_to_xdb'@'%'; GRANT SELECT ON ydb.* TO 'user_with_access_to_ydb'@'%'; # ## Testcase execute # # ## Test group 1. ## ## Authenticate using an account which has permissions ## to selected schema. # # Using MySQL client # Checking if requested schema was selected. IF(DATABASE()='xdb','Success','Failure') Success # Using mysqlxtest # Checking if requested schema was selected. RUN SELECT IF(DATABASE()='xdb','Success','Failure') IF(DATABASE()='xdb','Success','Failure') Success 0 rows affected Mysqlx.Ok { msg: "bye!" } ok # ## Test group 2. ## ## Authenticate using an account which has not permissions ## to selected schema. # # Using MySQL client # Checking if requested schema was selected. EXPECTED_ERROR_CODE(42000): Access denied for user 'user_with_access_to_xdb'@'%' to database 'ydb' # Using mysqlxtest # Checking if requested schema was selected. in main, line 0:ERROR: Access denied for user 'user_with_access_to_xdb'@'%' to database 'ydb' (EXPECTED_ERROR_CODE) not ok # ## Test group 3. ## ## Authenticate using plain X Protocol flows to schame that: ## ## * account has permissions ## * account has not permissions # connecting... active session is now 'non_roo_user' Login OK closing session non_roo_user Mysqlx.Ok { msg: "bye!" } switched to session default connecting... active session is now 'non_roo_user' Got expected error: Access denied for user 'user_with_access_to_ydb'@'%' to database 'xdb' (code 1044) aborting session non_roo_user switched to session default Mysqlx.Ok { msg: "bye!" } # ## Cleanup # DROP USER 'user_with_access_to_xdb'@'%'; DROP USER 'user_with_access_to_ydb'@'%'; DROP DATABASE xdb; DROP DATABASE ydb; UNINSTALL PLUGIN mysqlx;