summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authormonty@mysql.com/nosik.monty.fi <>2007-07-30 11:33:50 +0300
committermonty@mysql.com/nosik.monty.fi <>2007-07-30 11:33:50 +0300
commitb16289a5e05397211fd47e05ce08fe12f93ec38a (patch)
treeb1f9aa6b9e6bcbc36eded4aeb066d360e7541e72 /sql/sql_show.cc
parenta33c863ffd1e0de7bf72a590a90ee5c50180a677 (diff)
downloadmariadb-git-b16289a5e05397211fd47e05ce08fe12f93ec38a.tar.gz
Slow query log to file now displays queries with microsecond precission
--long-query-time is now given in seconds with microseconds as decimals --min_examined_row_limit added for slow query log long_query_time user variable is now double with 6 decimals Added functions to get time in microseconds Added faster time() functions for system that has gethrtime() (Solaris) We now do less time() calls. Added field->in_read_set() and field->in_write_set() for easier field manipulation by handlers set_var.cc and my_getopt() can now handle DOUBLE variables. All time() calls changed to my_time() my_time() now does retry's if time() call fails. Added debug function for stopping in mysql_admin_table() when tables are locked Some trivial function and struct variable renames to avoid merge errors. Fixed compiler warnings Initialization of some time variables on windows moved to my_init()
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc15
1 files changed, 6 insertions, 9 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 5b8cb93baab..6c5a408f2c8 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -1663,11 +1663,7 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
if (mysys_var)
pthread_mutex_unlock(&mysys_var->mutex);
-#ifdef EXTRA_DEBUG
- thd_info->start_time= tmp->time_after_lock;
-#else
thd_info->start_time= tmp->start_time;
-#endif
thd_info->query=0;
if (tmp->query)
{
@@ -1686,7 +1682,7 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
VOID(pthread_mutex_unlock(&LOCK_thread_count));
thread_info *thd_info;
- time_t now= time(0);
+ time_t now= my_time(0);
while ((thd_info=thread_infos.get()))
{
protocol->prepare_for_resend();
@@ -1716,7 +1712,7 @@ int fill_schema_processlist(THD* thd, TABLE_LIST* tables, COND* cond)
TABLE *table= tables->table;
CHARSET_INFO *cs= system_charset_info;
char *user;
- time_t now= time(0);
+ time_t now= my_time(0);
DBUG_ENTER("fill_process_list");
user= thd->security_ctx->master_access & PROCESS_ACL ?
@@ -2069,11 +2065,11 @@ static bool show_status_array(THD *thd, const char *wild,
*/
switch (show_type) {
case SHOW_DOUBLE_STATUS:
- {
value= ((char *) status_var + (ulong) value);
- end= buff + sprintf(buff, "%f", *(double*) value);
+ /* fall through */
+ case SHOW_DOUBLE:
+ end= buff + my_sprintf(buff, (buff, "%f", *(double*) value));
break;
- }
case SHOW_LONG_STATUS:
value= ((char *) status_var + (ulong) value);
/* fall through */
@@ -2083,6 +2079,7 @@ static bool show_status_array(THD *thd, const char *wild,
break;
case SHOW_LONGLONG_STATUS:
value= ((char *) status_var + (ulonglong) value);
+ /* fall through */
case SHOW_LONGLONG:
end= longlong10_to_str(*(longlong*) value, buff, 10);
break;