• unknown's avatar
    Fix unsigned/signed conversion bug in event type during mysql_binlog_send(). · 8d99caae
    unknown authored
    Since event types can be >=128 and are read from a (possibly signed) char
    pointer, we need to cast to unsigned char before extending to int, or we will
    get an incorrect negative number. This was done in the main code path already,
    but there is a rare case where we check for new events first without a lock
    and then again with the lock. If the second check succeeds because a new event
    turns up at just the right time, then we took a code path that was missing the
    correct unsigned char cast, leading to incorrect handling of events for old
    slave servers and possibly other grief.
    
    (This was found from a sporadic failure in Buildbot of test case
    rpl_mariadb_slave_capability).
    8d99caae
sql_repl.cc 69.4 KB