From 3a55efc44cdce09afb35ecd78bd33482355bdadf Mon Sep 17 00:00:00 2001 From: marko Date: Wed, 30 Nov 2005 23:09:36 +0000 Subject: [PATCH] branches/zip: buf_flush_init_for_writing(): The reported dense page directory size was 4 bytes too much. Subtract 2 (infimum and supremum) from n_heap. page_zip_decompress(): When decompressing the last user record, only set heap_no and the status bits if there is data to decode, i.e., there are user records on the page. --- buf/buf0flu.c | 2 +- page/page0zip.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/buf/buf0flu.c b/buf/buf0flu.c index f866fd105e2..b0fb46c8912 100644 --- a/buf/buf0flu.c +++ b/buf/buf0flu.c @@ -502,7 +502,7 @@ buf_flush_init_for_writing( + (PAGE_HEADER + PAGE_LEVEL)), (ulong) page_zip->m_start, (ulong) 2 - * page_dir_get_n_heap(page_zip->data)); + * (page_dir_get_n_heap(page_zip->data) - 2)); page_zip->data = NULL; } diff --git a/page/page0zip.c b/page/page0zip.c index 8e160bd09b6..c917f3d8820 100644 --- a/page/page0zip.c +++ b/page/page0zip.c @@ -682,8 +682,10 @@ first_inflate: ut_a(d_stream.avail_out < UNIV_PAGE_SIZE - PAGE_ZIP_START - PAGE_DIR); - /* set heap_no and the status bits */ - mach_write_to_2(dst - REC_NEW_HEAP_NO, heap_status); + if (UNIV_LIKELY(d_stream.avail_out != 0)) { + /* set heap_no and the status bits */ + mach_write_to_2(dst - REC_NEW_HEAP_NO, heap_status); + } err = inflate(&d_stream, Z_FINISH);