1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +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

@@ -762,7 +762,7 @@ static int run_mysqlcheck_upgrade(const char *arg1, const char *arg2)
static int run_mysqlcheck_fixnames(void)
{
verbose("Phase 3/4: Fixing table and database names");
verbose("Phase 3/5: Fixing table and database names");
print_conn_args("mysqlcheck");
return run_tool(mysqlcheck_path,
NULL, /* Send output from mysqlcheck directly to screen */
@@ -860,7 +860,8 @@ static int run_sql_fix_privilege_tables(void)
query_ptr++
)
{
dynstr_append(&ds_script, *query_ptr);
if (strcasecmp(*query_ptr, "flush privileges;\n"))
dynstr_append(&ds_script, *query_ptr);
}
run_query(ds_script.str,
@@ -1021,19 +1022,23 @@ int main(int argc, char **argv)
/*
Run "mysqlcheck" and "mysql_fix_privilege_tables.sql"
*/
verbose("Phase 1/4: Checking mysql database");
verbose("Phase 1/5: Checking mysql database");
if (run_mysqlcheck_upgrade("--databases", "mysql"))
die("Upgrade failed" );
verbose("Phase 2/4: Running 'mysql_fix_privilege_tables'...");
verbose("Phase 2/5: Running 'mysql_fix_privilege_tables'...");
if (run_sql_fix_privilege_tables())
die("Upgrade failed" );
if (!opt_systables_only &&
(run_mysqlcheck_fixnames() ||
verbose("Phase 4/4: Checking and upgrading tables") ||
verbose("Phase 4/5: Checking and upgrading tables") ||
run_mysqlcheck_upgrade("--all-databases","--skip-database=mysql")))
die("Upgrade failed" );
verbose("Phase 5/5: Running 'FLUSH PRIVILEGES'...");
if (run_query("FLUSH PRIVILEGES", NULL, TRUE))
die("Upgrade failed" );
verbose("OK");
/* Create a file indicating upgrade has been performed */