Current Path : /home/usr.opt/mysql57/mysql-test/t/ |
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/t/plugin_auth_qa.test |
# The numbers represent test cases of the test plan. --source include/have_plugin_auth.inc --source include/not_embedded.inc CREATE DATABASE test_user_db; --source include/plugin_auth_check_non_default_users.inc --echo ========== test 1.1 ====================================================== # without '', without AS part CREATE USER plug IDENTIFIED WITH test_plugin_server; --source include/plugin_auth_check_non_default_users.inc DROP USER plug; GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server BY '123'; --source include/plugin_auth_check_non_default_users.inc REVOKE ALL PRIVILEGES ON test_user_db.* FROM plug; DROP USER plug; # with '', without AS part CREATE USER plug IDENTIFIED WITH 'test_plugin_server'; --source include/plugin_auth_check_non_default_users.inc DROP USER plug; GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' BY '123'; --source include/plugin_auth_check_non_default_users.inc REVOKE ALL PRIVILEGES ON test_user_db.* FROM plug; DROP USER plug; # without '', AS part empty CREATE USER plug IDENTIFIED WITH test_plugin_server AS ''; --source include/plugin_auth_check_non_default_users.inc DROP USER plug; --error 1133 GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS ''; # with '', AS part empty without '' --error ER_PARSE_ERROR CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS ; --error ER_PARSE_ERROR GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS; # without '', AS part without '' --error ER_PARSE_ERROR CREATE USER plug IDENTIFIED WITH test_plugin_server AS plug_dest; --error ER_PARSE_ERROR GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS plug_dest; --echo ========== test 1.1 syntax errors ======================================== # without auth_name --error ER_PARSE_ERROR CREATE USER plug IDENTIFIED WITH AS plug_dest; --error ER_PARSE_ERROR GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH AS plug_dest; # without auth_name and AS part --error ER_PARSE_ERROR CREATE USER plug IDENTIFIED WITH; --error ER_PARSE_ERROR GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH; # without auth_name but AS part --error ER_PARSE_ERROR CREATE USER plug IDENTIFIED AS ''; --error ER_PARSE_ERROR GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED AS ''; # with 2 auth_name parts --error ER_PARSE_ERROR CREATE USER plug IDENTIFIED WITH 'test_plugin_server' IDENTIFIED WITH 'test_plugin_server'; --error ER_PARSE_ERROR GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' IDENTIFIED WITH 'test_plugin_server'; # with 2 AS parts --error ER_PARSE_ERROR CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS '' AS 'plug_dest'; --error ER_PARSE_ERROR GRANT ALL PRIVILEGES ON test_user_db.* TO plug AS '' AS 'plug_dest'; # with 2 complete WITH parts --error ER_PARSE_ERROR CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS '' IDENTIFIED WITH test_plugin_server AS 'plug_dest'; --error ER_PARSE_ERROR GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS '' IDENTIFIED WITH test_plugin_server AS 'plug_dest'; # with BY and WITH part --error ER_PARSE_ERROR CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd' IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; --error ER_PARSE_ERROR GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED BY 'plug_dest_passwd' IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; # with WITH part and BY part --error ER_PARSE_ERROR CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest' USER plug_dest IDENTIFIED by 'plug_dest_pwd'; --error ER_PARSE_ERROR GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest' USER plug_dest IDENTIFIED by 'plug_dest_pwd'; # with WITH part and BY part --error ER_PARSE_ERROR CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest' plug_dest IDENTIFIED by 'plug_dest_pwd'; --error ER_PARSE_ERROR GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest' plug_dest IDENTIFIED by 'plug_dest_pwd'; # with WITH part and BY part --error ER_PARSE_ERROR CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest' IDENTIFIED by 'plug_dest_pwd'; --error ER_PARSE_ERROR GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest' IDENTIFIED by 'plug_dest_pwd'; --echo ========== test 1.1 combinations ========================== # CREATE...WITH/CREATE...BY CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; --echo ========== test 1.1.1.6/1.1.2.5 ============================ --source include/plugin_auth_check_non_default_users.inc CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; --source include/plugin_auth_check_non_default_users.inc DROP USER plug, plug_dest; # CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; --source include/plugin_auth_check_non_default_users.inc DROP USER plug; CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; --source include/plugin_auth_check_non_default_users.inc DROP USER plug_dest; # GRANT...WITH/CREATE...BY GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; --source include/plugin_auth_check_non_default_users.inc CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; --source include/plugin_auth_check_non_default_users.inc DROP USER plug, plug_dest; # GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS 'plug_dest'; --source include/plugin_auth_check_non_default_users.inc DROP USER plug; CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; --source include/plugin_auth_check_non_default_users.inc DROP USER plug_dest; # CREATE...WITH/GRANT...BY CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; --source include/plugin_auth_check_non_default_users.inc GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_dest_passwd'; --source include/plugin_auth_check_non_default_users.inc DROP USER plug, plug_dest; # CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; --source include/plugin_auth_check_non_default_users.inc DROP USER plug; GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_dest_passwd'; --source include/plugin_auth_check_non_default_users.inc DROP USER plug_dest; # CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; --echo GRANT IDENTIFIED WITH for existing users is now allowed GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; --echo GRANT IDENTIFIED WITH for existing users is now allowed GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server'; DROP USER plug; # GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS 'plug_dest'; --error ER_CANNOT_USER CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; --error ER_CANNOT_USER CREATE USER plug IDENTIFIED WITH 'test_plugin_server'; DROP USER plug; # CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; --source include/plugin_auth_check_non_default_users.inc GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED BY 'plug_dest_passwd'; --source include/plugin_auth_check_non_default_users.inc DROP USER plug; # GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS 'plug_dest'; --error ER_CANNOT_USER CREATE USER plug IDENTIFIED BY 'plug_dest_passwd'; DROP USER plug; # CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; CREATE USER plug_dest IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; --source include/plugin_auth_check_non_default_users.inc DROP USER plug,plug_dest; # CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; --source include/plugin_auth_check_non_default_users.inc GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED WITH test_plugin_server AS 'plug_dest'; --source include/plugin_auth_check_non_default_users.inc DROP USER plug,plug_dest; # --echo ========== test 1.1.1.1/1.1.2.1/1.1.1.5 ==================== SET NAMES utf8; # CREATE USER plüg IDENTIFIED WITH 'test_plugin_server' AS 'plüg_dest'; --source include/plugin_auth_check_non_default_users.inc DROP USER plüg; CREATE USER plüg_dest IDENTIFIED BY 'plug_dest_passwd'; --source include/plugin_auth_check_non_default_users.inc DROP USER plüg_dest; SET NAMES ascii; # CREATE USER 'plüg' IDENTIFIED WITH 'test_plugin_server' AS 'plüg_dest'; --source include/plugin_auth_check_non_default_users.inc DROP USER 'plüg'; CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd'; --source include/plugin_auth_check_non_default_users.inc DROP USER 'plüg_dest'; SET NAMES latin1; # --echo ========== test 1.1.1.5 ==================================== --error ER_PLUGIN_IS_NOT_LOADED CREATE USER 'plüg' IDENTIFIED WITH 'test_plügin_server' AS 'plüg_dest'; CREATE USER 'plug' IDENTIFIED WITH 'test_plugin_server' AS 'plüg_dest'; --source include/plugin_auth_check_non_default_users.inc DROP USER 'plug'; CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd'; --source include/plugin_auth_check_non_default_users.inc DROP USER 'plüg_dest'; SET NAMES utf8; # --error ER_PLUGIN_IS_NOT_LOADED CREATE USER plüg IDENTIFIED WITH 'test_plügin_server' AS 'plüg_dest'; CREATE USER 'plüg' IDENTIFIED WITH 'test_plugin_server' AS 'plüg_dest'; --source include/plugin_auth_check_non_default_users.inc DROP USER 'plüg'; CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd'; --source include/plugin_auth_check_non_default_users.inc DROP USER 'plüg_dest'; CREATE USER plüg IDENTIFIED WITH test_plugin_server AS 'plüg_dest'; --source include/plugin_auth_check_non_default_users.inc DROP USER plüg; CREATE USER plüg_dest IDENTIFIED BY 'plug_dest_passwd'; --source include/plugin_auth_check_non_default_users.inc DROP USER plüg_dest; --echo ========== test 1.1.1.2/1.1.2.2============================= SET @auth_name= 'test_plugin_server'; --error ER_PARSE_ERROR CREATE USER plug IDENTIFIED WITH @auth_name AS 'plug_dest'; SET @auth_string= 'plug_dest'; --error ER_PARSE_ERROR CREATE USER plug IDENTIFIED WITH test_plugin_server AS @auth_string; --echo ========== test 1.1.1.3/1.1.2.3============================= --error ER_PLUGIN_IS_NOT_LOADED CREATE USER plug IDENTIFIED WITH 'hh''s_test_plugin_server' AS 'plug_dest'; CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'hh''s_plug_dest'; --source include/plugin_auth_check_non_default_users.inc DROP USER plug; CREATE USER 'hh''s_plug_dest' IDENTIFIED BY 'plug_dest_passwd'; --source include/plugin_auth_check_non_default_users.inc DROP USER 'hh''s_plug_dest'; --echo ========== test 1.1.1.4 ==================================== --error ER_PARSE_ERROR CREATE USER plug IDENTIFIED WITH hh''s_test_plugin_server AS 'plug_dest'; --echo ========== test 1.1.3.1 ==================================== GRANT INSERT ON test_user_db.* TO grant_user IDENTIFIED WITH test_plugin_server AS 'plug_dest'; --source include/plugin_auth_check_non_default_users.inc CREATE USER plug_dest; DROP USER plug_dest; set @orig_sql_mode = @@sql_mode; set sql_mode=(select replace(@@sql_mode,'NO_AUTO_CREATE_USER','')); GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest; set sql_mode= @orig_sql_mode; --source include/plugin_auth_check_non_default_users.inc DROP USER grant_user,plug_dest; # set @save_sql_mode= @@sql_mode; SET @@sql_mode=no_auto_create_user; GRANT INSERT ON test_user_db.* TO grant_user IDENTIFIED WITH test_plugin_server AS 'plug_dest'; --source include/plugin_auth_check_non_default_users.inc CREATE USER plug_dest; DROP USER plug_dest; --error ER_PASSWORD_NO_MATCH GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest; DROP USER grant_user; # GRANT INSERT ON test_user_db.* TO grant_user IDENTIFIED WITH test_plugin_server AS 'plug_dest'; --source include/plugin_auth_check_non_default_users.inc CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; --source include/plugin_auth_check_non_default_users.inc DROP USER plug_dest; GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_user_passwd'; --source include/plugin_auth_check_non_default_users.inc DROP USER grant_user,plug_dest; # DROP DATABASE test_user_db; --exit