summaryrefslogtreecommitdiff
path: root/heap/_check.c
diff options
context:
space:
mode:
authorunknown <monty@donna.mysql.com>2000-12-29 16:06:10 +0200
committerunknown <monty@donna.mysql.com>2000-12-29 16:06:10 +0200
commit29fa72526a22c31a79c73a00bf7b1974c44ff9d2 (patch)
tree53ef6da34dcfaf79e0e133177cccfb9bb63a9637 /heap/_check.c
parentccf4b2829882f566d5665e4ddf7eabcd6d197872 (diff)
downloadmariadb-git-29fa72526a22c31a79c73a00bf7b1974c44ff9d2.tar.gz
Fixed --no-defaults in mysqltest
BUILD/compile-pentium-debug: Use /usr/local/BerkeleyDB-dbug/ if available BUILD/compile-pentium: Use /usr/local/BerkeleyDB-opt/ if available Docs/internals.texi: Added 'unedited' documentation for mysys functions Docs/manual.texi: Cleanups client/mysql.cc: Added client language to status client/mysqltest.c: Fixed bug with --no-defaults heap/_check.c: Added option to print status. heap/hp_close.c: Update to use new status interface heap/hp_hash.c: Clean up hash function and add new experimental hash heap/hp_test1.c: Update to use new status interface heap/hp_test2.c: Update to use new status interface include/heap.h: Update to use new status interface mysql-test/r/key_diff.result: Cleanup tests that may give rows in random order mysql-test/r/type_blob.result: Removed \r from output as this confused bk mysql-test/t/key_diff.test: Cleanup tests that may give rows in random order BitKeeper/etc/ignore: Added Docs/my_sys.doc to the ignore list mysql-test/t/type_blob.test: Removed \r from output as this confused bk mysys/hash.c: Add new experimental hash function scripts/safe_mysqld.sh: Added --mysqld option sql/ha_innobase.cc: Fixed store_locking sql/mysqld.cc: Cleaned up warning messages
Diffstat (limited to 'heap/_check.c')
-rw-r--r--heap/_check.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/heap/_check.c b/heap/_check.c
index 77fa0262732..e22eb5e7e4a 100644
--- a/heap/_check.c
+++ b/heap/_check.c
@@ -18,11 +18,12 @@
#include "heapdef.h"
-static int check_one_key(HP_KEYDEF *keydef,ulong records,ulong blength);
+static int check_one_key(HP_KEYDEF *keydef, uint keynr, ulong records,
+ ulong blength, my_bool print_status);
/* Returns 0 if the HEAP is ok */
-int heap_check_heap(HP_INFO *info)
+int heap_check_heap(HP_INFO *info,my_bool print_status)
{
int error;
uint key;
@@ -30,13 +31,15 @@ int heap_check_heap(HP_INFO *info)
DBUG_ENTER("heap_check_keys");
for (error=key=0 ; key < share->keys ; key++)
- error|=check_one_key(share->keydef+key,share->records,share->blength);
+ error|=check_one_key(share->keydef+key,key, share->records,share->blength,
+ print_status);
DBUG_RETURN(error);
}
-static int check_one_key(HP_KEYDEF *keydef, ulong records, ulong blength)
+static int check_one_key(HP_KEYDEF *keydef, uint keynr, ulong records,
+ ulong blength, my_bool print_status)
{
int error;
uint i,found,max_links,seek,links;
@@ -76,6 +79,9 @@ static int check_one_key(HP_KEYDEF *keydef, ulong records, ulong blength)
}
DBUG_PRINT("info",
("records: %ld seeks: %d max links: %d hitrate: %.2f",
- records,seek,max_links,(float) seek / (float) records));
+ records,seek,max_links,(float) seek / (float) (records ? records : 1)));
+ if (print_status)
+ printf("Key: %d records: %ld seeks: %d max links: %d hitrate: %.2f\n",
+ keynr, records, seek, max_links, (float) seek / (float) records);
return error;
}