summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Winstead <jimw@mysql.com>2009-05-20 18:31:10 -0700
committerJim Winstead <jimw@mysql.com>2009-05-20 18:31:10 -0700
commitf0f4efd77e3eb7d62176396b5ccf53d7a7029c85 (patch)
tree8bbcf7fdd84e32f5d82edf7346379e4db4e0a539
parentd57bb98ff5c62fff7d9912dd0a96ad99fcab3861 (diff)
downloadmariadb-git-f0f4efd77e3eb7d62176396b5ccf53d7a7029c85.tar.gz
mysqlcheck failed to fix table names when using the --fix-table-names
and --all-in-1 options together. (Bug #31821)
-rw-r--r--client/mysqlcheck.c4
-rw-r--r--mysql-test/r/mysqlcheck.result14
-rw-r--r--mysql-test/t/mysqlcheck.test17
3 files changed, 33 insertions, 2 deletions
diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c
index 1bdb28f5a11..83d2006b597 100644
--- a/client/mysqlcheck.c
+++ b/client/mysqlcheck.c
@@ -442,7 +442,7 @@ static int process_selected_tables(char *db, char **table_names, int tables)
{
if (use_db(db))
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`
@@ -536,7 +536,7 @@ static int process_all_tables_in_db(char *database)
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`
diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result
index 704cd7ac3f4..5f1a0565b10 100644
--- a/mysql-test/r/mysqlcheck.result
+++ b/mysql-test/r/mysqlcheck.result
@@ -186,4 +186,18 @@ a
500
DROP DATABASE `a@b`;
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
diff --git a/mysql-test/t/mysqlcheck.test b/mysql-test/t/mysqlcheck.test
index e834c60dcb5..986b5aba385 100644
--- a/mysql-test/t/mysqlcheck.test
+++ b/mysql-test/t/mysqlcheck.test
@@ -193,5 +193,22 @@ DROP DATABASE `a@b`;
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