diff options
Diffstat (limited to 'storage/innobase/include/ibuf0ibuf.ic')
-rw-r--r-- | storage/innobase/include/ibuf0ibuf.ic | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/storage/innobase/include/ibuf0ibuf.ic b/storage/innobase/include/ibuf0ibuf.ic index 92ca2cbb9a2..21747fdceac 100644 --- a/storage/innobase/include/ibuf0ibuf.ic +++ b/storage/innobase/include/ibuf0ibuf.ic @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1997, 2009, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1997, 2013, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -67,10 +67,10 @@ struct ibuf_t{ ulint seg_size; /*!< allocated pages of the file segment containing ibuf header and tree */ - ibool empty; /*!< Protected by the page + bool empty; /*!< Protected by the page latch of the root page of the insert buffer tree - (FSP_IBUF_TREE_ROOT_PAGE_NO). TRUE + (FSP_IBUF_TREE_ROOT_PAGE_NO). true if and only if the insert buffer tree is empty. */ ulint free_list_len; /*!< length of the free list */ @@ -253,7 +253,15 @@ ibuf_index_page_calc_free_zip( ut_ad(zip_size == buf_block_get_zip_size(block)); ut_ad(zip_size); - max_ins_size = page_get_max_insert_size_after_reorganize( + /* Consider the maximum insert size on the uncompressed page + without reorganizing the page. We must not assume anything + about the compression ratio. If zip_max_ins > max_ins_size and + there is 1/4 garbage on the page, recompression after the + reorganize could fail, in theory. So, let us guarantee that + merging a buffered insert to a compressed page will always + succeed without reorganizing or recompressing the page, just + by using the page modification log. */ + max_ins_size = page_get_max_insert_size( buf_block_get_frame(block), 1); page_zip = buf_block_get_page_zip(block); @@ -331,8 +339,8 @@ ibuf_update_free_bits_if_full( before = ibuf_index_page_calc_free_bits(0, max_ins_size); if (max_ins_size >= increase) { -#if ULINT32_UNDEFINED <= UNIV_PAGE_SIZE -# error "ULINT32_UNDEFINED <= UNIV_PAGE_SIZE" +#if ULINT32_UNDEFINED <= UNIV_PAGE_SIZE_MAX +# error "ULINT32_UNDEFINED <= UNIV_PAGE_SIZE_MAX" #endif after = ibuf_index_page_calc_free_bits(0, max_ins_size - increase); |