From 877e3be4af04dfbd1071759ea780d07fe4a93c5b Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 19 Jun 2001 14:30:12 +0300 Subject: Fixed bug in mysqlcheck when using --fast Fixed problem when converting bigint to double. Fixed bug in count(distinct null) Fixed bug with empty BDB tables. BitKeeper/deleted/.del-ATIS-mysql-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg~dd306b2e583ebde4: Delete: sql-bench/Results/ATIS-mysql-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg BitKeeper/deleted/.del-RUN-mysql-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg~11038a44f73070e7: Delete: sql-bench/Results/RUN-mysql-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg BitKeeper/deleted/.del-alter-table-mysql-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg~662b96bc66bc91b6: Delete: sql-bench/Results/alter-table-mysql-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg BitKeeper/deleted/.del-big-tables-mysql-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg~788ad492867b1226: Delete: sql-bench/Results/big-tables-mysql-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg BitKeeper/deleted/.del-connect-mysql-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg~5316add301edb60: Delete: sql-bench/Results/connect-mysql-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg BitKeeper/deleted/.del-create-mysql-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg~26e09af61f88d8c9: Delete: sql-bench/Results/create-mysql-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg BitKeeper/deleted/.del-insert-mysql-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg~fd2699adb3190d07: Delete: sql-bench/Results/insert-mysql-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg BitKeeper/deleted/.del-select-mysql-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg~b01175ad38fd12b6: Delete: sql-bench/Results/select-mysql-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg BitKeeper/deleted/.del-wisconsin-mysql-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg~8ba598d217450157: Delete: sql-bench/Results/wisconsin-mysql-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg Docs/manual.texi: Changelog + update to Linux section client/mysqlcheck.c: Fixed bug when using --fast --check --auto-repair --fast will not anymore repair tables that had warnings but where ok. mysql-test/r/bdb.result: New test case mysql-test/r/bigint.result: New test case mysql-test/r/count_distinct.result: New test case mysql-test/t/bdb.test: New test case mysql-test/t/bigint.test: New test case mysql-test/t/count_distinct.test: New test case sql-bench/Comments/postgres.benchmark: Update for PostgreSQL 7.1.2 sql-bench/graph-compare-results.sh: Fixed colors for mysql --fast tests sql/field.cc: Fixed problem when converting bigint to double. sql/item_sum.cc: Fixed bug in count(distinct null) sql/item_sum.h: Fixed bug in count(distinct null) sql/mysqlbinlog.cc: Fixed typo sql/sql_base.cc: cleanup sql/sql_select.cc: Fixed bug with empty BDB tables. sql/time.cc: Removed warning when reading timestamps with sub seconds. --- client/mysqlcheck.c | 50 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 20 deletions(-) (limited to 'client') diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index a9379837847..ebaa8366c72 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -16,7 +16,7 @@ /* By Jani Tolonen, 2001-04-20, MySQL Development Team */ -#define CHECK_VERSION "1.01" +#define CHECK_VERSION "1.02" #include #include @@ -503,25 +503,24 @@ static int use_db(char *database) static int handle_request_for_tables(char *tables, uint length) { - char *query, *end, options[100]; + char *query, *end, options[100], message[100]; const char *op = 0; options[0] = 0; + end = options; switch (what_to_do) { case DO_CHECK: op = "CHECK"; - end = options; - if (opt_quick) end = strmov(end, "QUICK"); - if (opt_fast) end = strmov(end, "FAST"); - if (opt_medium_check) end = strmov(end, "MEDIUM"); /* Default */ - if (opt_extended) end = strmov(end, "EXTENDED"); - if (opt_check_only_changed) end = strmov(end, "CHANGED"); + if (opt_quick) end = strmov(end, " QUICK"); + if (opt_fast) end = strmov(end, " FAST"); + if (opt_medium_check) end = strmov(end, " MEDIUM"); /* Default */ + if (opt_extended) end = strmov(end, " EXTENDED"); + if (opt_check_only_changed) end = strmov(end, " CHANGED"); break; case DO_REPAIR: op = "REPAIR"; - end = options; - if (opt_quick) end = strmov(end, "QUICK"); - if (opt_extended) end = strmov(end, "EXTENDED"); + if (opt_quick) end = strmov(end, " QUICK"); + if (opt_extended) end = strmov(end, " EXTENDED"); break; case DO_ANALYZE: op = "ANALYZE"; @@ -533,11 +532,11 @@ static int handle_request_for_tables(char *tables, uint length) if (!(query =(char *) my_malloc((sizeof(char)*(length+110)), MYF(MY_WME)))) return 1; - sprintf(query, "%s TABLE %s %s", op, options, tables); + sprintf(query, "%s TABLE %s %s", op, tables, options); if (mysql_query(sock, query)) { - sprintf(options, "when executing '%s TABLE'", op); - DBerror(sock, options); + sprintf(message, "when executing '%s TABLE ... %s", op, options); + DBerror(sock, message); return 1; } print_result(); @@ -551,23 +550,34 @@ static void print_result() MYSQL_RES *res; MYSQL_ROW row; char prev[NAME_LEN*2+2]; - int i; + uint i; + my_bool found_error=0; res = mysql_use_result(sock); prev[0] = '\0'; for (i = 0; (row = mysql_fetch_row(res)); i++) { int changed = strcmp(prev, row[0]); - int status = !strcmp(row[2], "status"); - if (opt_silent && status) - continue; + my_bool status = !strcmp(row[2], "status"); + + if (status) + { + if (found_error) + { + if (what_to_do != DO_REPAIR && opt_auto_repair && + (!opt_fast || strcmp(row[3],"OK"))) + insert_dynamic(&tables4repair, row[0]); + } + found_error=0; + if (opt_silent) + continue; + } if (status && changed) printf("%-50s %s", row[0], row[3]); else if (!status && changed) { printf("%s\n%-9s: %s", row[0], row[2], row[3]); - if (what_to_do != DO_REPAIR && opt_auto_repair) - insert_dynamic(&tables4repair, row[0]); + found_error=1; } else printf("%-9s: %s", row[2], row[3]); -- cgit v1.2.1