summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authorGeorgi Kodinov <joro@sun.com>2009-03-17 16:29:16 +0200
committerGeorgi Kodinov <joro@sun.com>2009-03-17 16:29:16 +0200
commit7af84377cc19136067ff818322e27d5e15167202 (patch)
treeff528124dd951beb07cda51eb0d128cd5ea0c231 /sql/sql_show.cc
parentc14a43cd40012a41096fafe519a304adbab7e766 (diff)
parent8a5a804530eb0ee9c935b2b581d62ead93ae2854 (diff)
downloadmariadb-git-7af84377cc19136067ff818322e27d5e15167202.tar.gz
Bug 22047: Time in SHOW PROCESSLIST for SQL thread in replication seems to
become negative - merged the fix to 5.1 - extended to cover I_S.PROCESSLIST.TIME - Changed the column type of I_S.PROCESSLIST.TIME from LOGNLONG UNSIGNED to LONG (to match the SHOW PROCESSLIST type) - Added a test case
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 3d702833620..d08b3a248c4 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -1704,7 +1704,8 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
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));
@@ -1797,7 +1798,7 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
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);
@@ -1872,8 +1873,8 @@ int fill_schema_processlist(THD* thd, TABLE_LIST* tables, COND* cond)
table->field[4]->store(command_name[tmp->command].str,
command_name[tmp->command].length, cs);
/* MYSQL_TIME */
- table->field[5]->store((uint32)(tmp->start_time ?
- now - tmp->start_time : 0), TRUE);
+ table->field[5]->store((longlong)(tmp->start_time ?
+ now - tmp->start_time : 0), FALSE);
/* STATE */
#ifndef EMBEDDED_LIBRARY
val= (char*) (tmp->locked ? "Locked" :
@@ -6558,7 +6559,7 @@ ST_FIELD_INFO processlist_fields_info[]=
SKIP_OPEN_TABLE},
{"DB", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, "Db", SKIP_OPEN_TABLE},
{"COMMAND", 16, MYSQL_TYPE_STRING, 0, 0, "Command", SKIP_OPEN_TABLE},
- {"TIME", 7, MYSQL_TYPE_LONGLONG, 0, 0, "Time", SKIP_OPEN_TABLE},
+ {"TIME", 7, MYSQL_TYPE_LONG, 0, 0, "Time", SKIP_OPEN_TABLE},
{"STATE", 64, MYSQL_TYPE_STRING, 0, 1, "State", SKIP_OPEN_TABLE},
{"INFO", PROCESS_LIST_INFO_WIDTH, MYSQL_TYPE_STRING, 0, 1, "Info",
SKIP_OPEN_TABLE},