• mats@mats-laptop.(none)'s avatar
    BUG#29020 (Event results not correctly replicated to slave in RBR): · c8c4500a
    mats@mats-laptop.(none) authored
    The bug allow multiple executing transactions working with non-transactional
    to interfere with each others by interleaving the events of different trans-
    actions.
    
    Bug is fixed by writing non-transactional events to the transaction cache and
    flushing the cache to the binary log at statement commit. To mimic the behavior
    of normal statement-based replication, we flush the transaction cache in row-
    based mode when there is no committed statements in the transaction cache,
    which means we are committing the first one. This means that it will be written
    to the binary log as a "mini-transaction" with just the rows for the statement.
    
    Note that the changes here does not take effect when building the server with
    HAVE_TRANSACTIONS set to false, but it is not clear if this was possible before
    this patch either.
    
    For row-based logging, we also have that when AUTOCOMMIT=1, the code now always
    generates a BEGIN/COMMIT pair for single statements, or BEGIN/ROLLBACK pair in the
    case of non-transactional changes in a statement that was rolled back. Note that
    for the case where changes to a non-transactional table causes a rollback due
    to error, the statement will now be logged with a BEGIN/ROLLBACK pair, even
    though some changes has been committed to the non-transactional table.
    c8c4500a
rpl_switch_stm_row_mixed.result 36.8 KB