List:Commits« Previous MessageNext Message »
From:Marc Alff Date:December 2 2010 8:07am
Subject:bzr commit into mysql-trunk-bugfixing branch (marc.alff:3406) Bug#58172
View as plain text  
#At file:///Users/malff/BZR_TREE/mysql-trunk-bugfixing-58172/ based on revid:zhenxing.he@stripped

 3406 Marc Alff	2010-12-02
      Bug#58172 Column performance_schema.threads.processlist_time out of range
      
      Before this fix, the column processlist_time in table performance_schema.threads
      could receive out of range values.
      
      Some negative time was computed, because timers may have some drift and are not
      guaranteed to be always monotonous.
      
      This fix replaces negative time values with 0, to correct the data,
      and make the data fit into an unsigned column.

    modified:
      storage/perfschema/table_threads.cc
=== modified file 'storage/perfschema/table_threads.cc'
--- a/storage/perfschema/table_threads.cc	2010-12-01 18:46:51 +0000
+++ b/storage/perfschema/table_threads.cc	2010-12-02 08:07:06 +0000
@@ -289,7 +289,11 @@ int table_threads::read_row_values(TABLE
         break;
       case 8: /* PROCESSLIST_TIME */
         if (m_row.m_start_time)
-          set_field_ulonglong(f, my_time(0) - m_row.m_start_time);
+        {
+          time_t now= my_time(0);
+          ulonglong elapsed= (now > m_row.m_start_time ? now - m_row.m_start_time : 0);
+          set_field_ulonglong(f, elapsed);
+        }
         else
           f->set_null();
         break;


Attachment: [text/bzr-bundle] bzr/marc.alff@oracle.com-20101202080706-r6t3ci53ahh4py2r.bundle
Thread
bzr commit into mysql-trunk-bugfixing branch (marc.alff:3406) Bug#58172Marc Alff2 Dec