summaryrefslogtreecommitdiff
path: root/innobase/ha
diff options
context:
space:
mode:
authorunknown <heikki@hundin.mysql.fi>2002-07-08 19:34:49 +0300
committerunknown <heikki@hundin.mysql.fi>2002-07-08 19:34:49 +0300
commitc0e8c9a11f0427fe6e0604eaeef5988abdb55210 (patch)
treeb4e7fbd4d1817aa205132578bc6b11e6dd0fad86 /innobase/ha
parent9eef017c5750b26b75252a2ac0679f761404d136 (diff)
downloadmariadb-git-c0e8c9a11f0427fe6e0604eaeef5988abdb55210.tar.gz
Many files:
Merge InnoDB-3.23.52b innobase/btr/btr0btr.c: Merge InnoDB-3.23.52b innobase/btr/btr0cur.c: Merge InnoDB-3.23.52b innobase/btr/btr0sea.c: Merge InnoDB-3.23.52b innobase/buf/buf0buf.c: Merge InnoDB-3.23.52b innobase/ha/ha0ha.c: Merge InnoDB-3.23.52b innobase/ibuf/ibuf0ibuf.c: Merge InnoDB-3.23.52b innobase/include/btr0cur.h: Merge InnoDB-3.23.52b innobase/include/buf0buf.h: Merge InnoDB-3.23.52b innobase/include/ha0ha.h: Merge InnoDB-3.23.52b innobase/include/ibuf0ibuf.h: Merge InnoDB-3.23.52b innobase/include/lock0lock.h: Merge InnoDB-3.23.52b innobase/include/log0log.h: Merge InnoDB-3.23.52b innobase/include/os0file.h: Merge InnoDB-3.23.52b innobase/include/rem0rec.ic: Merge InnoDB-3.23.52b innobase/include/srv0srv.h: Merge InnoDB-3.23.52b innobase/include/sync0arr.h: Merge InnoDB-3.23.52b innobase/include/sync0sync.h: Merge InnoDB-3.23.52b innobase/include/trx0trx.h: Merge InnoDB-3.23.52b innobase/lock/lock0lock.c: Merge InnoDB-3.23.52b innobase/log/log0log.c: Merge InnoDB-3.23.52b innobase/os/os0file.c: Merge InnoDB-3.23.52b innobase/row/row0mysql.c: Merge InnoDB-3.23.52b innobase/row/row0umod.c: Merge InnoDB-3.23.52b innobase/row/row0upd.c: Merge InnoDB-3.23.52b innobase/srv/srv0srv.c: Merge InnoDB-3.23.52b innobase/srv/srv0start.c: Merge InnoDB-3.23.52b innobase/sync/sync0arr.c: Merge InnoDB-3.23.52b innobase/sync/sync0sync.c: Merge InnoDB-3.23.52b innobase/trx/trx0trx.c: Merge InnoDB-3.23.52b sql/ha_innobase.h: Merge InnoDB-3.23.52b sql/ha_innobase.cc: Merge InnoDB-3.23.52b sql/sql_lex.h: Merge InnoDB-3.23.52b sql/mysqld.cc: Merge InnoDB-3.23.52b sql/sql_parse.cc: Merge InnoDB-3.23.52b sql/sql_yacc.yy: Merge InnoDB-3.23.52b
Diffstat (limited to 'innobase/ha')
-rw-r--r--innobase/ha/ha0ha.c43
1 files changed, 33 insertions, 10 deletions
diff --git a/innobase/ha/ha0ha.c b/innobase/ha/ha0ha.c
index 3e4473126cf..c3ad6cdca76 100644
--- a/innobase/ha/ha0ha.c
+++ b/innobase/ha/ha0ha.c
@@ -194,7 +194,7 @@ ha_delete(
node = ha_search_with_data(table, fold, data);
- ut_ad(node);
+ ut_a(node);
ha_delete_hash_node(table, node);
}
@@ -232,6 +232,16 @@ ha_remove_all_nodes_to_page(
node = ha_chain_get_next(table, node);
}
}
+
+ /* Check that all nodes really got deleted */
+
+ node = ha_chain_get_first(table, fold);
+
+ while (node) {
+ ut_a(buf_frame_align(ha_node_get_data(node)) != page);
+
+ node = ha_chain_get_next(table, node);
+ }
}
/*****************************************************************
@@ -245,6 +255,7 @@ ha_validate(
{
hash_cell_t* cell;
ha_node_t* node;
+ ibool ok = TRUE;
ulint i;
for (i = 0; i < hash_get_n_cells(table); i++) {
@@ -254,13 +265,21 @@ ha_validate(
node = cell->node;
while (node) {
- ut_a(hash_calc_hash(node->fold, table) == i);
+ if (hash_calc_hash(node->fold, table) != i) {
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+"InnoDB: Error: hash table node fold value %lu does not\n"
+"InnoDB: match with the cell number %lu.\n",
+ node->fold, i);
+
+ ok = FALSE;
+ }
node = node->next;
}
}
- return(TRUE);
+ return(ok);
}
/*****************************************************************
@@ -269,16 +288,22 @@ Prints info of a hash table. */
void
ha_print_info(
/*==========*/
+ char* buf, /* in/out: buffer where to print */
+ char* buf_end,/* in: buffer end */
hash_table_t* table) /* in: hash table */
{
hash_cell_t* cell;
- ha_node_t* node;
+/* ha_node_t* node; */
ulint nodes = 0;
ulint cells = 0;
ulint len = 0;
ulint max_len = 0;
ulint i;
+ if (buf_end - buf < 200) {
+ return;
+ }
+
for (i = 0; i < hash_get_n_cells(table); i++) {
cell = hash_get_nth_cell(table, i);
@@ -286,7 +311,7 @@ ha_print_info(
if (cell->node) {
cells++;
-
+/*
len = 0;
node = cell->node;
@@ -306,12 +331,10 @@ ha_print_info(
if (len > max_len) {
max_len = len;
}
+*/
}
}
- printf("Hash table size %lu, used cells %lu, nodes %lu\n",
- hash_get_n_cells(table), cells, nodes);
- printf("max chain length %lu\n", max_len);
-
- ut_a(ha_validate(table));
+ buf += sprintf(buf, "Hash table size %lu, used cells %lu\n",
+ hash_get_n_cells(table), cells);
}