Commit f0f4efd7 authored by Jim Winstead's avatar Jim Winstead

mysqlcheck failed to fix table names when using the --fix-table-names

and --all-in-1 options together. (Bug #31821)
parent d57bb98f
...@@ -442,7 +442,7 @@ static int process_selected_tables(char *db, char **table_names, int tables) ...@@ -442,7 +442,7 @@ static int process_selected_tables(char *db, char **table_names, int tables)
{ {
if (use_db(db)) if (use_db(db))
return 1; return 1;
if (opt_all_in_1) if (opt_all_in_1 && what_to_do != DO_UPGRADE)
{ {
/* /*
We need table list in form `a`, `b`, `c` We need table list in form `a`, `b`, `c`
...@@ -536,7 +536,7 @@ static int process_all_tables_in_db(char *database) ...@@ -536,7 +536,7 @@ static int process_all_tables_in_db(char *database)
num_columns= mysql_num_fields(res); num_columns= mysql_num_fields(res);
if (opt_all_in_1) if (opt_all_in_1 && what_to_do != DO_UPGRADE)
{ {
/* /*
We need table list in form `a`, `b`, `c` We need table list in form `a`, `b`, `c`
......
...@@ -186,4 +186,18 @@ a ...@@ -186,4 +186,18 @@ a
500 500
DROP DATABASE `a@b`; DROP DATABASE `a@b`;
USE test; USE test;
#
# Bug #31821: --all-in-1 and --fix-table-names don't work together
#
drop table if exists `#mysql50#t1-1`;
create table `#mysql50#t1-1` (a int);
show tables like 't1-1';
Tables_in_test (t1-1)
t1-1
drop table `t1-1`;
create table `#mysql50#t1-1` (a int);
show tables like 't1-1';
Tables_in_test (t1-1)
t1-1
drop table `t1-1`;
End of 5.1 tests End of 5.1 tests
...@@ -193,5 +193,22 @@ DROP DATABASE `a@b`; ...@@ -193,5 +193,22 @@ DROP DATABASE `a@b`;
USE test; USE test;
--echo #
--echo # Bug #31821: --all-in-1 and --fix-table-names don't work together
--echo #
--disable_warnings
drop table if exists `#mysql50#t1-1`;
--enable_warnings
create table `#mysql50#t1-1` (a int);
--exec $MYSQL_CHECK --all-in-1 --fix-table-names --databases test
show tables like 't1-1';
drop table `t1-1`;
create table `#mysql50#t1-1` (a int);
--exec $MYSQL_CHECK --all-in-1 --fix-table-names test "#mysql50#t1-1"
show tables like 't1-1';
drop table `t1-1`;
--echo End of 5.1 tests --echo End of 5.1 tests
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