|
Thanks for the report.
Reproducible on Linux also, only on 5.5, 10.0 looks fine.
The empty command is the path to mysqlcheck, which is needed but not set due to the combination of conditions (--upgrade-system-tables + MySQL directory).
The easy way to fix it seems to be this (although there might be better ways):
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c
|
index 0be8f91..afcc415 100644
|
--- a/client/mysql_upgrade.c
|
+++ b/client/mysql_upgrade.c
|
@@ -1051,16 +1051,11 @@ int main(int argc, char **argv)
|
/* Find mysql */
|
find_tool(mysql_path, IF_WIN("mysql.exe", "mysql"), self_name);
|
|
- if (!opt_systables_only)
|
- {
|
- /* Find mysqlcheck */
|
- find_tool(mysqlcheck_path, IF_WIN("mysqlcheck.exe", "mysqlcheck"), self_name);
|
- }
|
- else
|
- {
|
- if (!opt_silent)
|
- printf("The --upgrade-system-tables option was used, databases won't be touched.\n");
|
- }
|
+ /* Find mysqlcheck */
|
+ find_tool(mysqlcheck_path, IF_WIN("mysqlcheck.exe", "mysqlcheck"), self_name);
|
+
|
+ if (opt_systables_only && !opt_silent)
|
+ printf("The --upgrade-system-tables option was used, databases won't be touched.\n");
|
|
/*
|
Read the mysql_upgrade_info file to check if mysql_upgrade
|
On 10.0 the condition is already gone, that's why it works.
Change to the test case:
diff --git a/mysql-test/t/mysql_upgrade_view.test b/mysql-test/t/mysql_upgrade_view.test
|
index 7a098aa..fbeea48 100644
|
--- a/mysql-test/t/mysql_upgrade_view.test
|
+++ b/mysql-test/t/mysql_upgrade_view.test
|
@@ -157,5 +157,29 @@ rename table mysql.ev_bk to mysql.event;
|
|
drop table if exists kv;
|
drop view v1,v2,v3,v4;
|
+
|
+# MDEV-9453 mysql_upgrade.exe error when mysql is migrated to mariadb
|
+# (mysql_upgrade.exe --upgrade-system-tables fails on fixing views)
|
+
|
+# Make it look like a MySQL directory again
|
+
|
+rename table mysql.event to mysql.ev_bk;
|
+--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/event.MYI $MYSQLD_DATADIR/mysql/event.MYI
|
+--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/event.MYD $MYSQLD_DATADIR/mysql/event.MYD
|
+--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/event.frm $MYSQLD_DATADIR/mysql/event.frm
|
+
|
+--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/v1.frm $MYSQLD_DATADIR/test/v1.frm
|
+--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/v2.frm $MYSQLD_DATADIR/test/v2.frm
|
+--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/v3.frm $MYSQLD_DATADIR/test/v3.frm
|
+
|
+flush tables;
|
+
|
+--replace_result $MYSQLTEST_VARDIR var
|
+--exec $MYSQL_UPGRADE --force --upgrade-system-tables 2>&1
|
+
|
+# back to mariadb default
|
+drop table mysql.event;
|
+rename table mysql.ev_bk to mysql.event;
|
+drop view v1,v2,v3;
|
drop table t1;
|
|