• Marko Mäkelä's avatar
    Skip the 'default row' pseudo-record where needed · 5c9cedaf
    Marko Mäkelä authored
    The 'default row' record (which stores the default values of
    instantly added columns when they were added) must be ignored
    during normal operation.
    
    Because btr_pcur_store_position() can theoretically be invoked
    on the pseudo-record, we must check every caller of
    btr_pcur_restore_position(). Similarly, when positioning the
    cursor to the start of an index with btr_pcur_open_at_index_side(),
    or when moving to the previous record, we must be careful to
    skip the 'default row' record.
    
    rec_is_default_row(): Check whether a leaf page record is the
    'default row' pseudo-record.
    
    row_import_set_sys_max_row_id(): Check for a table that is empty but
    contains the 'default row' record.
    
    IndexPurge::open(), row_merge_read_clustered_index(),
    dict_stats_analyze_index_level(), row_sel_try_search_shortcut(),
    row_sel(), sel_restore_position_for_mysql(), row_search_mvcc():
    Skip the 'default row' pseudo-record.
    
    fts_get_max_doc_id(): Assert that the 'default row' cannot exist
    in the secondary index FTS_DOC_ID_INDEX(FTS_DOC_ID).
    
    page_find_rec_max_not_deleted(): Assert that we are operating
    on a leaf page. Also skip the 'default row' pseudo-record, not
    only delete-marked records.
    
    row_search_get_max_rec(): Assert that page_find_rec_max_not_deleted()
    did not return any delete-marked or 'default row' record.
    5c9cedaf
fts0fts.cc 188 KB