Set wrong sql_mode when creating a procedure. So that the sql_mode can't be writen into binary log correctly. Restore the current session sql_mode right before generating the binlog event when creating a procedure.