• Andrei Elkin's avatar
    MDEV-14605 Changes to "ON UPDATE CURRENT_TIMESTAMP" fields are not · f9ac7032
    Andrei Elkin authored
               always logged properly with binlog_row_image=MINIMAL
    
    There are two issues fixed in this commit.
    The first is an observation of a multi-table UPDATE binlogged
    in row-format in binlog_row_image=MINIMAL mode. While the UPDATE aims
    at a table with an ON-UPDATE attribute its binlog after-image misses
    to record also installed default value.
    The reason for that turns out missed marking of default-capable fields
    in TABLE::write_set.
    
    This is fixed to mark such fields similarly to 10.2's MDEV-10134 patch (db7edfed)
    that introduced it. The marking follows up 93d1e5ce's idea
    to exploit TABLE:rpl_write_set introduced there though,
    and thus does not mess (in 10.1) with the actual MDEV-10134 agenda.
    The patch makes formerly arg-less TABLE::mark_default_fields_for_write()
    to accept an argument which would be TABLE:rpl_write_set.
    
    The 2nd issue is extra columns in in binlog_row_image=MINIMAL before-image
    while merely a packed primary key is enough. The test main.mysqlbinlog_row_minimal
    always had a wrong result recorded.
    This is fixed to invoke a function that intended for read_set
    possible filtering and which is called (supposed to) in all type of MDL, UPDATE
    including; the test results have gotten corrected.
    
    At *merging* from 10.1->10.2 the 1st "main" part of the patch is unnecessary
    since the bug is not observed in 10.2, so only hunks from
    
      sql/sql_class.cc
    
    are required.
    f9ac7032
table.h 89.2 KB