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
parent 0428fec7
...@@ -175,6 +175,19 @@ page_rec_is_comp( ...@@ -175,6 +175,19 @@ page_rec_is_comp(
/* out: nonzero if in compact format */ /* out: nonzero if in compact format */
const rec_t* rec) /* in: record */ 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))); return(page_is_comp(ut_align_down((rec_t*) rec, UNIV_PAGE_SIZE)));
} }
......
...@@ -80,6 +80,10 @@ memory is read outside the allocated blocks. */ ...@@ -80,6 +80,10 @@ memory is read outside the allocated blocks. */
/* Make a non-inline debug version */ /* 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_DEBUG
#define UNIV_MEM_DEBUG #define UNIV_MEM_DEBUG
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment