Commit 3d06f0f7 authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-11942 BLACKHOLE is no longer active in 10.1 by default, mysql_upgrade not...

MDEV-11942 BLACKHOLE is no longer active in 10.1 by default, mysql_upgrade not handling the situation

fix the patch. add tests
parent c372388e
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#endif #endif
static int phase = 0; static int phase = 0;
static int phases_total = 6; static const int phases_total = 7;
static char mysql_path[FN_REFLEN]; static char mysql_path[FN_REFLEN];
static char mysqlcheck_path[FN_REFLEN]; static char mysqlcheck_path[FN_REFLEN];
...@@ -69,6 +69,8 @@ static char **defaults_argv; ...@@ -69,6 +69,8 @@ static char **defaults_argv;
static my_bool not_used; /* Can't use GET_BOOL without a value pointer */ static my_bool not_used; /* Can't use GET_BOOL without a value pointer */
char upgrade_from_version[sizeof("10.20.456-MariaDB")+1];
static my_bool opt_write_binlog; static my_bool opt_write_binlog;
#define OPT_SILENT OPT_MAX_CLIENT_OPTION #define OPT_SILENT OPT_MAX_CLIENT_OPTION
...@@ -675,7 +677,6 @@ static int upgrade_already_done(void) ...@@ -675,7 +677,6 @@ static int upgrade_already_done(void)
{ {
FILE *in; FILE *in;
char upgrade_info_file[FN_REFLEN]= {0}; char upgrade_info_file[FN_REFLEN]= {0};
char buf[sizeof(MYSQL_SERVER_VERSION)+1];
if (get_upgrade_info_file_name(upgrade_info_file)) if (get_upgrade_info_file_name(upgrade_info_file))
return 0; /* Could not get filename => not sure */ return 0; /* Could not get filename => not sure */
...@@ -683,15 +684,15 @@ static int upgrade_already_done(void) ...@@ -683,15 +684,15 @@ static int upgrade_already_done(void)
if (!(in= my_fopen(upgrade_info_file, O_RDONLY, MYF(0)))) if (!(in= my_fopen(upgrade_info_file, O_RDONLY, MYF(0))))
return 0; /* Could not open file => not sure */ return 0; /* Could not open file => not sure */
bzero(buf, sizeof(buf)); bzero(upgrade_from_version, sizeof(upgrade_from_version));
if (!fgets(buf, sizeof(buf), in)) if (!fgets(upgrade_from_version, sizeof(upgrade_from_version), in))
{ {
/* Ignore, will be detected by strncmp() below */ /* Ignore, will be detected by strncmp() below */
} }
my_fclose(in, MYF(0)); my_fclose(in, MYF(0));
return (strncmp(buf, MYSQL_SERVER_VERSION, return (strncmp(upgrade_from_version, MYSQL_SERVER_VERSION,
sizeof(MYSQL_SERVER_VERSION)-1)==0); sizeof(MYSQL_SERVER_VERSION)-1)==0);
} }
...@@ -924,24 +925,48 @@ static void print_line(char* line) ...@@ -924,24 +925,48 @@ static void print_line(char* line)
fputc('\n', stderr); fputc('\n', stderr);
} }
static my_bool from_before_10_1()
{
my_bool ret= TRUE;
DYNAMIC_STRING ds_events_struct;
if (upgrade_from_version[0])
{
return upgrade_from_version[1] == '.' ||
strncmp(upgrade_from_version, "10.1.", 5) < 0;
}
if (init_dynamic_string(&ds_events_struct, NULL, 2048, 2048))
die("Out of memory");
if (run_query("show create table mysql.user", &ds_events_struct, FALSE) ||
strstr(ds_events_struct.str, "default_role") != NULL)
ret= FALSE;
else
verbose("Upgrading from a version before MariaDB-10.1");
dynstr_free(&ds_events_struct);
return ret;
}
/* /*
Check for entries with "Unknown storage engine" in I_S.TABLES, Check for entries with "Unknown storage engine" in I_S.TABLES,
try to load plugins for these tables if available (MDEV-11942) try to load plugins for these tables if available (MDEV-11942)
*/ */
static int run_mysqlcheck_engines(void) static int install_used_engines(void)
{ {
DYNAMIC_STRING ds_query; char buf[512];
DYNAMIC_STRING ds_result; DYNAMIC_STRING ds_result;
const char *query = "SELECT DISTINCT LOWER(engine) FROM information_schema.tables"
" WHERE table_comment LIKE 'Unknown storage engine%'";
/* Trying to identify existing tables with unknown storage engine if (opt_systables_only || !from_before_10_1())
Does not work with all engine types yet, and doesn't produce {
results for BLACKHOLE without the dummy "WHERE row_format IS NULL" verbose("Phase %d/%d: Installing used storage engines... Skipped", ++phase, phases_total);
condition yet. See MDEV-11943 */ return 0;
const char *query = "SELECT DISTINCT LOWER(REPLACE(REPLACE(table_comment, 'Unknown storage engine ', ''), '\\'', '')) AS engine FROM information_schema.tables WHERE row_format IS NULL AND table_comment LIKE 'Unknown storage engine%'"; }
verbose("Phase %d/%d: Installing used storage engines", ++phase, phases_total);
if (init_dynamic_string(&ds_query, "", 512, 512))
die("Out of memory");
if (init_dynamic_string(&ds_result, "", 512, 512)) if (init_dynamic_string(&ds_result, "", 512, 512))
die("Out of memory"); die("Out of memory");
...@@ -950,24 +975,28 @@ static int run_mysqlcheck_engines(void) ...@@ -950,24 +975,28 @@ static int run_mysqlcheck_engines(void)
run_query(query, &ds_result, TRUE); run_query(query, &ds_result, TRUE);
if (ds_result.length)
{ {
char *line= ds_result.str; char *line= ds_result.str, *next=get_line(line);
if (line && *line) { do
do {
{ if (next[-1] == '\n')
line[strlen(line)-1]='\0'; next[-1]=0;
verbose("installing missing plugin for '%s' storage engine", line);
dynstr_set(&ds_query, "INSTALL SONAME 'ha_"); verbose("installing plugin for '%s' storage engine", line);
dynstr_append(&ds_query, line); // we simply assume SONAME=ha_ENGINENAME
dynstr_append(&ds_query, "'");
if (run_query(ds_query.str, NULL, TRUE)) { // we simply assume soname=ha_enginename
fprintf(stderr, "... can't install plugin 'ha_%s'\n", line); strxnmov(buf, sizeof(buf)-1, "install soname 'ha_", line, "'", NULL);
}
} while ((line= get_line(line)) && *line);
} if (run_query(buf, NULL, TRUE))
fprintf(stderr, "... can't %s\n", buf);
line=next;
next=get_line(line);
} while (*line);
} }
dynstr_free(&ds_result);
return 0;
} }
...@@ -1176,8 +1205,8 @@ int main(int argc, char **argv) ...@@ -1176,8 +1205,8 @@ int main(int argc, char **argv)
/* /*
Run "mysqlcheck" and "mysql_fix_privilege_tables.sql" Run "mysqlcheck" and "mysql_fix_privilege_tables.sql"
*/ */
if (run_mysqlcheck_engines() || if (run_mysqlcheck_upgrade(TRUE) ||
run_mysqlcheck_upgrade(TRUE) || install_used_engines() ||
run_mysqlcheck_views() || run_mysqlcheck_views() ||
run_sql_fix_privilege_tables() || run_sql_fix_privilege_tables() ||
run_mysqlcheck_fixnames() || run_mysqlcheck_fixnames() ||
...@@ -1200,4 +1229,3 @@ int main(int argc, char **argv) ...@@ -1200,4 +1229,3 @@ int main(int argc, char **argv)
my_end(my_end_arg); my_end(my_end_arg);
exit(0); exit(0);
} }
...@@ -227,7 +227,7 @@ DROP TABLE mysql050614_xxx_croatian_ci; ...@@ -227,7 +227,7 @@ DROP TABLE mysql050614_xxx_croatian_ci;
# Checking mysql_upgrade # Checking mysql_upgrade
# #
# Running mysql_upgrade # Running mysql_upgrade
Phase 1/6: Checking and upgrading mysql database Phase 1/7: Checking and upgrading mysql database
Processing databases Processing databases
mysql mysql
mysql.column_stats OK mysql.column_stats OK
...@@ -258,10 +258,11 @@ mysql.time_zone_name OK ...@@ -258,10 +258,11 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK mysql.time_zone_transition OK
mysql.time_zone_transition_type OK mysql.time_zone_transition_type OK
mysql.user OK mysql.user OK
Phase 2/6: Fixing views Phase 2/7: Installing used storage engines... Skipped
Phase 3/6: Running 'mysql_fix_privilege_tables' Phase 3/7: Fixing views
Phase 4/6: Fixing table and database names Phase 4/7: Running 'mysql_fix_privilege_tables'
Phase 5/6: Checking and upgrading tables Phase 5/7: Fixing table and database names
Phase 6/7: Checking and upgrading tables
Processing databases Processing databases
information_schema information_schema
mtr mtr
...@@ -280,11 +281,11 @@ test.maria050313_ucs2_croatian_ci_def OK ...@@ -280,11 +281,11 @@ test.maria050313_ucs2_croatian_ci_def OK
test.maria050313_utf8_croatian_ci OK test.maria050313_utf8_croatian_ci OK
test.maria050533_xxx_croatian_ci OK test.maria050533_xxx_croatian_ci OK
test.maria100004_xxx_croatian_ci OK test.maria100004_xxx_croatian_ci OK
Phase 6/6: Running 'FLUSH PRIVILEGES' Phase 7/7: Running 'FLUSH PRIVILEGES'
OK OK
# Running mysql_upgrade for the second time # Running mysql_upgrade for the second time
# This should report OK for all tables # This should report OK for all tables
Phase 1/6: Checking and upgrading mysql database Phase 1/7: Checking and upgrading mysql database
Processing databases Processing databases
mysql mysql
mysql.column_stats OK mysql.column_stats OK
...@@ -315,10 +316,11 @@ mysql.time_zone_name OK ...@@ -315,10 +316,11 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK mysql.time_zone_transition OK
mysql.time_zone_transition_type OK mysql.time_zone_transition_type OK
mysql.user OK mysql.user OK
Phase 2/6: Fixing views Phase 2/7: Installing used storage engines... Skipped
Phase 3/6: Running 'mysql_fix_privilege_tables' Phase 3/7: Fixing views
Phase 4/6: Fixing table and database names Phase 4/7: Running 'mysql_fix_privilege_tables'
Phase 5/6: Checking and upgrading tables Phase 5/7: Fixing table and database names
Phase 6/7: Checking and upgrading tables
Processing databases Processing databases
information_schema information_schema
mtr mtr
...@@ -331,7 +333,7 @@ test.maria050313_utf8_croatian_ci OK ...@@ -331,7 +333,7 @@ test.maria050313_utf8_croatian_ci OK
test.maria050533_xxx_croatian_ci OK test.maria050533_xxx_croatian_ci OK
test.maria100004_xxx_croatian_ci OK test.maria100004_xxx_croatian_ci OK
test.mysql050614_xxx_croatian_ci OK test.mysql050614_xxx_croatian_ci OK
Phase 6/6: Running 'FLUSH PRIVILEGES' Phase 7/7: Running 'FLUSH PRIVILEGES'
OK OK
SHOW CREATE TABLE maria050313_ucs2_croatian_ci_def; SHOW CREATE TABLE maria050313_ucs2_croatian_ci_def;
Table Create Table Table Create Table
......
...@@ -11,7 +11,7 @@ Table Op Msg_type Msg_text ...@@ -11,7 +11,7 @@ Table Op Msg_type Msg_text
test.bug49823 repair status OK test.bug49823 repair status OK
RENAME TABLE general_log TO renamed_general_log; RENAME TABLE general_log TO renamed_general_log;
RENAME TABLE test.bug49823 TO general_log; RENAME TABLE test.bug49823 TO general_log;
Phase 1/6: Checking and upgrading mysql database Phase 1/7: Checking and upgrading mysql database
Processing databases Processing databases
mysql mysql
mysql.column_stats OK mysql.column_stats OK
...@@ -43,10 +43,11 @@ mysql.time_zone_name OK ...@@ -43,10 +43,11 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK mysql.time_zone_transition OK
mysql.time_zone_transition_type OK mysql.time_zone_transition_type OK
mysql.user OK mysql.user OK
Phase 2/6: Fixing views Phase 2/7: Installing used storage engines... Skipped
Phase 3/6: Running 'mysql_fix_privilege_tables' Phase 3/7: Fixing views
Phase 4/6: Fixing table and database names Phase 4/7: Running 'mysql_fix_privilege_tables'
Phase 5/6: Checking and upgrading tables Phase 5/7: Fixing table and database names
Phase 6/7: Checking and upgrading tables
Processing databases Processing databases
information_schema information_schema
mtr mtr
...@@ -54,7 +55,7 @@ mtr.global_suppressions OK ...@@ -54,7 +55,7 @@ mtr.global_suppressions OK
mtr.test_suppressions OK mtr.test_suppressions OK
performance_schema performance_schema
test test
Phase 6/6: Running 'FLUSH PRIVILEGES' Phase 7/7: Running 'FLUSH PRIVILEGES'
OK OK
DROP TABLE general_log; DROP TABLE general_log;
RENAME TABLE renamed_general_log TO general_log; RENAME TABLE renamed_general_log TO general_log;
......
update mysql.user set password=password("foo") where user='root'; update mysql.user set password=password("foo") where user='root';
Phase 1/6: Checking and upgrading mysql database Phase 1/7: Checking and upgrading mysql database
Processing databases Processing databases
mysql mysql
mysql.column_stats OK mysql.column_stats OK
...@@ -42,10 +42,11 @@ error : Corrupt ...@@ -42,10 +42,11 @@ error : Corrupt
mysql.innodb_table_stats mysql.innodb_table_stats
Error : Unknown storage engine 'InnoDB' Error : Unknown storage engine 'InnoDB'
error : Corrupt error : Corrupt
Phase 2/6: Fixing views Phase 2/7: Installing used storage engines... Skipped
Phase 3/6: Running 'mysql_fix_privilege_tables' Phase 3/7: Fixing views
Phase 4/6: Fixing table and database names Phase 4/7: Running 'mysql_fix_privilege_tables'
Phase 5/6: Checking and upgrading tables Phase 5/7: Fixing table and database names
Phase 6/7: Checking and upgrading tables
Processing databases Processing databases
information_schema information_schema
mtr mtr
...@@ -53,7 +54,7 @@ mtr.global_suppressions OK ...@@ -53,7 +54,7 @@ mtr.global_suppressions OK
mtr.test_suppressions OK mtr.test_suppressions OK
performance_schema performance_schema
test test
Phase 6/6: Running 'FLUSH PRIVILEGES' Phase 7/7: Running 'FLUSH PRIVILEGES'
OK OK
update mysql.user set password='' where user='root'; update mysql.user set password='' where user='root';
flush privileges; flush privileges;
......
This diff is collapsed.
The --upgrade-system-tables option was used, user tables won't be touched. The --upgrade-system-tables option was used, user tables won't be touched.
Phase 1/6: Checking and upgrading mysql database Phase 1/7: Checking and upgrading mysql database
Processing databases Processing databases
mysql mysql
mysql.column_stats OK mysql.column_stats OK
...@@ -42,9 +42,10 @@ error : Corrupt ...@@ -42,9 +42,10 @@ error : Corrupt
mysql.innodb_table_stats mysql.innodb_table_stats
Error : Unknown storage engine 'InnoDB' Error : Unknown storage engine 'InnoDB'
error : Corrupt error : Corrupt
Phase 2/6: Fixing views... Skipped Phase 2/7: Installing used storage engines... Skipped
Phase 3/6: Running 'mysql_fix_privilege_tables' Phase 3/7: Fixing views... Skipped
Phase 4/6: Fixing table and database names ... Skipped Phase 4/7: Running 'mysql_fix_privilege_tables'
Phase 5/6: Checking and upgrading tables... Skipped Phase 5/7: Fixing table and database names ... Skipped
Phase 6/6: Running 'FLUSH PRIVILEGES' Phase 6/7: Checking and upgrading tables... Skipped
Phase 7/7: Running 'FLUSH PRIVILEGES'
OK OK
This diff is collapsed.
# #
# Bug#55672 mysql_upgrade dies with internal error # Bug#55672 mysql_upgrade dies with internal error
# #
Phase 1/6: Checking and upgrading mysql database Phase 1/7: Checking and upgrading mysql database
Processing databases Processing databases
mysql mysql
mysql.column_stats OK mysql.column_stats OK
...@@ -32,10 +32,11 @@ mysql.time_zone_name OK ...@@ -32,10 +32,11 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK mysql.time_zone_transition OK
mysql.time_zone_transition_type OK mysql.time_zone_transition_type OK
mysql.user OK mysql.user OK
Phase 2/6: Fixing views Phase 2/7: Installing used storage engines... Skipped
Phase 3/6: Running 'mysql_fix_privilege_tables' Phase 3/7: Fixing views
Phase 4/6: Fixing table and database names Phase 4/7: Running 'mysql_fix_privilege_tables'
Phase 5/6: Checking and upgrading tables Phase 5/7: Fixing table and database names
Phase 6/7: Checking and upgrading tables
Processing databases Processing databases
information_schema information_schema
mtr mtr
...@@ -43,5 +44,5 @@ mtr.global_suppressions OK ...@@ -43,5 +44,5 @@ mtr.global_suppressions OK
mtr.test_suppressions OK mtr.test_suppressions OK
performance_schema performance_schema
test test
Phase 6/6: Running 'FLUSH PRIVILEGES' Phase 7/7: Running 'FLUSH PRIVILEGES'
OK OK
...@@ -63,7 +63,7 @@ test.v2 check error Upgrade required. Please do "REPAIR VIEW `v2`" or dump/reloa ...@@ -63,7 +63,7 @@ test.v2 check error Upgrade required. Please do "REPAIR VIEW `v2`" or dump/reloa
check view v3 for upgrade; check view v3 for upgrade;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.v3 check error Upgrade required. Please do "REPAIR VIEW `v3`" or dump/reload to fix it! test.v3 check error Upgrade required. Please do "REPAIR VIEW `v3`" or dump/reload to fix it!
Phase 1/6: Checking and upgrading mysql database Phase 1/7: Checking and upgrading mysql database
Processing databases Processing databases
mysql mysql
mysql.column_stats OK mysql.column_stats OK
...@@ -106,14 +106,15 @@ error : Corrupt ...@@ -106,14 +106,15 @@ error : Corrupt
mysql.innodb_table_stats mysql.innodb_table_stats
Error : Unknown storage engine 'InnoDB' Error : Unknown storage engine 'InnoDB'
error : Corrupt error : Corrupt
Phase 2/6: Fixing views Phase 2/7: Installing used storage engines... Skipped
Phase 3/7: Fixing views
test.v1 OK test.v1 OK
test.v1badcheck OK test.v1badcheck OK
test.v2 OK test.v2 OK
test.v3 OK test.v3 OK
Phase 3/6: Running 'mysql_fix_privilege_tables' Phase 4/7: Running 'mysql_fix_privilege_tables'
Phase 4/6: Fixing table and database names Phase 5/7: Fixing table and database names
Phase 5/6: Checking and upgrading tables Phase 6/7: Checking and upgrading tables
Processing databases Processing databases
information_schema information_schema
mtr mtr
...@@ -123,7 +124,7 @@ performance_schema ...@@ -123,7 +124,7 @@ performance_schema
test test
test.kv OK test.kv OK
test.t1 OK test.t1 OK
Phase 6/6: Running 'FLUSH PRIVILEGES' Phase 7/7: Running 'FLUSH PRIVILEGES'
OK OK
show create view v1; show create view v1;
View Create View character_set_client collation_connection View Create View character_set_client collation_connection
...@@ -205,7 +206,7 @@ show create view v4; ...@@ -205,7 +206,7 @@ show create view v4;
View Create View character_set_client collation_connection View Create View character_set_client collation_connection
v4 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v4` AS select `t1`.`a` AS `a` from `t1` latin1 latin1_swedish_ci v4 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v4` AS select `t1`.`a` AS `a` from `t1` latin1 latin1_swedish_ci
MySQL upgrade detected MySQL upgrade detected
Phase 1/6: Checking and upgrading mysql database Phase 1/7: Checking and upgrading mysql database
Processing databases Processing databases
mysql mysql
mysql.column_stats OK mysql.column_stats OK
...@@ -249,14 +250,15 @@ error : Corrupt ...@@ -249,14 +250,15 @@ error : Corrupt
mysql.innodb_table_stats mysql.innodb_table_stats
Error : Unknown storage engine 'InnoDB' Error : Unknown storage engine 'InnoDB'
error : Corrupt error : Corrupt
Phase 2/6: Fixing views from mysql Phase 2/7: Installing used storage engines... Skipped
Phase 3/7: Fixing views from mysql
test.v1 OK test.v1 OK
test.v2 OK test.v2 OK
test.v3 OK test.v3 OK
test.v4 OK test.v4 OK
Phase 3/6: Running 'mysql_fix_privilege_tables' Phase 4/7: Running 'mysql_fix_privilege_tables'
Phase 4/6: Fixing table and database names Phase 5/7: Fixing table and database names
Phase 5/6: Checking and upgrading tables Phase 6/7: Checking and upgrading tables
Processing databases Processing databases
information_schema information_schema
mtr mtr
...@@ -266,7 +268,7 @@ performance_schema ...@@ -266,7 +268,7 @@ performance_schema
test test
test.kv OK test.kv OK
test.t1 OK test.t1 OK
Phase 6/6: Running 'FLUSH PRIVILEGES' Phase 7/7: Running 'FLUSH PRIVILEGES'
OK OK
flush tables; flush tables;
show create view v1; show create view v1;
...@@ -323,7 +325,7 @@ rename table mysql.event to mysql.ev_bk; ...@@ -323,7 +325,7 @@ rename table mysql.event to mysql.ev_bk;
flush tables; flush tables;
The --upgrade-system-tables option was used, user tables won't be touched. The --upgrade-system-tables option was used, user tables won't be touched.
MySQL upgrade detected MySQL upgrade detected
Phase 1/6: Checking and upgrading mysql database Phase 1/7: Checking and upgrading mysql database
Processing databases Processing databases
mysql mysql
mysql.column_stats OK mysql.column_stats OK
...@@ -367,14 +369,15 @@ error : Corrupt ...@@ -367,14 +369,15 @@ error : Corrupt
mysql.innodb_table_stats mysql.innodb_table_stats
Error : Unknown storage engine 'InnoDB' Error : Unknown storage engine 'InnoDB'
error : Corrupt error : Corrupt
Phase 2/6: Fixing views from mysql Phase 2/7: Installing used storage engines... Skipped
Phase 3/7: Fixing views from mysql
test.v1 OK test.v1 OK
test.v2 OK test.v2 OK
test.v3 OK test.v3 OK
Phase 3/6: Running 'mysql_fix_privilege_tables' Phase 4/7: Running 'mysql_fix_privilege_tables'
Phase 4/6: Fixing table and database names ... Skipped Phase 5/7: Fixing table and database names ... Skipped
Phase 5/6: Checking and upgrading tables... Skipped Phase 6/7: Checking and upgrading tables... Skipped
Phase 6/6: Running 'FLUSH PRIVILEGES' Phase 7/7: Running 'FLUSH PRIVILEGES'
OK OK
drop table mysql.event; drop table mysql.event;
rename table mysql.ev_bk to mysql.event; rename table mysql.ev_bk to mysql.event;
......
#
# MDEV-11942 BLACKHOLE is no longer active in 10.1 by default, mysql_upgrade not handling the situation
#
source include/have_innodb.inc;
source include/not_embedded.inc;
if (!$HA_BLACKHOLE_SO) {
skip Need blackhole plugin;
}
if (!$HA_ARCHIVE_SO) {
skip Need Archive plugin;
}
let $datadir= `select @@datadir`;
install soname 'ha_blackhole';
install soname 'ha_archive';
vertical_results;
create table t1 (a int) engine=blackhole;
create table t2 (a int) engine=archive;
select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test';
flush tables;
uninstall plugin blackhole;
uninstall plugin archive;
select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test';
# upgrade from 10.1 - engines aren't enabled
exec $MYSQL_UPGRADE 2>&1;
select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test';
# pretend it's an upgrade from 10.0
alter table mysql.user drop column default_role, drop column max_statement_time;
# but mysql_upgrade_info tells otherwise
remove_file $datadir/mysql_upgrade_info;
write_file $datadir/mysql_upgrade_info;
10.1.10-MariaDB
EOF
# still upgrade from 10.1
exec $MYSQL_UPGRADE 2>&1;
select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test';
alter table mysql.user drop column default_role, drop column max_statement_time;
remove_file $datadir/mysql_upgrade_info;
# upgrade from 10.0 - engines are enabled
exec $MYSQL_UPGRADE 2>&1;
select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test';
drop table t1, t2;
uninstall plugin blackhole;
uninstall plugin archive;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment