summaryrefslogtreecommitdiff
path: root/innobase/include/buf0buf.ic
diff options
context:
space:
mode:
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 e5a2c480922..7227c79dc6a 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);
}