diff --git a/mysql-test/main/change_user.result b/mysql-test/main/change_user.result index fa934fbf09a..c91522dc6ce 100644 --- a/mysql-test/main/change_user.result +++ b/mysql-test/main/change_user.result @@ -1,4 +1,6 @@ set global secure_auth=0; +Warnings: +Warning 1287 '@@secure_auth' is deprecated and will be removed in a future release create user test_nopw; grant select on test.* to test_nopw; create user test_oldpw identified by password "09301740536db389"; @@ -90,6 +92,8 @@ NULL FLUSH STATUS; Value of com_select did not change set global secure_auth=default; +Warnings: +Warning 1287 '@@secure_auth' is deprecated and will be removed in a future release set timestamp=unix_timestamp('2010-10-10 10:10:10'); select now(); now() diff --git a/mysql-test/main/connect.result b/mysql-test/main/connect.result index 74387168d98..6642b8a1c6e 100644 --- a/mysql-test/main/connect.result +++ b/mysql-test/main/connect.result @@ -1,4 +1,6 @@ SET global secure_auth=0; +Warnings: +Warning 1287 '@@secure_auth' is deprecated and will be removed in a future release connect con1,localhost,root,,mysql; show tables; Tables_in_mysql @@ -412,6 +414,8 @@ test test drop procedure p1; SET global secure_auth=default; +Warnings: +Warning 1287 '@@secure_auth' is deprecated and will be removed in a future release # # MDEV-19282: Log more specific warning with log_warnings=2 if # connection is aborted prior to authentication diff --git a/mysql-test/main/set_password.result b/mysql-test/main/set_password.result index a3d8683ee64..19ca628f1f7 100644 --- a/mysql-test/main/set_password.result +++ b/mysql-test/main/set_password.result @@ -1,4 +1,6 @@ set global secure_auth=0; +Warnings: +Warning 1287 '@@secure_auth' is deprecated and will be removed in a future release create user natauth@localhost identified via 'mysql_native_password' using '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29'; create user invalidauth@localhost identified via 'mysql_native_password' using 'invalid'; create user newpass@localhost identified by password '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29'; @@ -186,6 +188,8 @@ drop user natauth@localhost, newpass@localhost, newpassnat@localhost; drop user invalidauth@localhost, invalidpass@localhost, invalidpassnat@localhost,invalidmysql57auth@localhost; drop user oldauth@localhost, oldpass@localhost, oldpassold@localhost; set global secure_auth=default; +Warnings: +Warning 1287 '@@secure_auth' is deprecated and will be removed in a future release # switching from mysql.global_priv to mysql.user create user foo@localhost identified with mysql_native_password; update mysql.user set authentication_string=password('foo'), plugin='mysql_native_password' where user='foo' and host='localhost'; diff --git a/mysql-test/suite/sys_vars/r/old_passwords_func.result b/mysql-test/suite/sys_vars/r/old_passwords_func.result index 6bd060932a8..fb250eeb669 100644 --- a/mysql-test/suite/sys_vars/r/old_passwords_func.result +++ b/mysql-test/suite/sys_vars/r/old_passwords_func.result @@ -9,6 +9,8 @@ SET GLOBAL old_passwords = TRUE; SET SESSION old_passwords = TRUE; CREATE USER 'userOldPass'@'localhost' IDENTIFIED BY 'pass3'; SET GLOBAL secure_auth = FALSE; +Warnings: +Warning 1287 '@@secure_auth' is deprecated and will be removed in a future release connect con1,localhost,userNewPass1,pass1,; SELECT CURRENT_USER(); CURRENT_USER() @@ -30,6 +32,8 @@ disconnect con2; disconnect con3; '#------------------------FN_DYNVARS_115_02---------------------------#' SET GLOBAL secure_auth = TRUE; +Warnings: +Warning 1287 '@@secure_auth' is deprecated and will be removed in a future release connect con1,localhost,userNewPass1,pass1,; SELECT CURRENT_USER(); CURRENT_USER() @@ -55,3 +59,5 @@ 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; +Warnings: +Warning 1287 '@@secure_auth' is deprecated and will be removed in a future release diff --git a/mysql-test/suite/sys_vars/r/secure_auth_basic.result b/mysql-test/suite/sys_vars/r/secure_auth_basic.result index 35f283de278..66763fc5f8d 100644 --- a/mysql-test/suite/sys_vars/r/secure_auth_basic.result +++ b/mysql-test/suite/sys_vars/r/secure_auth_basic.result @@ -4,7 +4,11 @@ SELECT @global_start_value; 1 '#--------------------FN_DYNVARS_143_01------------------------#' SET @@global.secure_auth = 1; +Warnings: +Warning 1287 '@@secure_auth' is deprecated and will be removed in a future release SET @@global.secure_auth = DEFAULT; +Warnings: +Warning 1287 '@@secure_auth' is deprecated and will be removed in a future release SELECT @@global.secure_auth; @@global.secure_auth 1 @@ -17,15 +21,21 @@ SELECT @@secure_auth; SELECT global.secure_auth; ERROR 42S02: Unknown table 'global' in field list SET global secure_auth = 1; +Warnings: +Warning 1287 '@@secure_auth' is deprecated and will be removed in a future release SELECT @@global.secure_auth; @@global.secure_auth 1 '#--------------------FN_DYNVARS_143_03------------------------#' SET @@global.secure_auth = 0; +Warnings: +Warning 1287 '@@secure_auth' is deprecated and will be removed in a future release SELECT @@global.secure_auth; @@global.secure_auth 0 SET @@global.secure_auth = 1; +Warnings: +Warning 1287 '@@secure_auth' is deprecated and will be removed in a future release SELECT @@global.secure_auth; @@global.secure_auth 1 @@ -83,23 +93,33 @@ VARIABLE_VALUE ON '#---------------------FN_DYNVARS_143_08-------------------------#' SET @@global.secure_auth = OFF; +Warnings: +Warning 1287 '@@secure_auth' is deprecated and will be removed in a future release SELECT @@global.secure_auth; @@global.secure_auth 0 SET @@global.secure_auth = ON; +Warnings: +Warning 1287 '@@secure_auth' is deprecated and will be removed in a future release SELECT @@global.secure_auth; @@global.secure_auth 1 '#---------------------FN_DYNVARS_143_09----------------------#' SET @@global.secure_auth = TRUE; +Warnings: +Warning 1287 '@@secure_auth' is deprecated and will be removed in a future release SELECT @@global.secure_auth; @@global.secure_auth 1 SET @@global.secure_auth = FALSE; +Warnings: +Warning 1287 '@@secure_auth' is deprecated and will be removed in a future release SELECT @@global.secure_auth; @@global.secure_auth 0 SET @@global.secure_auth = @global_start_value; +Warnings: +Warning 1287 '@@secure_auth' is deprecated and will be removed in a future release SELECT @@global.secure_auth; @@global.secure_auth 1 diff --git a/mysql-test/suite/sys_vars/r/secure_auth_func.result b/mysql-test/suite/sys_vars/r/secure_auth_func.result index 97d22facd9d..ee0d6146225 100644 --- a/mysql-test/suite/sys_vars/r/secure_auth_func.result +++ b/mysql-test/suite/sys_vars/r/secure_auth_func.result @@ -8,6 +8,8 @@ SELECT @@GLOBAL.secure_auth; 1 / ON Expected '#--------------------FN_DYNVARS_144_02-------------------------#' SET GLOBAL secure_auth = OFF; +Warnings: +Warning 1287 '@@secure_auth' is deprecated and will be removed in a future release CREATE USER 'testUser'@'localhost' IDENTIFIED BY 'newpass'; connect con_user1,localhost,testUser,newpass,; connection default; @@ -16,6 +18,8 @@ connect con_user2,localhost,testUser,newpass,; connection default; '#--------------------FN_DYNVARS_144_03-------------------------#' SET GLOBAL secure_auth = ON; +Warnings: +Warning 1287 '@@secure_auth' is deprecated and will be removed in a future release SET PASSWORD FOR 'testUser'@'localhost' = PASSWORD('newpass'); connect con_user3,localhost,testUser,newpass,; connection default; @@ -27,6 +31,8 @@ SET PASSWORD FOR 'testUser'@'localhost' = PASSWORD('newpass'); connect con_user4,localhost,testUser,newpass,; connection default; SET GLOBAL secure_auth = @old_secure_auth; +Warnings: +Warning 1287 '@@secure_auth' is deprecated and will be removed in a future release disconnect con_user1; disconnect con_user2; disconnect con_user3; diff --git a/mysql-test/suite/sys_vars/r/secure_auth_grant.result b/mysql-test/suite/sys_vars/r/secure_auth_grant.result index ed33eb33951..ea4b1b09d54 100644 --- a/mysql-test/suite/sys_vars/r/secure_auth_grant.result +++ b/mysql-test/suite/sys_vars/r/secure_auth_grant.result @@ -23,6 +23,8 @@ GRANT CONNECTION ADMIN ON *.* TO user1@localhost; connect user1,localhost,user1,,; connection user1; SET GLOBAL secure_auth=1; +Warnings: +Warning 1287 '@@secure_auth' is deprecated and will be removed in a future release SET secure_auth=1; ERROR HY000: Variable 'secure_auth' is a GLOBAL variable and should be set with SET GLOBAL SET SESSION secure_auth=1; @@ -36,6 +38,8 @@ GRANT SUPER ON *.* TO user1@localhost; connect user1,localhost,user1,,; connection user1; SET GLOBAL secure_auth=1; +Warnings: +Warning 1287 '@@secure_auth' is deprecated and will be removed in a future release SET secure_auth=1; ERROR HY000: Variable 'secure_auth' is a GLOBAL variable and should be set with SET GLOBAL SET SESSION secure_auth=1; @@ -44,3 +48,5 @@ disconnect user1; connection default; DROP USER user1@localhost; SET @@global.secure_auth=@global; +Warnings: +Warning 1287 '@@secure_auth' is deprecated and will be removed in a future release diff --git a/sql/mysqld.cc b/sql/mysqld.cc index c0dd56ab3d5..9e2575511be 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -7978,6 +7978,9 @@ mysqld_get_one_option(const struct my_option *opt, const char *argument, test_flags= argument ? ((uint) atoi(argument) & ~TEST_BLOCKING) : 0; opt_endinfo=1; break; + case OPT_SECURE_AUTH: + WARN_DEPRECATED_NO_REPLACEMENT(NULL, "--secure-auth"); + break; case OPT_THREAD_CONCURRENCY: WARN_DEPRECATED_NO_REPLACEMENT(NULL, "THREAD_CONCURRENCY"); break; diff --git a/sql/mysqld.h b/sql/mysqld.h index fc8afa06638..25b99e873e6 100644 --- a/sql/mysqld.h +++ b/sql/mysqld.h @@ -828,7 +828,7 @@ enum options_mysqld OPT_WSREP_SYNC_WAIT, #endif /* WITH_WSREP */ OPT_MYSQL_COMPATIBILITY, - OPT_TLS_VERSION, + OPT_TLS_VERSION, OPT_SECURE_AUTH, OPT_MYSQL_TO_BE_IMPLEMENTED, OPT_which_is_always_the_last }; diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 6e84d51a578..34a8d7e3fe0 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -3226,8 +3226,9 @@ Sys_secure_auth( "secure_auth", "Disallow authentication for accounts that have old (pre-4.1) " "passwords", - GLOBAL_VAR(opt_secure_auth), CMD_LINE(OPT_ARG), - DEFAULT(TRUE)); + GLOBAL_VAR(opt_secure_auth), CMD_LINE(OPT_ARG, OPT_SECURE_AUTH), + DEFAULT(TRUE), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(0), + DEPRECATED("")); // since 10.6.17 static bool check_require_secure_transport(sys_var *self, THD *thd, set_var *var) {