• Marko Mäkelä's avatar
    Follow-up fix to MDEV-15132 Avoid accessing the TRX_SYS page · dcc09afa
    Marko Mäkelä authored
    trx_undo_mem_create_at_db_start(): Do not read TRX_UNDO_TRX_NO
    unless the field is known to be valid, that is, the transaction
    has been serialized and trx_purge_add_undo_to_history() has been
    invoked.
    
    Normally InnoDB pages would be zero-initialized on allocation
    (since MySQL 5.5 or so), but the undo log pages skip that
    mechanism. So, reused undo log pages can contain garbage.
    Undo log headers can start at any offset (there can be
    multiple undo log headers in the same undo log page).
    Therefore, because the TRX_UNDO_TRX_NO is never explicitly
    initialized on undo log header creation, its contents may
    be garbage.
    dcc09afa
trx0undo.cc 48.5 KB