summaryrefslogtreecommitdiff
path: root/innobase
diff options
context:
space:
mode:
authorheikki@hundin.mysql.fi <>2005-09-03 19:15:37 +0300
committerheikki@hundin.mysql.fi <>2005-09-03 19:15:37 +0300
commit9300833c91236da77b00d2c7871d11894b5803a7 (patch)
tree10e23b1aaec226b8f6588d6bcb552cedc98c884c /innobase
parent0428fec7c794a51d1274f492bb627a99485b01df (diff)
downloadmariadb-git-9300833c91236da77b00d2c7871d11894b5803a7.tar.gz
univ.i, page0page.ic:
Add a sanity check to page_rec_is_comp; a new univ.i macro UNIV_RELEASE_NOT_YET_STABLE controls such sanity checks that we will remove after the release is stable enough
Diffstat (limited to 'innobase')
-rw-r--r--innobase/include/page0page.ic13
-rw-r--r--innobase/include/univ.i4
2 files changed, 17 insertions, 0 deletions
diff --git a/innobase/include/page0page.ic b/innobase/include/page0page.ic
index fd5281fdbec..655ff245aa8 100644
--- a/innobase/include/page0page.ic
+++ b/innobase/include/page0page.ic
@@ -175,6 +175,19 @@ page_rec_is_comp(
/* out: nonzero if in compact format */
const rec_t* rec) /* in: record */
{
+#ifdef UNIV_RELEASE_NOT_YET_STABLE
+ if (UNIV_UNLIKELY((ulint)rec < (ulint)(buf_pool->frame_zero))
+ || UNIV_UNLIKELY((ulint)rec >= (ulint)(buf_pool->high_end))) {
+
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+"InnoDB: Error: trying to read a stray page rec %p\n"
+"InnoDB: buf pool start is at %p, end at %p\n",
+ rec, buf_pool->frame_zero,
+ buf_pool->high_end);
+ ut_error;
+ }
+#endif
return(page_is_comp(ut_align_down((rec_t*) rec, UNIV_PAGE_SIZE)));
}
diff --git a/innobase/include/univ.i b/innobase/include/univ.i
index 6849dcd9c51..15650f22ed8 100644
--- a/innobase/include/univ.i
+++ b/innobase/include/univ.i
@@ -80,6 +80,10 @@ memory is read outside the allocated blocks. */
/* Make a non-inline debug version */
+/* You can remove this define when the release is stable. This define adds
+some consistency checks to code. They use a little CPU time. */
+#define UNIV_RELEASE_NOT_YET_STABLE
+
/*
#define UNIV_DEBUG
#define UNIV_MEM_DEBUG