From: Georgi Kodinov Date: March 13 2009 1:51pm Subject: bzr commit into mysql-5.0-bugteam branch (joro:2778) Bug#22047 List-Archive: http://lists.mysql.com/commits/69145 X-Bug: 22047 Message-Id: <200903131352.n2DDq3RS017023@magare.gmz> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6544414482876238429==" --===============6544414482876238429== MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline #At file:///home/kgeorge/mysql/work/B22047-5.0-bugteam/ based on revid:timothy.smith@stripped 2778 Georgi Kodinov 2009-03-13 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 in SHOW PROCESSLIST LONG from LONG UNSIGNED modified: sql/sql_show.cc === modified file 'sql/sql_show.cc' --- a/sql/sql_show.cc 2009-02-25 11:44:50 +0000 +++ b/sql/sql_show.cc 2009-03-13 13:51:25 +0000 @@ -1338,7 +1338,8 @@ void mysqld_list_processes(THD *thd,cons field_list.push_back(field=new Item_empty_string("db",NAME_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, FIELD_TYPE_LONG)); + field_list.push_back(field= new Item_return_int("Time",7, FIELD_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)); @@ -1439,7 +1440,7 @@ void mysqld_list_processes(THD *thd,cons else protocol->store(command_name[thd_info->command], 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); --===============6544414482876238429== MIME-Version: 1.0 Content-Type: text/bzr-bundle; charset="us-ascii"; name="bzr/joro@stripped" Content-Transfer-Encoding: 7bit Content-Disposition: inline # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: joro@stripped # target_branch: file:///home/kgeorge/mysql/work/B22047-5.0-bugteam/ # testament_sha1: ebf74acd2013629a6304d5c51976e4f406e19aa4 # timestamp: 2009-03-13 15:52:03 +0200 # base_revision_id: timothy.smith@stripped\ # 2su41y6hi4oc93dn # # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWd6XNqcAAidfgFAQWef//3/v /qC////wYAZU3YvnhOWj3nO8ltydj1uhkgTSaNGNIA0p7QjNJPUMg00YjGmU0yBkQmg0yanqYUmy R6h6mmgA9QNAA0B6gaEaCaajTUDCaAAGCBpoaAAAGIUxCDTVPaTGqG00jRoZDTQBoAANDhppkYjC aYCGATTCMExMhpkaGgEkgQJhNT0TKY1No0yAIyDCA0AGiLRj7MtvKE+v0HyzySrR5YEAklmO1lYj N7GKQPxbKc3LmlbFmj5MUaO/hyYBbA8B6J7cpcHr3ZxwpREMvRyMG2sSgpFMsYyoZJrmzN2TSdTk xO8AFTlbV56h8PsuJOO1wbgUy95sqjOCuJ5xRxvYkDVISV+yGvE/nWFjTk6k6DRXTbM6jOlhuTCV H7dLq/1J+5opvnZKMLmrdqjXJ8E02yBSC6NLJ6c0zL0slod9AuRC4GujY1l+9MvS337bN+2uNkGJ tlygr2e68zqQkVhyTvmUvUEEaPT6ZvSPW6dNIsyqZmkpN2YEPNSQU+mvIq9fGIGuKI7jPzUDZhCQ tXEuffcRdJCxr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