From 01109952f218a1ff83875d8f438ee6ce77d8519e Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 30 Mar 2006 06:53:39 +0200 Subject: [PATCH 1/2] --- ndb/tools/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndb/tools/Makefile.am b/ndb/tools/Makefile.am index 19802367803..c8aff4da633 100644 --- a/ndb/tools/Makefile.am +++ b/ndb/tools/Makefile.am @@ -1,5 +1,5 @@ -bin_SCRIPTS = ndb_size.pl ndb_error_reporter +dist_bin_SCRIPTS = ndb_size.pl ndb_error_reporter dist_pkgdata_DATA = ndb_size.tmpl ndbtools_PROGRAMS = \ From e40b76c970b1b49cf35f5ccb29395eb454069238 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 30 Mar 2006 08:10:03 +0200 Subject: [PATCH 2/2] btr0sea.c: Added BTR_CHUNK_SIZE, removed 'chunk_size' declared after declaration block innobase/btr/btr0sea.c: Added BTR_CHUNK_SIZE, removed 'chunk_size' declared after declaration block --- innobase/btr/btr0sea.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/innobase/btr/btr0sea.c b/innobase/btr/btr0sea.c index 937883b58e1..631b33acbf2 100644 --- a/innobase/btr/btr0sea.c +++ b/innobase/btr/btr0sea.c @@ -59,6 +59,9 @@ before hash index building is started */ #define BTR_SEARCH_BUILD_LIMIT 100 +/* How many cells to check before temporarily releasing btr_search_latch */ +#define BTR_CHUNK_SIZE 10000 + /************************************************************************ Builds a hash index on a page with the given parameters. If the page already has a hash index with different parameters, the old hash index is removed. @@ -1606,10 +1609,6 @@ btr_search_validate(void) ulint* offsets = offsets_; *offsets_ = (sizeof offsets_) / sizeof *offsets_; - /* How many cells to check before temporarily releasing - btr_search_latch. */ - ulint chunk_size = 10000; - rw_lock_x_lock(&btr_search_latch); cell_count = hash_get_n_cells(btr_search_sys->hash_index); @@ -1617,7 +1616,7 @@ btr_search_validate(void) for (i = 0; i < cell_count; i++) { /* We release btr_search_latch every once in a while to give other queries a chance to run. */ - if ((i != 0) && ((i % chunk_size) == 0)) { + if ((i != 0) && ((i % BTR_CHUNK_SIZE) == 0)) { rw_lock_x_unlock(&btr_search_latch); os_thread_yield(); rw_lock_x_lock(&btr_search_latch); @@ -1676,8 +1675,8 @@ btr_search_validate(void) } } - for (i = 0; i < cell_count; i += chunk_size) { - ulint end_index = ut_min(i + chunk_size - 1, cell_count - 1); + for (i = 0; i < cell_count; i += BTR_CHUNK_SIZE) { + ulint end_index = ut_min(i + BTR_CHUNK_SIZE - 1, cell_count - 1); /* We release btr_search_latch every once in a while to give other queries a chance to run. */