mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
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.
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user