diff options
author | Sergei Golubchik <sergii@pisem.net> | 2014-11-19 00:19:17 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2014-11-19 00:19:17 +0100 |
commit | df7b27f1fe308fd4011fa020bebd7c69bcd43383 (patch) | |
tree | 3b4200849bf9bf6a1f47e4cdf1e5ebb32094c844 /mysql-test | |
parent | 51d7e80355ec76f9f696835fccb63249918534a8 (diff) | |
download | mariadb-git-df7b27f1fe308fd4011fa020bebd7c69bcd43383.tar.gz |
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
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/ctype_upgrade.result | 18 | ||||
-rw-r--r-- | mysql-test/r/log_tables_upgrade.result | 9 | ||||
-rw-r--r-- | mysql-test/r/mysql_upgrade-6984.result | 58 | ||||
-rw-r--r-- | mysql-test/r/mysql_upgrade.result | 77 | ||||
-rw-r--r-- | mysql-test/r/mysql_upgrade_no_innodb.result | 5 | ||||
-rw-r--r-- | mysql-test/r/mysql_upgrade_ssl.result | 9 | ||||
-rw-r--r-- | mysql-test/t/mysql_upgrade-6984.opt | 1 | ||||
-rw-r--r-- | mysql-test/t/mysql_upgrade-6984.test | 22 |
8 files changed, 147 insertions, 52 deletions
diff --git a/mysql-test/r/ctype_upgrade.result b/mysql-test/r/ctype_upgrade.result index 825ad8dac21..56e2ef96ead 100644 --- a/mysql-test/r/ctype_upgrade.result +++ b/mysql-test/r/ctype_upgrade.result @@ -227,7 +227,7 @@ DROP TABLE mysql050614_xxx_croatian_ci; # Checking mysql_upgrade # # Running mysql_upgrade -Phase 1/4: Checking mysql database +Phase 1/5: Checking mysql database Processing databases mysql mysql.column_stats OK @@ -258,9 +258,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 @@ -279,10 +279,11 @@ test.maria050313_ucs2_croatian_ci_def OK test.maria050313_utf8_croatian_ci OK test.maria050533_xxx_croatian_ci OK test.maria100004_xxx_croatian_ci OK +Phase 5/5: Running 'FLUSH PRIVILEGES'... OK # Running mysql_upgrade for the second time # This should report OK for all tables -Phase 1/4: Checking mysql database +Phase 1/5: Checking mysql database Processing databases mysql mysql.column_stats OK @@ -313,9 +314,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 @@ -328,6 +329,7 @@ test.maria050313_utf8_croatian_ci OK test.maria050533_xxx_croatian_ci OK test.maria100004_xxx_croatian_ci OK test.mysql050614_xxx_croatian_ci OK +Phase 5/5: Running 'FLUSH PRIVILEGES'... OK SHOW CREATE TABLE maria050313_ucs2_croatian_ci_def; Table Create Table diff --git a/mysql-test/r/log_tables_upgrade.result b/mysql-test/r/log_tables_upgrade.result index 9900f6d6b5a..a609b222d53 100644 --- a/mysql-test/r/log_tables_upgrade.result +++ b/mysql-test/r/log_tables_upgrade.result @@ -11,7 +11,7 @@ Table Op Msg_type Msg_text test.bug49823 repair status OK RENAME TABLE general_log TO renamed_general_log; RENAME TABLE test.bug49823 TO general_log; -Phase 1/4: Checking mysql database +Phase 1/5: Checking mysql database Processing databases mysql mysql.column_stats OK @@ -43,9 +43,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 @@ -53,6 +53,7 @@ mtr.global_suppressions OK mtr.test_suppressions OK performance_schema test +Phase 5/5: Running 'FLUSH PRIVILEGES'... OK DROP TABLE general_log; RENAME TABLE renamed_general_log TO general_log; diff --git a/mysql-test/r/mysql_upgrade-6984.result b/mysql-test/r/mysql_upgrade-6984.result new file mode 100644 index 00000000000..6ae995cd030 --- /dev/null +++ b/mysql-test/r/mysql_upgrade-6984.result @@ -0,0 +1,58 @@ +update mysql.user set password=password("foo") where user='root'; +Phase 1/5: Checking mysql database +Processing databases +mysql +mysql.column_stats OK +mysql.columns_priv OK +mysql.db OK +mysql.event OK +mysql.func OK +mysql.gtid_slave_pos OK +mysql.help_category OK +mysql.help_keyword OK +mysql.help_relation OK +mysql.help_topic OK +mysql.host OK +mysql.index_stats OK +mysql.innodb_index_stats +Error : Unknown storage engine 'InnoDB' +error : Corrupt +mysql.innodb_table_stats +Error : Unknown storage engine 'InnoDB' +error : Corrupt +mysql.plugin OK +mysql.proc OK +mysql.procs_priv OK +mysql.proxies_priv OK +mysql.roles_mapping OK +mysql.servers OK +mysql.table_stats OK +mysql.tables_priv OK +mysql.time_zone OK +mysql.time_zone_leap_second OK +mysql.time_zone_name OK +mysql.time_zone_transition OK +mysql.time_zone_transition_type OK +mysql.user OK + +Repairing tables +mysql.innodb_index_stats +Error : Unknown storage engine 'InnoDB' +error : Corrupt +mysql.innodb_table_stats +Error : Unknown storage engine 'InnoDB' +error : Corrupt +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 +mtr.global_suppressions OK +mtr.test_suppressions OK +performance_schema +test +Phase 5/5: Running 'FLUSH PRIVILEGES'... +OK +update mysql.user set password='' where user='root'; +flush privileges; diff --git a/mysql-test/r/mysql_upgrade.result b/mysql-test/r/mysql_upgrade.result index 1cc448b3ba2..64c2c0222fc 100644 --- a/mysql-test/r/mysql_upgrade.result +++ b/mysql-test/r/mysql_upgrade.result @@ -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 diff --git a/mysql-test/r/mysql_upgrade_no_innodb.result b/mysql-test/r/mysql_upgrade_no_innodb.result index 320dcfe5d3b..e65c6ae05f7 100644 --- a/mysql-test/r/mysql_upgrade_no_innodb.result +++ b/mysql-test/r/mysql_upgrade_no_innodb.result @@ -1,5 +1,5 @@ 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 @@ -42,5 +42,6 @@ error : Corrupt mysql.innodb_table_stats Error : Unknown storage engine 'InnoDB' error : Corrupt -Phase 2/4: Running 'mysql_fix_privilege_tables'... +Phase 2/5: Running 'mysql_fix_privilege_tables'... +Phase 5/5: Running 'FLUSH PRIVILEGES'... OK diff --git a/mysql-test/r/mysql_upgrade_ssl.result b/mysql-test/r/mysql_upgrade_ssl.result index 14671aa6409..1bbee22aba2 100644 --- a/mysql-test/r/mysql_upgrade_ssl.result +++ b/mysql-test/r/mysql_upgrade_ssl.result @@ -1,7 +1,7 @@ # # Bug#55672 mysql_upgrade dies with internal error # -Phase 1/4: Checking mysql database +Phase 1/5: Checking mysql database Processing databases mysql mysql.column_stats OK @@ -32,9 +32,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 @@ -42,4 +42,5 @@ mtr.global_suppressions OK mtr.test_suppressions OK performance_schema test +Phase 5/5: Running 'FLUSH PRIVILEGES'... OK diff --git a/mysql-test/t/mysql_upgrade-6984.opt b/mysql-test/t/mysql_upgrade-6984.opt new file mode 100644 index 00000000000..97669d95260 --- /dev/null +++ b/mysql-test/t/mysql_upgrade-6984.opt @@ -0,0 +1 @@ +--skip-grant-tables --group-concat-max-len=1023 diff --git a/mysql-test/t/mysql_upgrade-6984.test b/mysql-test/t/mysql_upgrade-6984.test new file mode 100644 index 00000000000..6f10d3f33e9 --- /dev/null +++ b/mysql-test/t/mysql_upgrade-6984.test @@ -0,0 +1,22 @@ +# +# MDEV-6984 Can't migrate from MySQL 5.6.21 to MariaDB 10 +# +--source include/not_embedded.inc + +# +# When 'root' account is password protected and MYSQL_UPGRADE doesn't +# know the password (meaning, MYSQL_UPGRADE is run automatically +# on upgrade), MYSQLD has to be started with --skip-grant-tables. +# +# In this setup MYSQL_UPGRADE cannot continue after issuing FLUSH PRIVILEGES +# + +update mysql.user set password=password("foo") where user='root'; + +--exec $MYSQL_UPGRADE + +connect(con1,localhost,root,foo,,,); + +update mysql.user set password='' where user='root'; +flush privileges; + |