Skip to content

Commit

Permalink
MDEV-21244 mysql_upgrade creating empty global_priv table
Browse files Browse the repository at this point in the history
support upgrades from 5.2 privilege tables
  • Loading branch information
vuvova committed Apr 27, 2020
1 parent c2db939 commit b976b9b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
8 changes: 8 additions & 0 deletions mysql-test/main/mysql_upgrade.result
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 13 additions & 0 deletions mysql-test/main/mysql_upgrade.test
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions scripts/mysql_system_tables_fix.sql
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,7 @@ UPDATE user SET Delete_history_priv = Super_priv WHERE @had_user_delete_history_

ALTER TABLE user ADD plugin char(64) CHARACTER SET latin1 DEFAULT '' NOT NULL,
ADD authentication_string TEXT NOT NULL;
ALTER TABLE user CHANGE auth_string authentication_string TEXT NOT NULL;
ALTER TABLE user MODIFY plugin char(64) CHARACTER SET latin1 DEFAULT '' NOT NULL,
MODIFY authentication_string TEXT NOT NULL;
ALTER TABLE user ADD password_expired ENUM('N', 'Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL;
Expand Down

0 comments on commit b976b9b

Please sign in to comment.