mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01:00
MDEV-22249 Upgrade testing between major versions in MTR
This commit is contained in:
parent
4a0b56f604
commit
f67522ede6
9 changed files with 5439 additions and 0 deletions
49
mysql-test/include/load_dump_and_upgrade.inc
Normal file
49
mysql-test/include/load_dump_and_upgrade.inc
Normal file
|
@ -0,0 +1,49 @@
|
|||
--source include/have_innodb.inc
|
||||
|
||||
# ==== Usage ====
|
||||
#
|
||||
# [--let $old_version= 10.2]
|
||||
# --source include/load_dump_and_upgrade.inc
|
||||
|
||||
# Dumps stored in std_data as mysql_database_<old_version>.dump
|
||||
# were pre-created by running mysqldump for `mysql` database
|
||||
# on a freshly boostrapped instance of the corresponding version.
|
||||
# On 10.4 the local root was additionally given an empty password,
|
||||
# to avoid using unix_socket.
|
||||
|
||||
# Backup the existing mysql schema, to restore it later
|
||||
--exec $MYSQL_DUMP mysql > $MYSQL_TMP_DIR/mysql_database_backup
|
||||
|
||||
--echo #
|
||||
--echo # Upgrade from version $old_version
|
||||
--echo #
|
||||
|
||||
# Workaround for MDEV-22127 (can't import database dump created before 10.4)
|
||||
# The most universal workaround suggested in the item is running
|
||||
# DROP TABLE IF EXISTS `mysql`.`global_priv`;
|
||||
# DROP VIEW IF EXISTS `mysql`.`user`;
|
||||
# before the upgrade. For this test, it is better than creating the dumps
|
||||
# with --add-drop-database, because
|
||||
# a) it won't require re-creating the dump when the bug is fixed;
|
||||
# b) it won't hide possible unrelated problems;
|
||||
# c) add-drop-database doesn't work with logging into tables enabled (MDEV-4875 and more)
|
||||
|
||||
--exec $MYSQL -e "DROP TABLE IF EXISTS mysql.global_priv; DROP VIEW IF EXISTS mysql.user"
|
||||
|
||||
--echo # Loading dump of $old_version mysql schema
|
||||
--exec $MYSQL mysql < $MYSQLTEST_VARDIR/std_data/mysql_database_$old_version.dump
|
||||
|
||||
--echo # Running mysql_upgrade
|
||||
--exec $MYSQL_UPGRADE --verbose > $MYSQL_TMP_DIR/upgrade.log
|
||||
|
||||
--echo # Checking that mysql.user is accessible and returns some data
|
||||
SELECT COUNT(*) > 0 AS `mysql.user has data` FROM mysql.user;
|
||||
|
||||
# Restore the backup of mysql schema
|
||||
--exec $MYSQL mysql < $MYSQL_TMP_DIR/mysql_database_backup
|
||||
|
||||
--let $ddir= `select @@datadir`
|
||||
|
||||
# It will fail if the file doesn't exist, which is good,
|
||||
# which is an extra check that it was written
|
||||
--remove_file $ddir/mysql_upgrade_info
|
|
@ -643,3 +643,62 @@ count(*)
|
|||
drop table mysql.global_priv;
|
||||
rename table mysql.global_priv_bak to mysql.global_priv;
|
||||
# End of 10.4 tests
|
||||
#
|
||||
# Check that mysql_upgrade can be run on mysqldump
|
||||
# of mysql schema from previous versions
|
||||
#
|
||||
call mtr.add_suppression("innodb_table_stats has length mismatch in the column name table_name");
|
||||
#
|
||||
# Upgrade from version 5.5
|
||||
#
|
||||
# Loading dump of 5.5 mysql schema
|
||||
# Running mysql_upgrade
|
||||
# Checking that mysql.user is accessible and returns some data
|
||||
SELECT COUNT(*) > 0 AS `mysql.user has data` FROM mysql.user;
|
||||
mysql.user has data
|
||||
1
|
||||
#
|
||||
# Upgrade from version 10.0
|
||||
#
|
||||
# Loading dump of 10.0 mysql schema
|
||||
# Running mysql_upgrade
|
||||
# Checking that mysql.user is accessible and returns some data
|
||||
SELECT COUNT(*) > 0 AS `mysql.user has data` FROM mysql.user;
|
||||
mysql.user has data
|
||||
1
|
||||
#
|
||||
# Upgrade from version 10.1
|
||||
#
|
||||
# Loading dump of 10.1 mysql schema
|
||||
# Running mysql_upgrade
|
||||
# Checking that mysql.user is accessible and returns some data
|
||||
SELECT COUNT(*) > 0 AS `mysql.user has data` FROM mysql.user;
|
||||
mysql.user has data
|
||||
1
|
||||
#
|
||||
# Upgrade from version 10.2
|
||||
#
|
||||
# Loading dump of 10.2 mysql schema
|
||||
# Running mysql_upgrade
|
||||
# Checking that mysql.user is accessible and returns some data
|
||||
SELECT COUNT(*) > 0 AS `mysql.user has data` FROM mysql.user;
|
||||
mysql.user has data
|
||||
1
|
||||
#
|
||||
# Upgrade from version 10.3
|
||||
#
|
||||
# Loading dump of 10.3 mysql schema
|
||||
# Running mysql_upgrade
|
||||
# Checking that mysql.user is accessible and returns some data
|
||||
SELECT COUNT(*) > 0 AS `mysql.user has data` FROM mysql.user;
|
||||
mysql.user has data
|
||||
1
|
||||
#
|
||||
# Upgrade from version 10.4
|
||||
#
|
||||
# Loading dump of 10.4 mysql schema
|
||||
# Running mysql_upgrade
|
||||
# Checking that mysql.user is accessible and returns some data
|
||||
SELECT COUNT(*) > 0 AS `mysql.user has data` FROM mysql.user;
|
||||
mysql.user has data
|
||||
1
|
||||
|
|
|
@ -296,3 +296,32 @@ drop table mysql.global_priv;
|
|||
rename table mysql.global_priv_bak to mysql.global_priv;
|
||||
|
||||
--echo # End of 10.4 tests
|
||||
|
||||
#
|
||||
# MDEV-22249 Upgrade testing between major versions in MTR
|
||||
#
|
||||
--echo #
|
||||
--echo # Check that mysql_upgrade can be run on mysqldump
|
||||
--echo # of mysql schema from previous versions
|
||||
--echo #
|
||||
|
||||
# The warning appears during mysql_upgrade, before the schema becomes consistent
|
||||
call mtr.add_suppression("innodb_table_stats has length mismatch in the column name table_name");
|
||||
|
||||
--let $old_version= 5.5
|
||||
--source include/load_dump_and_upgrade.inc
|
||||
|
||||
--let $old_version= 10.0
|
||||
--source include/load_dump_and_upgrade.inc
|
||||
|
||||
--let $old_version= 10.1
|
||||
--source include/load_dump_and_upgrade.inc
|
||||
|
||||
--let $old_version= 10.2
|
||||
--source include/load_dump_and_upgrade.inc
|
||||
|
||||
--let $old_version= 10.3
|
||||
--source include/load_dump_and_upgrade.inc
|
||||
|
||||
--let $old_version= 10.4
|
||||
--source include/load_dump_and_upgrade.inc
|
||||
|
|
902
mysql-test/std_data/mysql_database_10.0.dump
Normal file
902
mysql-test/std_data/mysql_database_10.0.dump
Normal file
File diff suppressed because one or more lines are too long
906
mysql-test/std_data/mysql_database_10.1.dump
Normal file
906
mysql-test/std_data/mysql_database_10.1.dump
Normal file
File diff suppressed because one or more lines are too long
906
mysql-test/std_data/mysql_database_10.2.dump
Normal file
906
mysql-test/std_data/mysql_database_10.2.dump
Normal file
File diff suppressed because one or more lines are too long
928
mysql-test/std_data/mysql_database_10.3.dump
Normal file
928
mysql-test/std_data/mysql_database_10.3.dump
Normal file
File diff suppressed because one or more lines are too long
923
mysql-test/std_data/mysql_database_10.4.dump
Normal file
923
mysql-test/std_data/mysql_database_10.4.dump
Normal file
File diff suppressed because one or more lines are too long
737
mysql-test/std_data/mysql_database_5.5.dump
Normal file
737
mysql-test/std_data/mysql_database_5.5.dump
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue