diff options
author | monty@hundin.mysql.fi <> | 2001-12-06 01:16:28 +0200 |
---|---|---|
committer | monty@hundin.mysql.fi <> | 2001-12-06 01:16:28 +0200 |
commit | 5c94a164225593586ae0fe5229917a0e8a283250 (patch) | |
tree | 72b6ce45de206772ff694d62b41d9fc5a16edbe8 /innobase | |
parent | 4c17825acd56ccbbf7e6649e7ebe98c34f992c84 (diff) | |
parent | 0f71e337b32c3388070f96160234df86eae964f8 (diff) | |
download | mariadb-git-5c94a164225593586ae0fe5229917a0e8a283250.tar.gz |
merge with 3.23.47
Diffstat (limited to 'innobase')
-rw-r--r-- | innobase/include/buf0buf.ic | 10 | ||||
-rw-r--r-- | innobase/include/mtr0log.ic | 7 | ||||
-rw-r--r-- | innobase/log/log0recv.c | 4 |
3 files changed, 18 insertions, 3 deletions
diff --git a/innobase/include/buf0buf.ic b/innobase/include/buf0buf.ic index 49f6dc59503..52bee0eb282 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); diff --git a/innobase/log/log0recv.c b/innobase/log/log0recv.c index 999429cbfcd..1734cfadfff 100644 --- a/innobase/log/log0recv.c +++ b/innobase/log/log0recv.c @@ -1316,7 +1316,9 @@ recv_parse_log_rec( new_ptr = mlog_parse_initial_log_record(ptr, end_ptr, type, space, page_no); - if (!new_ptr) { + /* Check that space id and page_no are sensible */ + + if (!new_ptr || *space != 0 || *page_no > 0x8FFFFFFF) { return(0); } |