summaryrefslogtreecommitdiff
path: root/innobase/include/buf0buf.ic
diff options
context:
space:
mode:
authorunknown <heikki@hundin.mysql.fi>2002-08-02 23:16:19 +0300
committerunknown <heikki@hundin.mysql.fi>2002-08-02 23:16:19 +0300
commit0ebb78e8ef8fa1fc77ac8c9caeb8cbd37337030a (patch)
tree79d62af7e6f5f927672de74cbb469640fe4ff3bd /innobase/include/buf0buf.ic
parentdd764d999ee270d3e3ad5e14881b7b16c247d762 (diff)
downloadmariadb-git-0ebb78e8ef8fa1fc77ac8c9caeb8cbd37337030a.tar.gz
Many files:
Merge InnoDB-3.23.52c ha_innobase.cc: Test the ref length sanity also in the production version sql/ha_innobase.cc: Test the ref length sanity also in the production version innobase/btr/btr0cur.c: Merge InnoDB-3.23.52c innobase/buf/buf0buf.c: Merge InnoDB-3.23.52c innobase/buf/buf0lru.c: Merge InnoDB-3.23.52c innobase/ha/ha0ha.c: Merge InnoDB-3.23.52c innobase/log/log0recv.c: Merge InnoDB-3.23.52c innobase/mtr/mtr0log.c: Merge InnoDB-3.23.52c innobase/os/os0file.c: Merge InnoDB-3.23.52c innobase/page/page0cur.c: Merge InnoDB-3.23.52c innobase/include/btr0btr.h: Merge InnoDB-3.23.52c innobase/include/dyn0dyn.h: Merge InnoDB-3.23.52c innobase/include/log0recv.h: Merge InnoDB-3.23.52c innobase/include/buf0buf.ic: Merge InnoDB-3.23.52c innobase/include/log0log.ic: Merge InnoDB-3.23.52c
Diffstat (limited to 'innobase/include/buf0buf.ic')
-rw-r--r--innobase/include/buf0buf.ic37
1 files changed, 29 insertions, 8 deletions
diff --git a/innobase/include/buf0buf.ic b/innobase/include/buf0buf.ic
index 50248a7b2da..51e2541e04d 100644
--- a/innobase/include/buf0buf.ic
+++ b/innobase/include/buf0buf.ic
@@ -211,8 +211,15 @@ buf_block_align(
block = buf_pool_get_nth_block(buf_pool, ((ulint)(ptr - frame_zero))
>> UNIV_PAGE_SIZE_SHIFT);
- ut_a(block >= buf_pool->blocks);
- ut_a(block < buf_pool->blocks + buf_pool->max_size);
+ if (block < buf_pool->blocks
+ || block >= buf_pool->blocks + buf_pool->max_size) {
+
+ fprintf(stderr,
+"InnoDB: Error: trying to access a stray pointer %lx\n"
+"InnoDB: buf pool start is at %lx, number of pages %lu\n", (ulint)ptr,
+ (ulint)frame_zero, buf_pool->max_size);
+ ut_a(0);
+ }
return(block);
}
@@ -238,8 +245,15 @@ buf_block_align_low(
block = buf_pool_get_nth_block(buf_pool, ((ulint)(ptr - frame_zero))
>> UNIV_PAGE_SIZE_SHIFT);
- ut_a(block >= buf_pool->blocks);
- ut_a(block < buf_pool->blocks + buf_pool->max_size);
+ if (block < buf_pool->blocks
+ || block >= buf_pool->blocks + buf_pool->max_size) {
+
+ fprintf(stderr,
+"InnoDB: Error: trying to access a stray pointer %lx\n"
+"InnoDB: buf pool start is at %lx, number of pages %lu\n", (ulint)ptr,
+ (ulint)frame_zero, buf_pool->max_size);
+ ut_a(0);
+ }
return(block);
}
@@ -259,10 +273,17 @@ buf_frame_align(
frame = ut_align_down(ptr, UNIV_PAGE_SIZE);
- ut_a((ulint)frame
- >= (ulint)(buf_pool_get_nth_block(buf_pool, 0)->frame));
- ut_a((ulint)frame <= (ulint)(buf_pool_get_nth_block(buf_pool,
- buf_pool->max_size - 1)->frame));
+ if (((ulint)frame
+ < (ulint)(buf_pool->frame_zero))
+ || ((ulint)frame > (ulint)(buf_pool_get_nth_block(buf_pool,
+ buf_pool->max_size - 1)->frame))) {
+ fprintf(stderr,
+"InnoDB: Error: trying to access a stray pointer %lx\n"
+"InnoDB: buf pool start is at %lx, number of pages %lu\n", (ulint)ptr,
+ (ulint)(buf_pool->frame_zero), buf_pool->max_size);
+ ut_a(0);
+ }
+
return(frame);
}