mariadb/mysql-test/main/mysql_upgrade-34014.test
Alexander Barkov 83d3ed4908 MDEV-34014 mysql_upgrade failed
Adding a new statement into scripts/sys_schema/before_setup.sql:

  ALTER DATABASE sys CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci;

to fix db.opt in case:
- the database `sys` was altered to unexpected CHARACTER SET or COLLATE values
- or db.opt was erroneously removed

to make sure that sys objects are always recreated using utf8mb3_general_ci.
2024-06-17 16:38:48 +04:00

26 lines
516 B
Text

--source include/mysql_upgrade_preparation.inc
let $MYSQLD_DATADIR= `select @@datadir`;
--echo #
--echo # Stat of 10.6 tests
--echo #
--echo #
--echo # MDEV-34014 mysql_upgrade failed
--echo #
SHOW CREATE DATABASE sys;
--echo # Emulate db.opt file was removed in a mistake
--remove_file $MYSQLD_DATADIR/sys/db.opt
FLUSH TABLES;
SHOW CREATE DATABASE sys;
--exec $MYSQL_UPGRADE --force 2>&1
--remove_file $MYSQLD_DATADIR/mysql_upgrade_info
SHOW CREATE DATABASE sys;
--echo #
--echo # End of 10.6 tests
--echo #