• istruewing@chilla.local's avatar
    Bug#25673 - spatial index corruption, error 126 · 2d6ad76a
    istruewing@chilla.local authored
              incorrect key file for table
    
    In certain cases it could happen that deleting a row could
    corrupt an RTREE index.
    
    According to Guttman's algorithm, page underflow is handled
    by storing the page in a list for later re-insertion. The
    keys from the stored pages have to be inserted into the
    remaining pages of the same level of the tree. Hence the
    level number is stored in the re-insertion list together
    with the page.
    
    In the MySQL RTree implementation the level counts from zero
    at the root page, increasing numbers for levels down the tree.
    
    If during re-insertion of the keys the tree height grows, all
    level numbers become invalid. The remaining keys will be
    inserted at the wrong level.
    
    The fix is to increment the level numbers stored in the
    reinsert list after a split of the root block during reinsertion.
    2d6ad76a
rt_key.c 3.08 KB