List:Commits« Previous MessageNext Message »
From:Georgi Kodinov Date:January 29 2009 12:41pm
Subject:bzr commit into mysql-5.0-bugteam branch (joro:2735) Bug#35396
View as plain text  
#At file:///home/kgeorge/mysql/work/B35396-5.0-bugteam/ based on revid:davi.arnaut@stripped

 2735 Georgi Kodinov	2009-01-29
      Bug #35396: Abnormal query times in slow query log
                  
      If the system time is adjusted back during a query execution
      (resulting in the end time being earlier than the start time)
      the code that prints to the slow query log gets confused and 
      prints unsigned negative numbers.
                  
      Fixed by not logging the statements that would have negative
      execution time due to time shifts.
      No test case since this would involve changing the system time.
modified:
  sql/sql_parse.cc

per-file messages:
  sql/sql_parse.cc
    Bug #35396: don't log queries with negative execution times 
    (due to shifts in system time).
=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc	2009-01-15 10:48:31 +0000
+++ b/sql/sql_parse.cc	2009-01-29 12:40:48 +0000
@@ -2333,8 +2333,9 @@ void log_slow_statement(THD *thd)
   {
     thd->proc_info="logging slow query";
 
-    if ((ulong) (thd->start_time - thd->time_after_lock) >
-	thd->variables.long_query_time ||
+    if ((thd->start_time > thd->time_after_lock && 
+         (ulong) (thd->start_time - thd->time_after_lock) >
+	thd->variables.long_query_time) ||
         (thd->server_status &
 	  (SERVER_QUERY_NO_INDEX_USED | SERVER_QUERY_NO_GOOD_INDEX_USED)) &&
         opt_log_queries_not_using_indexes &&

Thread
bzr commit into mysql-5.0-bugteam branch (joro:2735) Bug#35396Georgi Kodinov29 Jan