buf0buf.ic:

Fix a bug: if buffer pool size > 2 GB on a 32-bit computer, we got an assertion failure because >> acted as a division operator (not as a register shift) for a wrapped-over integer value
This commit is contained in:
heikki@hundin.mysql.fi 2002-06-26 21:42:40 +03:00
parent 7a94fdd405
commit ded1170888

View file

@ -209,7 +209,7 @@ buf_block_align(
ut_ad((ulint)ptr >= (ulint)frame_zero);
block = buf_pool_get_nth_block(buf_pool, (ptr - frame_zero)
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);
@ -236,7 +236,7 @@ buf_block_align_low(
ut_ad((ulint)ptr >= (ulint)frame_zero);
block = buf_pool_get_nth_block(buf_pool, (ptr - frame_zero)
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);