From e0d5a6c15f00a2986f118c8a9a5b790d6d581be7 Mon Sep 17 00:00:00 2001 From: Ramil Kalimullin Date: Fri, 14 Nov 2008 11:40:46 +0400 Subject: 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 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'client/mysqlcheck.c') 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); -- cgit v1.2.1