summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorSergey Glukhov <Sergey.Glukhov@sun.com>2008-12-29 16:06:53 +0400
committerSergey Glukhov <Sergey.Glukhov@sun.com>2008-12-29 16:06:53 +0400
commitf67ce4761768a3ea05f8c4c11704fd5cd2065d3a (patch)
tree0613c29aa935252f59552e65e1feaa2eef6d0123 /sql
parenta31795b82d9b2f40cb2b489c99d6d03e036f039f (diff)
downloadmariadb-git-f67ce4761768a3ea05f8c4c11704fd5cd2065d3a.tar.gz
Bug#41131 "Questions" fails to increment - ignores statements instead stored procs(5.0 ver)
Added global status variable 'Queries' which represents total amount of queries executed by server including statements executed by SPs. note: It's old behaviour of 'Questions' variable.
Diffstat (limited to 'sql')
-rw-r--r--sql/mysqld.cc1
-rw-r--r--sql/sql_show.cc3
-rw-r--r--sql/structs.h2
3 files changed, 5 insertions, 1 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 269e1aed7cc..ca68976d939 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -6620,6 +6620,7 @@ struct show_var_st status_vars[]= {
{"Qcache_queries_in_cache", (char*) &query_cache.queries_in_cache, SHOW_LONG_CONST},
{"Qcache_total_blocks", (char*) &query_cache.total_blocks, SHOW_LONG_CONST},
#endif /*HAVE_QUERY_CACHE*/
+ {"Queries", (char*) 0, SHOW_QUERIES},
{"Questions", (char*) offsetof(STATUS_VAR, questions),
SHOW_LONG_STATUS},
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 322b1851560..2d8d6b13d4e 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -1543,6 +1543,9 @@ static bool show_status_array(THD *thd, const char *wild,
nr= (long) (thd->query_start() - server_start_time);
end= int10_to_str(nr, buff, 10);
break;
+ case SHOW_QUERIES:
+ end= int10_to_str((long) thd->query_id, buff, 10);
+ break;
#ifdef HAVE_REPLICATION
case SHOW_RPL_STATUS:
end= strmov(buff, rpl_status_type[(int)rpl_status]);
diff --git a/sql/structs.h b/sql/structs.h
index ab8537612fa..9882119b7c5 100644
--- a/sql/structs.h
+++ b/sql/structs.h
@@ -170,7 +170,7 @@ enum SHOW_TYPE
SHOW_UNDEF,
SHOW_LONG, SHOW_LONGLONG, SHOW_INT, SHOW_CHAR, SHOW_CHAR_PTR,
SHOW_DOUBLE_STATUS,
- SHOW_BOOL, SHOW_MY_BOOL, SHOW_OPENTABLES, SHOW_STARTTIME,
+ SHOW_BOOL, SHOW_MY_BOOL, SHOW_OPENTABLES, SHOW_STARTTIME, SHOW_QUERIES,
SHOW_LONG_CONST, SHOW_INT_CONST, SHOW_HAVE, SHOW_SYS, SHOW_HA_ROWS,
SHOW_VARS,
#ifdef HAVE_OPENSSL