1 # name : microsec_process.patch
2 # introduced : 11 or before
3 # maintainer : Yasufumi
6 # Any small change to this file in the main branch
7 # should be done or reviewed by the maintainer!
8 diff -ruN a/patch_info/microsec_process.info b/patch_info/microsec_process.info
9 --- /dev/null 1970-01-01 09:00:00.000000000 +0900
10 +++ b/patch_info/microsec_process.info 2010-08-27 14:45:52.941058849 +0900
12 +File=microsec_process.patch
13 +Name=Adds INFOMATION_SCHEMA.PROCESSLIST with TIME_MS column
15 +Author=Percona <info@percona.com>
20 diff -ruN a/sql/sql_show.cc b/sql/sql_show.cc
21 --- a/sql/sql_show.cc 2010-08-27 14:38:08.781057666 +0900
22 +++ b/sql/sql_show.cc 2010-08-27 14:45:52.946058726 +0900
24 TABLE *table= tables->table;
25 CHARSET_INFO *cs= system_charset_info;
27 - time_t now= my_time(0);
29 + ulonglong now_utime= my_micro_time_and_time(&now);
30 DBUG_ENTER("fill_process_list");
32 user= thd->security_ctx->master_access & PROCESS_ACL ?
33 @@ -2024,6 +2025,10 @@
35 pthread_mutex_unlock(&tmp->LOCK_thd_data);
38 + table->field[8]->store(((tmp->start_utime ?
39 + now_utime - tmp->start_utime : 0)/ 1000));
41 if (schema_table_store_record(thd, table))
43 VOID(pthread_mutex_unlock(&LOCK_thread_count));
45 {"STATE", 64, MYSQL_TYPE_STRING, 0, 1, "State", SKIP_OPEN_TABLE},
46 {"INFO", PROCESS_LIST_INFO_WIDTH, MYSQL_TYPE_STRING, 0, 1, "Info",
48 + {"TIME_MS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
49 + 0, 0, "Time_ms", SKIP_OPEN_TABLE},
50 {0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}