• Libing Song's avatar
    MDEV-32894 mysqlbinlog flashback support binlog_row_image FULL_NODUP mode · 8bf9f218
    Libing Song authored
    Summary
    =======
    With FULL_NODUP mode, before image inclues all columns and after
    image inclues only the changed columns. flashback will swap the
    value of changed columns from after image to before image.
    For example:
      BI: c1, c2, c3_old, c4_old
      AI: c3_new, c4_new
    flashback will reconstruct the before and after images to
      BI: c1, c2, c3_new, c4_new
      AI: c3_old, c4_old
    
    Implementation
    ==============
    When parsing the before and after image, position and length of
    the fields are collected into ai_fields and bi_fields, if it is an
    Update_rows_event and the after image doesn't includes all columns.
    
    The changed fields are swapped between bi_fields and ai_fields.
    Then it recreates the before image and after image by using
    bi_fields and ai_fields. nullbit will be set to 1 if the
    field is NULL, otherwise nullbit will be 0.
    
    It also optimized flashback a little bit.
    - calc_row_event_length is used instead of print_verbose_one_row
    - swap_buff1 and swap_buff2 are removed.
    8bf9f218
flashback.result 28.6 KB