summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <heikki@donna.mysql.fi>2001-12-04 17:03:24 +0200
committerunknown <heikki@donna.mysql.fi>2001-12-04 17:03:24 +0200
commitbc26e18dc5d9e2bf534a31a5915f389094818a91 (patch)
tree51920578e887f996f332d3b1fbab77f88f83d222
parentd12413f6f60bec13d6cace42f7cb8d85eda9b998 (diff)
downloadmariadb-git-bc26e18dc5d9e2bf534a31a5915f389094818a91.tar.gz
buf0buf.ic, mtr0log.ic:
Add diagnostic code to catch possible space id or page no errors in the log innobase/include/mtr0log.ic: Add diagnostic code to catch possible space id or page no errors in the log innobase/include/buf0buf.ic: Add diagnostic code to catch possible space id or page no errors in the log
-rw-r--r--innobase/include/buf0buf.ic10
-rw-r--r--innobase/include/mtr0log.ic7
2 files changed, 15 insertions, 2 deletions
diff --git a/innobase/include/buf0buf.ic b/innobase/include/buf0buf.ic
index 3d88d087e63..8f5443ad150 100644
--- a/innobase/include/buf0buf.ic
+++ b/innobase/include/buf0buf.ic
@@ -211,6 +211,9 @@ buf_block_align(
block = buf_pool_get_nth_block(buf_pool, (ptr - frame_zero)
>> UNIV_PAGE_SIZE_SHIFT);
+ ut_a(block >= buf_pool->blocks);
+ ut_a(block < buf_pool->blocks + buf_pool->max_size);
+
return(block);
}
@@ -235,6 +238,9 @@ buf_block_align_low(
block = buf_pool_get_nth_block(buf_pool, (ptr - frame_zero)
>> UNIV_PAGE_SIZE_SHIFT);
+ ut_a(block >= buf_pool->blocks);
+ ut_a(block < buf_pool->blocks + buf_pool->max_size);
+
return(block);
}
@@ -253,9 +259,9 @@ buf_frame_align(
frame = ut_align_down(ptr, UNIV_PAGE_SIZE);
- ut_ad((ulint)frame
+ ut_a((ulint)frame
>= (ulint)(buf_pool_get_nth_block(buf_pool, 0)->frame));
- ut_ad((ulint)frame <= (ulint)(buf_pool_get_nth_block(buf_pool,
+ ut_a((ulint)frame <= (ulint)(buf_pool_get_nth_block(buf_pool,
buf_pool->max_size - 1)->frame));
return(frame);
}
diff --git a/innobase/include/mtr0log.ic b/innobase/include/mtr0log.ic
index c2150660794..0598f1a9536 100644
--- a/innobase/include/mtr0log.ic
+++ b/innobase/include/mtr0log.ic
@@ -163,6 +163,13 @@ mlog_write_initial_log_record_fast(
space = buf_block_get_space(block);
offset = buf_block_get_page_no(block);
+ if (space != 0 || offset > 0x8FFFFFFF) {
+ fprintf(stderr,
+ "InnoDB: error: buffer page pointer %lx has nonsensical space id %lu\n"
+ "InnoDB: or page no %lu\n", (ulint)ptr, space, offset);
+ ut_a(0);
+ }
+
mach_write_to_1(log_ptr, type);
log_ptr++;
log_ptr += mach_write_compressed(log_ptr, space);