1 diff -r 1a59073d658d mysql-test/r/create.result
2 --- a/mysql-test/r/create.result Sat Sep 13 17:31:30 2008 -0700
3 +++ b/mysql-test/r/create.result Sat Sep 13 17:31:40 2008 -0700
5 `COMMAND` varchar(16) NOT NULL DEFAULT '',
6 `TIME` bigint(7) NOT NULL DEFAULT '0',
7 `STATE` varchar(64) DEFAULT NULL,
10 + `TIME_MS` decimal(22,3) NOT NULL DEFAULT '0.000'
11 ) ENGINE=MyISAM DEFAULT CHARSET=utf8
13 create temporary table t1 like information_schema.processlist;
15 `COMMAND` varchar(16) NOT NULL DEFAULT '',
16 `TIME` bigint(7) NOT NULL DEFAULT '0',
17 `STATE` varchar(64) DEFAULT NULL,
20 + `TIME_MS` decimal(22,3) NOT NULL DEFAULT '0.000'
21 ) ENGINE=MyISAM DEFAULT CHARSET=utf8
23 create table t1 like information_schema.character_sets;
24 diff -r 1a59073d658d sql/sql_show.cc
25 --- a/sql/sql_show.cc Sat Sep 13 17:31:30 2008 -0700
26 +++ b/sql/sql_show.cc Sat Sep 13 17:31:40 2008 -0700
28 TABLE *table= tables->table;
29 CHARSET_INFO *cs= system_charset_info;
31 - time_t now= my_time(0);
32 + ulonglong unow= my_micro_time();
33 DBUG_ENTER("fill_process_list");
35 user= thd->security_ctx->master_access & PROCESS_ACL ?
37 table->field[4]->store(command_name[tmp->command].str,
38 command_name[tmp->command].length, cs);
40 - table->field[5]->store((longlong)(tmp->start_time ?
41 - now - tmp->start_time : 0), FALSE);
42 + const ulonglong utime= tmp->start_utime ? unow - tmp->start_utime : 0;
43 + table->field[5]->store(utime / 1000000, TRUE);
45 #ifndef EMBEDDED_LIBRARY
46 val= (char*) (tmp->locked ? "Locked" :
47 @@ -1896,11 +1896,15 @@
48 table->field[7]->set_notnull();
52 + table->field[8]->store((double)(utime / 1000.0));
54 if (schema_table_store_record(thd, table))
56 VOID(pthread_mutex_unlock(&LOCK_thread_count));
64 into it two numbers, based on modulus of base-10 numbers. In the ones
65 position is the number of decimals. Tens position is unused. In the
66 hundreds and thousands position is a two-digit decimal number representing
67 - length. Encode this value with (decimals*100)+length , where
68 + length. Encode this value with (length*100)+decimals , where
69 0<decimals<10 and 0<=length<100 .
73 {"STATE", 64, MYSQL_TYPE_STRING, 0, 1, "State", SKIP_OPEN_TABLE},
74 {"INFO", PROCESS_LIST_INFO_WIDTH, MYSQL_TYPE_STRING, 0, 1, "Info",
76 + {"TIME_MS", 100 * (MY_INT64_NUM_DECIMAL_DIGITS + 1) + 3, MYSQL_TYPE_DECIMAL,
77 + 0, 0, "Time_ms", SKIP_OPEN_TABLE},
78 {0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}