1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-6984 Can't migrate from MySQL 5.6.21 to MariaDB 10

in mysql_upgrade: do FLUSH PRIVILEGES at the end, not together with
mysql_fix_privilege_tables

mysql-test/t/mysql_upgrade-6984.opt:
  use a dummy second option to force server restart after the test
This commit is contained in:
Sergei Golubchik
2014-11-19 00:19:17 +01:00
parent 51d7e80355
commit df7b27f1fe
9 changed files with 157 additions and 57 deletions

View File

@ -1,5 +1,5 @@
Run mysql_upgrade once
Phase 1/4: Checking mysql database
Phase 1/5: Checking mysql database
Processing databases
mysql
mysql.column_stats OK
@ -30,9 +30,9 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
Phase 2/4: Running 'mysql_fix_privilege_tables'...
Phase 3/4: Fixing table and database names
Phase 4/4: Checking and upgrading tables
Phase 2/5: Running 'mysql_fix_privilege_tables'...
Phase 3/5: Fixing table and database names
Phase 4/5: Checking and upgrading tables
Processing databases
information_schema
mtr
@ -40,11 +40,12 @@ mtr.global_suppressions OK
mtr.test_suppressions OK
performance_schema
test
Phase 5/5: Running 'FLUSH PRIVILEGES'...
OK
Run it again - should say already completed
This installation of MySQL is already upgraded to VERSION, use --force if you still need to run mysql_upgrade
Force should run it regardless of wether it's been run before
Phase 1/4: Checking mysql database
Phase 1/5: Checking mysql database
Processing databases
mysql
mysql.column_stats OK
@ -75,9 +76,9 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
Phase 2/4: Running 'mysql_fix_privilege_tables'...
Phase 3/4: Fixing table and database names
Phase 4/4: Checking and upgrading tables
Phase 2/5: Running 'mysql_fix_privilege_tables'...
Phase 3/5: Fixing table and database names
Phase 4/5: Checking and upgrading tables
Processing databases
information_schema
mtr
@ -85,11 +86,12 @@ mtr.global_suppressions OK
mtr.test_suppressions OK
performance_schema
test
Phase 5/5: Running 'FLUSH PRIVILEGES'...
OK
CREATE USER mysqltest1@'%' IDENTIFIED by 'sakila';
GRANT ALL ON *.* TO mysqltest1@'%';
Run mysql_upgrade with password protected account
Phase 1/4: Checking mysql database
Phase 1/5: Checking mysql database
Processing databases
mysql
mysql.column_stats OK
@ -120,9 +122,9 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
Phase 2/4: Running 'mysql_fix_privilege_tables'...
Phase 3/4: Fixing table and database names
Phase 4/4: Checking and upgrading tables
Phase 2/5: Running 'mysql_fix_privilege_tables'...
Phase 3/5: Fixing table and database names
Phase 4/5: Checking and upgrading tables
Processing databases
information_schema
mtr
@ -130,6 +132,7 @@ mtr.global_suppressions OK
mtr.test_suppressions OK
performance_schema
test
Phase 5/5: Running 'FLUSH PRIVILEGES'...
OK
DROP USER mysqltest1@'%';
Version check failed. Got the following error when calling the 'mysql' command line client
@ -139,7 +142,7 @@ Run mysql_upgrade with a non existing server socket
mysqlcheck: Got error: 2005: Unknown MySQL server host 'not_existing_host' (errno) when trying to connect
FATAL ERROR: Upgrade failed
set GLOBAL sql_mode='STRICT_ALL_TABLES,ANSI_QUOTES,NO_ZERO_DATE';
Phase 1/4: Checking mysql database
Phase 1/5: Checking mysql database
Processing databases
mysql
mysql.column_stats OK
@ -170,9 +173,9 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
Phase 2/4: Running 'mysql_fix_privilege_tables'...
Phase 3/4: Fixing table and database names
Phase 4/4: Checking and upgrading tables
Phase 2/5: Running 'mysql_fix_privilege_tables'...
Phase 3/5: Fixing table and database names
Phase 4/5: Checking and upgrading tables
Processing databases
information_schema
mtr
@ -180,6 +183,7 @@ mtr.global_suppressions OK
mtr.test_suppressions OK
performance_schema
test
Phase 5/5: Running 'FLUSH PRIVILEGES'...
OK
set GLOBAL sql_mode=default;
#
@ -190,7 +194,7 @@ CREATE PROCEDURE testproc() BEGIN END;
UPDATE mysql.proc SET character_set_client = NULL WHERE name LIKE 'testproc';
UPDATE mysql.proc SET collation_connection = NULL WHERE name LIKE 'testproc';
UPDATE mysql.proc SET db_collation = NULL WHERE name LIKE 'testproc';
Phase 1/4: Checking mysql database
Phase 1/5: Checking mysql database
Processing databases
mysql
mysql.column_stats OK
@ -221,9 +225,9 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
Phase 2/4: Running 'mysql_fix_privilege_tables'...
Phase 3/4: Fixing table and database names
Phase 4/4: Checking and upgrading tables
Phase 2/5: Running 'mysql_fix_privilege_tables'...
Phase 3/5: Fixing table and database names
Phase 4/5: Checking and upgrading tables
Processing databases
information_schema
mtr
@ -231,6 +235,7 @@ mtr.global_suppressions OK
mtr.test_suppressions OK
performance_schema
test
Phase 5/5: Running 'FLUSH PRIVILEGES'...
OK
CALL testproc();
DROP PROCEDURE testproc;
@ -244,7 +249,7 @@ WARNING: NULL values of the 'db_collation' column ('mysql.proc' table) have been
GRANT USAGE ON *.* TO 'user3'@'%';
GRANT ALL PRIVILEGES ON `roelt`.`test2` TO 'user3'@'%';
Run mysql_upgrade with all privileges on a user
Phase 1/4: Checking mysql database
Phase 1/5: Checking mysql database
Processing databases
mysql
mysql.column_stats OK
@ -275,9 +280,9 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
Phase 2/4: Running 'mysql_fix_privilege_tables'...
Phase 3/4: Fixing table and database names
Phase 4/4: Checking and upgrading tables
Phase 2/5: Running 'mysql_fix_privilege_tables'...
Phase 3/5: Fixing table and database names
Phase 4/5: Checking and upgrading tables
Processing databases
information_schema
mtr
@ -285,6 +290,7 @@ mtr.global_suppressions OK
mtr.test_suppressions OK
performance_schema
test
Phase 5/5: Running 'FLUSH PRIVILEGES'...
OK
SHOW GRANTS FOR 'user3'@'%';
Grants for user3@%
@ -293,7 +299,7 @@ GRANT ALL PRIVILEGES ON `roelt`.`test2` TO 'user3'@'%'
DROP USER 'user3'@'%';
End of 5.1 tests
The --upgrade-system-tables option was used, user tables won't be touched.
Phase 1/4: Checking mysql database
Phase 1/5: Checking mysql database
Processing databases
mysql
mysql.column_stats OK
@ -324,7 +330,8 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
Phase 2/4: Running 'mysql_fix_privilege_tables'...
Phase 2/5: Running 'mysql_fix_privilege_tables'...
Phase 5/5: Running 'FLUSH PRIVILEGES'...
OK
#
# Bug#11827359 60223: MYSQL_UPGRADE PROBLEM WITH OPTION
@ -332,7 +339,7 @@ OK
#
# Droping the previously created mysql_upgrade_info file..
# Running mysql_upgrade with --skip-write-binlog..
Phase 1/4: Checking mysql database
Phase 1/5: Checking mysql database
Processing databases
mysql
mysql.column_stats OK
@ -363,9 +370,9 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
Phase 2/4: Running 'mysql_fix_privilege_tables'...
Phase 3/4: Fixing table and database names
Phase 4/4: Checking and upgrading tables
Phase 2/5: Running 'mysql_fix_privilege_tables'...
Phase 3/5: Fixing table and database names
Phase 4/5: Checking and upgrading tables
Processing databases
information_schema
mtr
@ -373,6 +380,7 @@ mtr.global_suppressions OK
mtr.test_suppressions OK
performance_schema
test
Phase 5/5: Running 'FLUSH PRIVILEGES'...
OK
#
# MDEV-4332 Increase username length from 16 characters
@ -386,7 +394,7 @@ GRANT INSERT ON mysql.user TO very_long_user_name_number_2;
GRANT UPDATE (User) ON mysql.db TO very_long_user_name_number_1;
GRANT UPDATE (User) ON mysql.db TO very_long_user_name_number_2;
CREATE PROCEDURE test.pr() BEGIN END;
Phase 1/4: Checking mysql database
Phase 1/5: Checking mysql database
Processing databases
mysql
mysql.column_stats OK
@ -417,9 +425,9 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
Phase 2/4: Running 'mysql_fix_privilege_tables'...
Phase 3/4: Fixing table and database names
Phase 4/4: Checking and upgrading tables
Phase 2/5: Running 'mysql_fix_privilege_tables'...
Phase 3/5: Fixing table and database names
Phase 4/5: Checking and upgrading tables
Processing databases
information_schema
mtr
@ -427,6 +435,7 @@ mtr.global_suppressions OK
mtr.test_suppressions OK
performance_schema
test
Phase 5/5: Running 'FLUSH PRIVILEGES'...
OK
SELECT definer FROM mysql.proc WHERE db = 'test' AND name = 'pr';
definer