summaryrefslogtreecommitdiff
path: root/mysql-test/main/mysql_upgrade.test
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2019-01-09 20:24:34 +0100
committerSergei Golubchik <serg@mariadb.org>2019-02-04 15:54:10 +0100
commit3ab445819e622fb5e09baf2153db26d10f2c8a29 (patch)
tree2a881338203db5b1ad9a5d2d84340f789488d095 /mysql-test/main/mysql_upgrade.test
parenteeaaf4a845268fe13c05a0cef4e79722d5835958 (diff)
downloadmariadb-git-3ab445819e622fb5e09baf2153db26d10f2c8a29.tar.gz
MDEV-18119 upgrading from 10.3 to 10.4 can result in the password for a user to be wiped ou
Diffstat (limited to 'mysql-test/main/mysql_upgrade.test')
-rw-r--r--mysql-test/main/mysql_upgrade.test35
1 files changed, 30 insertions, 5 deletions
diff --git a/mysql-test/main/mysql_upgrade.test b/mysql-test/main/mysql_upgrade.test
index d4a3d864c21..9ed39aa5d32 100644
--- a/mysql-test/main/mysql_upgrade.test
+++ b/mysql-test/main/mysql_upgrade.test
@@ -106,8 +106,7 @@ SHOW GRANTS FOR 'user3'@'%';
DROP USER 'user3'@'%';
---echo End of 5.1 tests
-
+--echo # End of 5.1 tests
#
# Test the --upgrade-system-tables option
@@ -192,7 +191,7 @@ create table extralongname_extralongname_extralongname_extralongname_ext (
select length(table_name) from mysql.innodb_table_stats;
drop table extralongname_extralongname_extralongname_extralongname_ext;
---echo End of 10.0 tests
+--echo # End of 10.0 tests
set sql_mode=default;
@@ -218,9 +217,9 @@ DROP TABLE test.t1;
--remove_file $MYSQLD_DATADIR/mysql_upgrade_info
SET GLOBAL enforce_storage_engine=NULL;
---echo End of 10.1 tests
+--echo # End of 10.1 tests
---echo Start of 10.3 tests
+--echo # End of 10.2 tests
--echo #
--echo # Ensure that mysql_upgrade correctly sets truncate_versioning_priv
@@ -244,3 +243,29 @@ DROP USER 'user3'@'%';
update mysql.db set Delete_history_priv='Y' where db like 'test%';
drop table mysql.global_priv;
rename table mysql.global_priv_bak to mysql.global_priv;
+
+--echo # End of 10.3 tests
+
+--source include/switch_to_mysql_user.inc
+drop view mysql.user_bak;
+create user 'user3'@'localhost' identified with mysql_native_password as password('a_password');
+show create user user3@localhost;
+update mysql.user set password=authentication_string, authentication_string='' where user='user3';
+select password,plugin,authentication_string from mysql.user where user='user3';
+flush privileges;
+show create user user3@localhost;
+connect con1,localhost,user3,a_password;
+select current_user();
+disconnect con1;
+connection default;
+--echo # mysql_upgrade --force --silent 2>&1
+--exec $MYSQL_UPGRADE --force --silent 2>&1
+--remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+show create user user3@localhost;
+connect con1,localhost,user3,a_password;
+select current_user();
+disconnect con1;
+connection default;
+drop user user3@localhost;
+drop table mysql.global_priv;
+rename table mysql.global_priv_bak to mysql.global_priv;