• marko's avatar
    branches/zip: Prevent infinite B-tree page splits by ensuring that · 1a360822
    marko authored
    there will always be enough space for two node pointer records in an
    empty B-tree page.  This was reported as Mantis issue #73.
    
    page_zip_rec_needs_ext(): Add the parameter n_fields, for accurate
    estimation of the compressed size of the data dictionary information.
    Given that this function is only invoked for records on leaf pages,
    require that there be enough space for one record in the compressed
    page.  We check elsewhere that there will be enough room for two node
    pointer records on higher-level pages.
    
    btr_cur_optimistic_insert(): Ensure that there will be enough room for
    two node pointer records on an empty non-leaf page.  The rule for
    leaf-page records will be enforced by the callers of
    page_zip_rec_needs_ext().
    
    btr_cur_pessimistic_insert(): Remove the insufficient check that the
    leaf page record should be compressible by itself.  Instead, now we
    require that two node pointer records fit on a non-leaf page, and one
    record will fit in uncompressed form on the leaf page.
    
    page_zip_write_header(), page_zip_write_rec(): Re-enable the debug
    assertions that were violated by the insufficient check in
    btr_cur_pessimistic_insert().
    
    innodb_bug36172.test: Use a larger compressed page size.
    1a360822
page0zip.h 14.6 KB