diff options
author | Ramil Kalimullin <ramil@mysql.com> | 2008-11-14 11:40:46 +0400 |
---|---|---|
committer | Ramil Kalimullin <ramil@mysql.com> | 2008-11-14 11:40:46 +0400 |
commit | e0d5a6c15f00a2986f118c8a9a5b790d6d581be7 (patch) | |
tree | c9498f10d81fcc478d8f18c401dce3175599250f /client/mysqlcheck.c | |
parent | f88fd3feb7ea0c543e3e03da66dfe01d267e19bd (diff) | |
download | mariadb-git-e0d5a6c15f00a2986f118c8a9a5b790d6d581be7.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.
Diffstat (limited to 'client/mysqlcheck.c')
-rw-r--r-- | client/mysqlcheck.c | 9 |
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); |