• Marko Mäkelä's avatar
    MDEV-19022: InnoDB fails to cleanup useless B-tree pages · 525e79b0
    Marko Mäkelä authored
    The test case for reproducing MDEV-14126 demonstrates that InnoDB can
    end up with an index tree where a non-leaf page has only one child page.
    
    The test case innodb.innodb_bug14676111 demonstrates that such pages
    are sometimes unavoidable, because InnoDB does not implement any sort
    of B-tree rotation.
    
    But, there is no reason to allow a root page with only one child page.
    
    btr_cur_node_ptr_delete(): Replaces btr_node_ptr_delete().
    
    btr_page_get_father(): Declare globally.
    
    btr_discard_only_page_on_level(): Declare with ATTRIBUTE_COLD.
    It turns out that this function is not covered by the
    innodb.innodb_bug14676111 test case after all.
    
    btr_discard_page(): If the root page ends up having only one child
    page, shrink the tree by invoking btr_lift_page_up().
    525e79b0
innodb_bug14676111.result 2 KB