fix for bug#9968 (slow query log contains useless entries)

Query has to be written to the log before calling
thd->set_statement(&stmt_backup), otherwise query will be empty.
Setting thd->enabe_slow_log to FALSE prevents that dispatch_command
logs the (empty) query again.
parent f09d0610
......@@ -2079,6 +2079,10 @@ void mysql_stmt_execute(THD *thd, char *packet, uint packet_length)
reset_stmt_params(stmt);
}
log_slow_statement(thd);
/* Prevent from second logging in the end of dispatch_command */
thd->enable_slow_log= FALSE;
thd->set_statement(&stmt_backup);
thd->lock_id= &thd->main_lock_id;
thd->current_arena= thd;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment