List:Commits« Previous MessageNext Message »
From:Georgi Kodinov Date:March 12 2009 2:19pm
Subject:bzr commit into mysql-6.0-bugteam branch (joro:3116) Bug#22047
View as plain text  
#At file:///home/kgeorge/mysql/work/B22047-6.0-bugteam/ based on revid:timothy.smith@stripped

 3116 Georgi Kodinov	2009-03-12
      Bug #22047: Time in SHOW PROCESSLIST for SQL thread in replication seems to 
            become negative
      
      THD::start_time has a dual meaning : it's either the time since the process
      entered a given state or is the transaction time returned by e.g. NOW().
      This causes problems, as sometimes THD::start_time may be set to a value
      that is correct and needed when used as a base for NOW(), but these times
      may be arbitrary (SET @@timestamp) or non-local (coming from the master 
      through the replication feed).
      If one such non-local time is set there's no way to return a correct value
      for e.g. SHOW PROCESSLIST or SELECT ... FROM INFORMATION_SCHEMA.PROCESSLIST.
      Fixed by making the Time column in SHOW PROCESSLIST SIGNED LONG instead of 
      UNSIGNED LONG and doing the correct conversions.
      
      Note that no reliable test suite can be constructed, since it would require
      knowing the local time and can't be achieved by the means of the current test
      suite.
     @ sql/sql_show.cc
        Bug #22047: make the Time column SIGNED LONG from UNSIGNED LONG

    modified:
      sql/sql_show.cc
=== modified file 'sql/sql_show.cc'
--- a/sql/sql_show.cc	2009-03-09 12:17:41 +0000
+++ b/sql/sql_show.cc	2009-03-12 14:19:05 +0000
@@ -1729,7 +1729,8 @@ void mysqld_list_processes(THD *thd,cons
   field_list.push_back(field=new Item_empty_string("db",NAME_CHAR_LEN));
   field->maybe_null=1;
   field_list.push_back(new Item_empty_string("Command",16));
-  field_list.push_back(new Item_return_int("Time",7, MYSQL_TYPE_LONG));
+  field_list.push_back(field=new Item_return_int("Time",7, MYSQL_TYPE_LONG));
+  field->unsigned_flag=0;
   field_list.push_back(field=new Item_empty_string("State",30));
   field->maybe_null=1;
   field_list.push_back(field=new Item_empty_string("Info",max_query_length));
@@ -1822,7 +1823,7 @@ void mysqld_list_processes(THD *thd,cons
     else
       protocol->store(command_name[thd_info->command].str, system_charset_info);
     if (thd_info->start_time)
-      protocol->store((uint32) (now - thd_info->start_time));
+      protocol->store_long((longlong) (now - thd_info->start_time));
     else
       protocol->store_null();
     protocol->store(thd_info->state_info, system_charset_info);


Attachment: [text/bzr-bundle] bzr/joro@sun.com-20090312141905-552wtpvhkiqctww4.bundle
Thread
bzr commit into mysql-6.0-bugteam branch (joro:3116) Bug#22047Georgi Kodinov12 Mar