]>
Commit | Line | Data |
---|---|---|
d4e9320e AM |
1 | # name : microsec_process.patch |
2 | # introduced : 11 or before | |
3 | # maintainer : Yasufumi | |
4 | # | |
5 | #!!! notice !!! | |
6 | # Any small change to this file in the main branch | |
7 | # should be done or reviewed by the maintainer! | |
734d6226 AM |
8 | --- /dev/null |
9 | +++ b/patch_info/microsec_process.info | |
d4e9320e AM |
10 | @@ -0,0 +1,8 @@ |
11 | +File=microsec_process.patch | |
12 | +Name=Adds INFOMATION_SCHEMA.PROCESSLIST with TIME_MS column | |
13 | +Version=1.0 | |
14 | +Author=Percona <info@percona.com> | |
15 | +License=GPL | |
16 | +Comment= | |
17 | +2010-01 | |
18 | +Ported to 5.1.42 | |
734d6226 AM |
19 | --- a/sql/sql_show.cc |
20 | +++ b/sql/sql_show.cc | |
adf0fb13 | 21 | @@ -1890,7 +1890,8 @@ |
d4e9320e AM |
22 | TABLE *table= tables->table; |
23 | CHARSET_INFO *cs= system_charset_info; | |
24 | char *user; | |
25 | - time_t now= my_time(0); | |
26 | + time_t now; | |
27 | + ulonglong now_utime= my_micro_time_and_time(&now); | |
28 | DBUG_ENTER("fill_process_list"); | |
29 | ||
30 | user= thd->security_ctx->master_access & PROCESS_ACL ? | |
adf0fb13 | 31 | @@ -1974,6 +1975,10 @@ |
d4e9320e | 32 | } |
b4e1fa2c | 33 | mysql_mutex_unlock(&tmp->LOCK_thd_data); |
d4e9320e AM |
34 | |
35 | + /* TIME_MS */ | |
36 | + table->field[8]->store(((tmp->start_utime ? | |
37 | + now_utime - tmp->start_utime : 0)/ 1000)); | |
38 | + | |
39 | if (schema_table_store_record(thd, table)) | |
40 | { | |
b4e1fa2c | 41 | mysql_mutex_unlock(&LOCK_thread_count); |
734d6226 | 42 | @@ -7464,6 +7469,8 @@ |
d4e9320e AM |
43 | {"STATE", 64, MYSQL_TYPE_STRING, 0, 1, "State", SKIP_OPEN_TABLE}, |
44 | {"INFO", PROCESS_LIST_INFO_WIDTH, MYSQL_TYPE_STRING, 0, 1, "Info", | |
45 | SKIP_OPEN_TABLE}, | |
46 | + {"TIME_MS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG, | |
47 | + 0, 0, "Time_ms", SKIP_OPEN_TABLE}, | |
48 | {0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE} | |
49 | }; | |
50 |