• Marko Mäkelä's avatar
    MDEV-23547 InnoDB: Failing assertion: *len in row_upd_ext_fetch · 8cf8ad86
    Marko Mäkelä authored
    This bug was originally repeated on 10.4 after defining a UNIQUE KEY
    on a TEXT column, which is implemented by MDEV-371 by creating the
    index on a hidden virtual column.
    
    While row_vers_vc_matches_cluster() is executing in a purge thread
    to find out if an index entry may be removed in a secondary index
    that comprises a virtual column, another purge thread may process
    the undo log record that this check is interested in, and write
    a null BLOB pointer in that record. This would trip the assertion.
    
    To prevent this from occurring, we must propagate the 'missing BLOB'
    error up the call stack.
    
    row_upd_ext_fetch(): Return NULL when the error occurs.
    
    row_upd_index_replace_new_col_val(): Return whether the previous
    version was built successfully.
    
    row_upd_index_replace_new_col_vals_index_pos(): Check the error
    result. Yes, we would intentionally crash on this error if it
    occurs outside the purge thread.
    
    row_upd_index_replace_new_col_vals(): Check for the error condition,
    and simplify the logic.
    
    trx_undo_prev_version_build(): Check for the error condition.
    8cf8ad86
row0upd.cc 90.9 KB