• Vlad Lesin's avatar
    MDEV-33802 Weird read view after ROLLBACK of other transactions. · d7fc975c
    Vlad Lesin authored
    In the case if some unique key fields are nullable, there can be
    several records with the same key fields in unique index with at least
    one key field equal to NULL, as NULL != NULL.
    
    When transaction is resumed after waiting on the record with at least one
    key field equal to NULL, and stored in persistent cursor record is
    deleted, persistent cursor can be restored to the record with all key
    fields equal to the stored ones, but with at least one field equal to
    NULL. And such record is wrongly treated as a record with the same unique
    key as stored in persistent cursor record one, what is wrong as
    NULL != NULL.
    
    The fix is to check if at least one unique field is NULL in restored
    persistent cursor position, and, if so, then don't treat the record as
    one with the same unique key as in the stored record key.
    
    dict_index_t::nulls_equal was removed, as it was initially developed for
    never existed in MariaDB "intrinsic tables", and there is no code, which
    would set it to "true".
    
    Reviewed by Marko Mäkelä.
    d7fc975c
dict0dict.cc 168 KB