mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge 11.0 into 11.1
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
#include <sslopt-vars.h>
|
||||
#include <../scripts/mariadb_fix_privilege_tables_sql.c>
|
||||
|
||||
#define VER "2.0"
|
||||
#define VER "2.1"
|
||||
#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
|
||||
|
||||
#ifdef HAVE_SYS_WAIT_H
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
static int phase = 0;
|
||||
static int info_file= -1;
|
||||
static const int phases_total = 7;
|
||||
static const int phases_total = 8;
|
||||
static char mysql_path[FN_REFLEN];
|
||||
static char mysqlcheck_path[FN_REFLEN];
|
||||
|
||||
@@ -989,7 +989,7 @@ static my_bool is_mysql()
|
||||
|
||||
static int run_mysqlcheck_views(void)
|
||||
{
|
||||
const char *upgrade_views="--process-views=YES";
|
||||
const char *upgrade_views="--process-views=UPGRADE";
|
||||
if (upgrade_from_mysql)
|
||||
{
|
||||
/*
|
||||
@@ -1129,8 +1129,9 @@ static my_bool from_before_10_1()
|
||||
}
|
||||
|
||||
|
||||
static void uninstall_plugins(void)
|
||||
static int uninstall_plugins(void)
|
||||
{
|
||||
verbose("Phase %d/%d: uninstalling plugins", ++phase, phases_total);
|
||||
if (ds_plugin_data_types.length)
|
||||
{
|
||||
char *plugins= ds_plugin_data_types.str;
|
||||
@@ -1147,7 +1148,10 @@ static void uninstall_plugins(void)
|
||||
next= get_line(next);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@brief Install plugins for missing data types
|
||||
@details Check for entries with "Unknown data type" in I_S.TABLES,
|
||||
@@ -1196,6 +1200,8 @@ static int install_used_plugin_data_types(void)
|
||||
dynstr_free(&ds_result);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Check for entries with "Unknown storage engine" in I_S.TABLES,
|
||||
try to load plugins for these tables if available (MDEV-11942)
|
||||
@@ -1246,6 +1252,7 @@ static int install_used_engines(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int check_slave_repositories(void)
|
||||
{
|
||||
DYNAMIC_STRING ds_result;
|
||||
@@ -1373,6 +1380,13 @@ static int run_sql_fix_privilege_tables(void)
|
||||
}
|
||||
|
||||
|
||||
static int flush_privileges(void)
|
||||
{
|
||||
verbose("Phase %d/%d: Running 'FLUSH PRIVILEGES'", ++phase, phases_total);
|
||||
return run_query("FLUSH PRIVILEGES", NULL, TRUE);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Check if the server version matches with the server version mysql_upgrade
|
||||
was compiled with.
|
||||
@@ -1402,10 +1416,11 @@ static int check_version_match(void)
|
||||
|
||||
if (calc_server_version((char *) version_str) != MYSQL_VERSION_ID)
|
||||
{
|
||||
fprintf(stderr, "Error: Server version (%s) does not match with the "
|
||||
"version of\nthe server (%s) with which this program was built/"
|
||||
"distributed. You can\nuse --skip-version-check to skip this "
|
||||
"check.\n", version_str, MYSQL_SERVER_VERSION);
|
||||
fprintf(stderr, "Error: Server version (%s)\n"
|
||||
"does not match the version of the server (%s)\n"
|
||||
"with which this program was built/distributed. You can\n"
|
||||
"use --skip-version-check to skip this check.\n",
|
||||
version_str, MYSQL_SERVER_VERSION);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
@@ -1493,18 +1508,14 @@ int main(int argc, char **argv)
|
||||
if (run_mysqlcheck_upgrade(TRUE) ||
|
||||
install_used_engines() ||
|
||||
install_used_plugin_data_types() ||
|
||||
run_mysqlcheck_views() ||
|
||||
run_sql_fix_privilege_tables() ||
|
||||
run_mysqlcheck_views() ||
|
||||
run_mysqlcheck_fixnames() ||
|
||||
run_mysqlcheck_upgrade(FALSE) ||
|
||||
check_slave_repositories())
|
||||
check_slave_repositories() ||
|
||||
uninstall_plugins() ||
|
||||
flush_privileges())
|
||||
die("Upgrade failed" );
|
||||
|
||||
uninstall_plugins();
|
||||
verbose("Phase %d/%d: Running 'FLUSH PRIVILEGES'", ++phase, phases_total);
|
||||
if (run_query("FLUSH PRIVILEGES", NULL, TRUE))
|
||||
die("Upgrade failed" );
|
||||
|
||||
verbose("OK");
|
||||
|
||||
/* Finish writing indicating upgrade has been performed */
|
||||
|
Reference in New Issue
Block a user