Commit 83d06868 authored by unknown's avatar unknown

Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community--bug24822

into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community

parents 03490a84 351b9664
......@@ -32,3 +32,5 @@
459c03b9N_mqF2XJKK6DwSrIt7e6_g
459c1965_BQMBzBO8S_gVqjTHYQrmw
459c2098XoAUsUn8N07IVRDD6CTM-A
459ea845XenN-uWqEM5LFvUT60tW_A
45af88c9RIIJWPfBxs3o7zekI-ELPQ
......@@ -1269,3 +1269,10 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> system NULL NULL NULL NULL 0 const row not found
2 DERIVED tables ALL NULL NULL NULL NULL 2
drop view v1;
show global status like "Uptime_%";
Variable_name Value
Uptime_since_flush_status #
flush status;
show global status like "Uptime_%";
Variable_name Value
Uptime_since_flush_status #
......@@ -971,9 +971,6 @@ SELECT COLUMN_NAME, MD5(COLUMN_DEFAULT), LENGTH(COLUMN_DEFAULT), COLUMN_DEFAULT=
DROP TABLE bug23037;
DROP FUNCTION get_value;
#
# Bug#22413: EXPLAIN SELECT FROM view with ORDER BY yield server crash
#
......@@ -987,4 +984,14 @@ explain select * from v1;
explain select * from (select table_name from information_schema.tables) as a;
drop view v1;
#
# Bug#24822: Patch: uptime_since_flush_status
#
--replace_column 2 #
show global status like "Uptime_%";
flush status;
--replace_column 2 #
show global status like "Uptime_%"; # Almost certainly zero
# End of 5.0 tests.
......@@ -1190,7 +1190,7 @@ void my_dbopt_free(void);
External variables
*/
extern time_t start_time;
extern time_t start_time, flush_status_time;
extern char *mysql_data_home,server_version[SERVER_VERSION_LENGTH],
mysql_real_data_home[], *opt_mysql_tmpdir, mysql_charsets_dir[],
def_ft_boolean_syntax[sizeof(ft_boolean_syntax)];
......
......@@ -428,7 +428,7 @@ ulong expire_logs_days = 0;
ulong rpl_recovery_rank=0;
double log_10[32]; /* 10 potences */
time_t start_time;
time_t start_time, flush_status_time;
char mysql_home[FN_REFLEN], pidfile_name[FN_REFLEN], system_time_zone[30];
char *default_tz_name;
......@@ -2589,7 +2589,7 @@ static int init_common_variables(const char *conf_file_name, int argc,
tzset(); // Set tzname
max_system_variables.pseudo_thread_id= (ulong)~0;
start_time=time((time_t*) 0);
start_time= flush_status_time= time((time_t*) 0);
if (init_thread_environment())
return 1;
mysql_init_variables();
......@@ -6264,6 +6264,7 @@ struct show_var_st status_vars[]= {
{"Threads_created", (char*) &thread_created, SHOW_LONG_CONST},
{"Threads_running", (char*) &thread_running, SHOW_INT_CONST},
{"Uptime", (char*) 0, SHOW_STARTTIME},
{"Uptime_since_flush_status",(char*) 0, SHOW_FLUSHTIME},
{NullS, NullS, SHOW_LONG}
};
......@@ -7534,6 +7535,7 @@ void refresh_status(THD *thd)
/* Reset the counters of all key caches (default and named). */
process_key_caches(reset_key_cache_counters);
flush_status_time= time((time_t*) 0);
pthread_mutex_unlock(&LOCK_status);
/*
......
......@@ -1492,6 +1492,10 @@ static bool show_status_array(THD *thd, const char *wild,
nr= (long) (thd->query_start() - start_time);
end= int10_to_str(nr, buff, 10);
break;
case SHOW_FLUSHTIME:
nr= (long) (thd->query_start() - flush_status_time);
end= int10_to_str(nr, buff, 10);
break;
case SHOW_QUESTION:
end= int10_to_str((long) thd->query_id, buff, 10);
break;
......
......@@ -174,6 +174,7 @@ enum SHOW_TYPE
SHOW_BOOL, SHOW_MY_BOOL, SHOW_OPENTABLES, SHOW_STARTTIME, SHOW_QUESTION,
SHOW_LONG_CONST, SHOW_INT_CONST, SHOW_HAVE, SHOW_SYS, SHOW_HA_ROWS,
SHOW_VARS,
SHOW_FLUSHTIME,
#ifdef HAVE_OPENSSL
SHOW_SSL_CTX_SESS_ACCEPT, SHOW_SSL_CTX_SESS_ACCEPT_GOOD,
SHOW_SSL_GET_VERSION, SHOW_SSL_CTX_GET_SESSION_CACHE_MODE,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment