############# mysql-test\t\old_passwords_func.test ############################ # # # Variable Name: old_passwords # # Scope: GLOBAL & SESSION # # Access Type: Dynamic # # Data Type: BOOLEAN # # Default Value: FALSE # # Values: TRUE, FALSE # # # # # # Creation Date: 2008-03-12 # # Author: Sharique Abdullah # # # # Description: Test Cases of Dynamic System Variable "old_passwords" # # that checks behavior of this variable in the following ways # # * Functionality based on different values # # # # Reference: http://dev.mysql.com/doc/refman/5.0/en # # /server-options.html#option_mysqld_old-passwords # # # ############################################################################### # # Setup # --source include/not_embedded.inc SET @global_old_passwords = @@GLOBAL.old_passwords; SET @session_old_passwords = @@SESSION.old_passwords; SET @global_secure_auth = @@GLOBAL.secure_auth; --echo '#------------------------FN_DYNVARS_115_01---------------------------#' connection default; # # 2 Users with FALSE value # CREATE USER 'userNewPass1'@'localhost' IDENTIFIED BY 'pass1'; CREATE USER 'userNewPass2'@'localhost' IDENTIFIED BY 'pass2'; SET GLOBAL old_passwords = TRUE; SET SESSION old_passwords = TRUE; # # 1 User with TRUE value # CREATE USER 'userOldPass'@'localhost' IDENTIFIED BY 'pass3'; SET GLOBAL secure_auth = FALSE; connect (con1,localhost,userNewPass1,pass1,); SELECT CURRENT_USER(); --echo userNewPass1@localhost Expected connect (con2,localhost,userNewPass2,pass2,); SELECT CURRENT_USER(); --echo userNewPass2@localhost Expected --replace_result $MASTER_MYSOCK MASTER_MYSOCK $MASTER_MYPORT MASTER_MYPORT --error 5010 connect con3,localhost,userOldPass,pass3; connect con3,localhost,userOldPass,pass3,,,,auth=mysql_old_password:mysql_native_password; SELECT CURRENT_USER(); --echo userOldPass@localhost Expected connection default; disconnect con1; disconnect con2; disconnect con3; --echo '#------------------------FN_DYNVARS_115_02---------------------------#' SET GLOBAL secure_auth = TRUE; connect (con1,localhost,userNewPass1,pass1,); SELECT CURRENT_USER(); --echo userNewPass1@localhost Expected connect (con2,localhost,userNewPass2,pass2,); SELECT CURRENT_USER(); --echo userNewPass2@localhost Expected --disable_query_log --error ER_SERVER_IS_IN_SECURE_AUTH_MODE connect (con3,localhost,userOldPass,pass3,); --enable_query_log --echo Expected Error 'Server is running in secure auth mode' SELECT CURRENT_USER(); --echo userNewPass2@localhost Expected connection default; disconnect con1; disconnect con2; # # Cleanup # DROP USER 'userNewPass1'@'localhost'; DROP USER 'userNewPass2'@'localhost'; DROP USER 'userOldPass'@'localhost'; SET @@GLOBAL.old_passwords = @global_old_passwords; SET @@SESSION.old_passwords = @session_old_passwords; SET @@GLOBAL.secure_auth = @global_secure_auth;