summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorRamil Kalimullin <ramil@mysql.com>2008-11-14 11:40:46 +0400
committerRamil Kalimullin <ramil@mysql.com>2008-11-14 11:40:46 +0400
commite3de8d361efbe43d505665ddc959fef77400ca8a (patch)
treec9498f10d81fcc478d8f18c401dce3175599250f /client
parentf5583481e3439a74e22170eab631755cc094c32c (diff)
downloadmariadb-git-e3de8d361efbe43d505665ddc959fef77400ca8a.tar.gz
Fix for bug#37527: mysqlcheck fails to report entire database
when InnoDB frm file corruption Problem: mysqlcheck runs 'SHOW FULL TABLE' queries to get table lists. The query may fail for some reasons (e.g. null .frm file) then mysqlcheck doesn't process the database tables. Fix: try to run 'SHOW TABLES' if 'SHOW FULL TABLES' failed. client/mysqlcheck.c: Fix for bug#37527: mysqlcheck fails to report entire database when InnoDB frm file corruption - run "SHOW TABLES" query if "SHOW /*!50002 FULL*/ TABLES" failed; - print error info if both failed. mysql-test/r/mysqlcheck.result: Fix for bug#37527: mysqlcheck fails to report entire database when InnoDB frm file corruption - test result. mysql-test/t/mysqlcheck.test: Fix for bug#37527: mysqlcheck fails to report entire database when InnoDB frm file corruption - test case.
Diffstat (limited to 'client')
-rw-r--r--client/mysqlcheck.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c
index 473e172adf9..513d1974ed0 100644
--- a/client/mysqlcheck.c
+++ b/client/mysqlcheck.c
@@ -488,9 +488,14 @@ static int process_all_tables_in_db(char *database)
LINT_INIT(res);
if (use_db(database))
return 1;
- if (mysql_query(sock, "SHOW /*!50002 FULL*/ TABLES") ||
- !((res= mysql_store_result(sock))))
+ if ((mysql_query(sock, "SHOW /*!50002 FULL*/ TABLES") &&
+ mysql_query(sock, "SHOW TABLES")) ||
+ !(res= mysql_store_result(sock)))
+ {
+ my_printf_error(0, "Error: Couldn't get table list for database %s: %s",
+ MYF(0), database, mysql_error(sock));
return 1;
+ }
num_columns= mysql_num_fields(res);