summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2020-04-21 18:40:15 +0200
committerSergei Golubchik <serg@mariadb.org>2020-04-27 09:22:36 +0200
commitb976b9bfc3ec12cf4dcf57da828c0315916c1413 (patch)
tree0ca21b567da798f5285b9867fe0c741a679cbb17 /mysql-test
parentc2db9397c792a774748f22ddb33b994aae547770 (diff)
downloadmariadb-git-b976b9bfc3ec12cf4dcf57da828c0315916c1413.tar.gz
MDEV-21244 mysql_upgrade creating empty global_priv table
support upgrades from 5.2 privilege tables
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/main/mysql_upgrade.result8
-rw-r--r--mysql-test/main/mysql_upgrade.test13
2 files changed, 21 insertions, 0 deletions
diff --git a/mysql-test/main/mysql_upgrade.result b/mysql-test/main/mysql_upgrade.result
index f71ce087ba1..862e7e8f3d4 100644
--- a/mysql-test/main/mysql_upgrade.result
+++ b/mysql-test/main/mysql_upgrade.result
@@ -630,4 +630,12 @@ drop table mysql.innodb_index_stats, mysql.innodb_table_stats;
# mysql_upgrade --force --silent 2>&1
drop table mysql.global_priv;
rename table mysql.global_priv_bak to mysql.global_priv;
+drop view mysql.user_bak;
+alter table mysql.user change authentication_string auth_string text collate utf8_bin not null;
+# mysql_upgrade --force --silent 2>&1
+select count(*) from mysql.global_priv;
+count(*)
+4
+drop table mysql.global_priv;
+rename table mysql.global_priv_bak to mysql.global_priv;
# End of 10.4 tests
diff --git a/mysql-test/main/mysql_upgrade.test b/mysql-test/main/mysql_upgrade.test
index 3dfe38701aa..0dad53f8881 100644
--- a/mysql-test/main/mysql_upgrade.test
+++ b/mysql-test/main/mysql_upgrade.test
@@ -282,4 +282,17 @@ drop table mysql.innodb_index_stats, mysql.innodb_table_stats;
drop table mysql.global_priv;
rename table mysql.global_priv_bak to mysql.global_priv;
+#
+# MDEV-21244 mysql_upgrade creating empty global_priv table
+#
+--source include/switch_to_mysql_user.inc
+drop view mysql.user_bak;
+alter table mysql.user change authentication_string auth_string text collate utf8_bin not null;
+--echo # mysql_upgrade --force --silent 2>&1
+--exec $MYSQL_UPGRADE --force --silent 2>&1
+--remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+select count(*) from mysql.global_priv;
+drop table mysql.global_priv;
+rename table mysql.global_priv_bak to mysql.global_priv;
+
--echo # End of 10.4 tests