• Luis Soares's avatar
    BUG#51987: revoke privileges logs wrong error code · fdfb74b3
    Luis Soares authored
    A failed REVOKE statement is logged with error=0, thus causing
    the slave to stop. The slave should not stop as this was an
    expected error. Given that the execution failed on the master as
    well the error code should be logged so that the slave can replay
    the statement, get an error and compare with the master's
    execution outcome. If errors match, then slave can proceed with
    replication, as the error it got, when replaying the statement,
    was expected.
    
    In this particular case, the bug surfaces because the error code
    is pushed to the THD diagnostics area after writing the event to
    the binary log. Therefore, it would be logged with the THD
    diagnostics area clean, hence its error code would not contain 
    the correct code.
    
    We fix this by moving the error reporting ahead of the call to
    the routine that writes the event to the binary log.
    fdfb74b3
sql_acl.cc 197 KB