• Brandon Nesterenko's avatar
    MDEV-33283: Binlog Checksum is Zeroed by Zlib if Part of Event Data is Empty · 207c8578
    Brandon Nesterenko authored
    An existing binlog checksum can be overridden to 0 if writing a NULL
    payload when using Zlib for the computation. That is, calling into
    Zlib's crc32 with empty data initializes an incremental CRC
    computation to 0.
    
    This patch changes the Log_event_writer::write_data() to exit
    immediately if there is nothing to write, thereby bypassing the
    checksum computation. This follows the pattern of
    Log_event_writer::encrypt_and_write(), which also exits immediately
    if there is no data to write.
    
    Reviewed By:
    ============
    Andrei Elkin <andrei.elkin@mariadb.com>
    207c8578
log_event_server.cc 277 KB