Commit b8d992f0 authored by unknown's avatar unknown
Browse files

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 88c2b4b6
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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;