]> git.pld-linux.org Git - packages/mysql.git/blame - microsec_process.patch
- rel 2; update percona patches
[packages/mysql.git] / microsec_process.patch
CommitLineData
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!
b4e1fa2c 8diff -ruN /dev/null b/patch_info/microsec_process.info
d4e9320e 9--- /dev/null 1970-01-01 09:00:00.000000000 +0900
b4e1fa2c 10+++ b/patch_info/microsec_process.info 2010-12-02 20:41:41.616069579 +0900
d4e9320e
AM
11@@ -0,0 +1,8 @@
12+File=microsec_process.patch
13+Name=Adds INFOMATION_SCHEMA.PROCESSLIST with TIME_MS column
14+Version=1.0
15+Author=Percona <info@percona.com>
16+License=GPL
17+Comment=
18+2010-01
19+Ported to 5.1.42
20diff -ruN a/sql/sql_show.cc b/sql/sql_show.cc
b4e1fa2c
AM
21--- a/sql/sql_show.cc 2010-12-02 19:22:40.054024541 +0900
22+++ b/sql/sql_show.cc 2010-12-02 20:41:41.622941425 +0900
adf0fb13 23@@ -1890,7 +1890,8 @@
d4e9320e
AM
24 TABLE *table= tables->table;
25 CHARSET_INFO *cs= system_charset_info;
26 char *user;
27- time_t now= my_time(0);
28+ time_t now;
29+ ulonglong now_utime= my_micro_time_and_time(&now);
30 DBUG_ENTER("fill_process_list");
31
32 user= thd->security_ctx->master_access & PROCESS_ACL ?
adf0fb13 33@@ -1974,6 +1975,10 @@
d4e9320e 34 }
b4e1fa2c 35 mysql_mutex_unlock(&tmp->LOCK_thd_data);
d4e9320e
AM
36
37+ /* TIME_MS */
38+ table->field[8]->store(((tmp->start_utime ?
39+ now_utime - tmp->start_utime : 0)/ 1000));
40+
41 if (schema_table_store_record(thd, table))
42 {
b4e1fa2c 43 mysql_mutex_unlock(&LOCK_thread_count);
adf0fb13 44@@ -7409,6 +7414,8 @@
d4e9320e
AM
45 {"STATE", 64, MYSQL_TYPE_STRING, 0, 1, "State", SKIP_OPEN_TABLE},
46 {"INFO", PROCESS_LIST_INFO_WIDTH, MYSQL_TYPE_STRING, 0, 1, "Info",
47 SKIP_OPEN_TABLE},
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}
51 };
52
This page took 0.09219 seconds and 4 git commands to generate.