diff options
author | cmiller@zippy.cornsilk.net <> | 2007-04-27 16:45:01 -0400 |
---|---|---|
committer | cmiller@zippy.cornsilk.net <> | 2007-04-27 16:45:01 -0400 |
commit | 71a0ecee6e2241f6f1fcf8216b37067b5ac0161b (patch) | |
tree | dc6a3a60b71e4a3cbaadb6dc739d736ab8014ac5 /client/mysqlcheck.c | |
parent | db6eab9bfad52911af5f5aa26c1dd107ad422079 (diff) | |
parent | 9dd7812fec682bc7494623f76338e099f0ffe578 (diff) | |
download | mariadb-git-71a0ecee6e2241f6f1fcf8216b37067b5ac0161b.tar.gz |
Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-enterprise-formergecomm
into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-unified02
Diffstat (limited to 'client/mysqlcheck.c')
-rw-r--r-- | client/mysqlcheck.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index 43a938badbe..28b3103c53e 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -472,14 +472,17 @@ static int process_all_tables_in_db(char *database) { MYSQL_RES *res; MYSQL_ROW row; + uint num_columns; LINT_INIT(res); if (use_db(database)) return 1; - if (mysql_query(sock, "SHOW TABLE STATUS") || + if (mysql_query(sock, "SHOW /*!50002 FULL*/ TABLES") || !((res= mysql_store_result(sock)))) return 1; + num_columns= mysql_num_fields(res); + if (opt_all_in_1) { /* @@ -502,12 +505,11 @@ static int process_all_tables_in_db(char *database) } for (end = tables + 1; (row = mysql_fetch_row(res)) ;) { - /* Skip tables with an engine of NULL (probably a view). */ - if (row[1]) - { - end= fix_table_name(end, row[0]); - *end++= ','; - } + if ((num_columns == 2) && (strcmp(row[1], "VIEW") == 0)) + continue; + + end= fix_table_name(end, row[0]); + *end++= ','; } *--end = 0; if (tot_length) @@ -517,11 +519,12 @@ static int process_all_tables_in_db(char *database) else { while ((row = mysql_fetch_row(res))) - /* Skip tables with an engine of NULL (probably a view). */ - if (row[1]) - { - handle_request_for_tables(row[0], strlen(row[0])); - } + { + if ((num_columns == 2) && (strcmp(row[1], "VIEW") == 0)) + continue; + + handle_request_for_tables(row[0], strlen(row[0])); + } } mysql_free_result(res); return 0; |