• Sergei Golubchik's avatar
    MDEV-22647 Assertion `!check_audit_mask(mysql_global_audit_mask, event_class_mask)' · beffef9f
    Sergei Golubchik authored
    
    check_audit_mask(mysql_global_audit_mask, event_class_mask) is tested in
    mysql_audit_general_log() and then assert in mysql_audit_acquire_plugins()
    verifies that the condition still holds.
    But this code path is not protected by LOCK_audit_mask, so
    mysql_global_audit_mask can change its value between the if() and the
    assert. That is, the assert is invalid and will fire if the
    audit plugin is unloaded concurrently with mysql_audit_general_log().
    
    Nothing bad will happen in this case though, we'll just do a useless
    loop over all remaining installed audit plugins.
    
    That is, the fix is simply to remove the assert.
    beffef9f
sql_audit.cc 11.5 KB