• gbichot@dl145h.mysql.com's avatar
    Fix for BUG#25628: "mysqlbinlog crashes while processing binary logs". · ba2452f0
    gbichot@dl145h.mysql.com authored
    mysqlbinlog prints all row-based events of a single statement as a
    single "BINLOG" statement containing the concatenation of those events.
    Big (i.e. >64k) concatenations of row-based events
    (e.g. Write_rows_log_event) caused mysqlbinlog's IO_CACHE to overflow
    to a temporary file but the IO_CACHE had not been inited with
    open_cached_file(), so it tried to create a temporary file in
    an uninitialized directory (thus failing to create, then to write;
    some OS errors were printed, and it finally segfaulted).
    After fixing this, it appeared that mysqlbinlog was printing only
    a piece of big concatenations of row-based events (it printed
    at most the size of the IO_CACHE's buffer i.e. 64k); that caused data
    loss at restore. We fix and test that.
    Last, mysqlbinlog's printouts looked a bit strange with the informative
    header (#-prefixed) of groupped Rows_log_event all on one line,
    so we insert \n. After that, a small bug in the --hexdump code appeared
    (only if the string to hex-print had its length a multiple of 16),
    we fix it.
    ba2452f0
mysqlbinlog_base64.result 1.44 KB