Commit 0eccb932 authored by Jon Olav Hauglid's avatar Jon Olav Hauglid

Bug #44651 "have_community_features" variable should be renamed

           "have_profiling"

1) Renamed have_community_features server system variable to
have_profiling.
2) Removed eable-community-features configure option and
ENABLE_COMMUNITY_FEATURES macro.
3) Removed COMMUNITY_SERVER macro and replaced its usage by 
ENABLED_PROFILING.

Only --enable-profiling is now needed to enable profiling.
It was the only existing "community feature", so there was
no need for both configure options.

Using --enable-community-features will give a warning message
since it no longer exists.
parent 5eb71aca
...@@ -617,24 +617,6 @@ then ...@@ -617,24 +617,6 @@ then
fi fi
fi fi
AC_MSG_CHECKING(whether features provided by the user community should be included.)
AC_ARG_ENABLE(community-features,
AC_HELP_STRING(
[--disable-community-features],
[Disable additional features provided by the user community.]),
[ ENABLE_COMMUNITY_FEATURES=$enableval ],
[ ENABLE_COMMUNITY_FEATURES=yes ]
)
if test "$ENABLE_COMMUNITY_FEATURES" = "yes"
then
AC_DEFINE([COMMUNITY_SERVER], [1],
[Whether features provided by the user community should be included])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AC_ARG_WITH(server-suffix, AC_ARG_WITH(server-suffix,
[ --with-server-suffix Append value to the version string.], [ --with-server-suffix Append value to the version string.],
[ MYSQL_SERVER_SUFFIX=`echo "$withval" | sed -e 's/^\(...................................\)..*$/\1/'` ], [ MYSQL_SERVER_SUFFIX=`echo "$withval" | sed -e 's/^\(...................................\)..*$/\1/'` ],
...@@ -700,21 +682,14 @@ fi ...@@ -700,21 +682,14 @@ fi
# Add query profiler # Add query profiler
AC_MSG_CHECKING(if SHOW PROFILE should be enabled.) AC_MSG_CHECKING(if SHOW PROFILE should be enabled.)
AC_ARG_ENABLE(profiling, AC_ARG_ENABLE(profiling,
AS_HELP_STRING([--enable-profiling], [Build a version with query profiling code (req. community-features)]), AS_HELP_STRING([--enable-profiling], [Enable profiling of query lifetime.]),
[ ENABLED_PROFILING=$enableval ], [ ENABLED_PROFILING=$enableval ],
[ ENABLED_PROFILING=$ENABLE_COMMUNITY_FEATURES ]) [ ENABLED_PROFILING=no ])
AC_DEFINE([ENABLED_PROFILING], [1], [If SHOW PROFILE should be enabled])
if test "$ENABLED_PROFILING" = "yes" if test "$ENABLED_PROFILING" = "yes"
then then
if test "$ENABLE_COMMUNITY_FEATURES" = "yes";
then
AC_DEFINE([ENABLED_PROFILING], [1],
[If SHOW PROFILE should be enabled])
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
else
ENABLED_PROFILING="no"
AC_MSG_RESULT([no, overridden by community-features disabled])
fi
else else
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
fi fi
......
...@@ -353,7 +353,6 @@ inline ulonglong double2ulonglong(double d) ...@@ -353,7 +353,6 @@ inline ulonglong double2ulonglong(double d)
#define HAVE_OPENSSL 1 #define HAVE_OPENSSL 1
#define HAVE_YASSL 1 #define HAVE_YASSL 1
#define COMMUNITY_SERVER 1
#define ENABLED_PROFILING 1 #define ENABLED_PROFILING 1
/* /*
......
...@@ -98,7 +98,7 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command, ...@@ -98,7 +98,7 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
thd= (THD *) mysql->thd; thd= (THD *) mysql->thd;
} }
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER) #if defined(ENABLED_PROFILING)
thd->profiling.start_new_query(); thd->profiling.start_new_query();
#endif #endif
...@@ -142,7 +142,7 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command, ...@@ -142,7 +142,7 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
if (!skip_check) if (!skip_check)
result= thd->is_error() ? -1 : 0; result= thd->is_error() ? -1 : 0;
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER) #if defined(ENABLED_PROFILING)
thd->profiling.finish_current_query(); thd->profiling.finish_current_query();
#endif #endif
return result; return result;
......
--require r/have_community_features.require --require r/have_profiling.require
--disable_query_log --disable_query_log
show variables like 'have_community_features'; show variables like 'have_profiling';
--enable_query_log --enable_query_log
Variable_name Value Variable_name Value
have_community_features YES have_profiling YES
--source include/have_community_features.inc --source include/have_profiling.inc
# Verify that the protocol isn't violated if we ask for profiling info # Verify that the protocol isn't violated if we ask for profiling info
# before profiling has recorded anything. # before profiling has recorded anything.
......
--source include/have_community_features.inc --source include/have_profiling.inc
# #
# Bug#24822: Patch: uptime_since_flush_status # Bug#24822: Patch: uptime_since_flush_status
......
...@@ -2082,7 +2082,7 @@ extern uint sql_command_flags[]; ...@@ -2082,7 +2082,7 @@ extern uint sql_command_flags[];
extern TYPELIB log_output_typelib; extern TYPELIB log_output_typelib;
/* optional things, have_* variables */ /* optional things, have_* variables */
extern SHOW_COMP_OPTION have_community_features; extern SHOW_COMP_OPTION have_profiling;
extern handlerton *partition_hton; extern handlerton *partition_hton;
extern handlerton *myisam_hton; extern handlerton *myisam_hton;
......
...@@ -635,7 +635,7 @@ MY_LOCALE *my_default_lc_time_names; ...@@ -635,7 +635,7 @@ MY_LOCALE *my_default_lc_time_names;
SHOW_COMP_OPTION have_ssl, have_symlink, have_dlopen, have_query_cache; SHOW_COMP_OPTION have_ssl, have_symlink, have_dlopen, have_query_cache;
SHOW_COMP_OPTION have_geometry, have_rtree_keys; SHOW_COMP_OPTION have_geometry, have_rtree_keys;
SHOW_COMP_OPTION have_crypt, have_compress; SHOW_COMP_OPTION have_crypt, have_compress;
SHOW_COMP_OPTION have_community_features; SHOW_COMP_OPTION have_profiling;
/* Thread specific variables */ /* Thread specific variables */
...@@ -6230,7 +6230,7 @@ master-ssl", ...@@ -6230,7 +6230,7 @@ master-ssl",
"Maximum time in seconds to wait for the port to become free. " "Maximum time in seconds to wait for the port to become free. "
"(Default: no wait)", (uchar**) &mysqld_port_timeout, "(Default: no wait)", (uchar**) &mysqld_port_timeout,
(uchar**) &mysqld_port_timeout, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, (uchar**) &mysqld_port_timeout, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER) #if defined(ENABLED_PROFILING)
{"profiling_history_size", OPT_PROFILING, "Limit of query profiling memory", {"profiling_history_size", OPT_PROFILING, "Limit of query profiling memory",
(uchar**) &global_system_variables.profiling_history_size, (uchar**) &global_system_variables.profiling_history_size,
(uchar**) &max_system_variables.profiling_history_size, (uchar**) &max_system_variables.profiling_history_size,
...@@ -7028,7 +7028,7 @@ static int show_starttime(THD *thd, SHOW_VAR *var, char *buff) ...@@ -7028,7 +7028,7 @@ static int show_starttime(THD *thd, SHOW_VAR *var, char *buff)
return 0; return 0;
} }
#ifdef COMMUNITY_SERVER #ifdef ENABLED_PROFILING
static int show_flushstatustime(THD *thd, SHOW_VAR *var, char *buff) static int show_flushstatustime(THD *thd, SHOW_VAR *var, char *buff)
{ {
var->type= SHOW_LONG; var->type= SHOW_LONG;
...@@ -7486,7 +7486,7 @@ SHOW_VAR status_vars[]= { ...@@ -7486,7 +7486,7 @@ SHOW_VAR status_vars[]= {
{"Threads_created", (char*) &thread_created, SHOW_LONG_NOFLUSH}, {"Threads_created", (char*) &thread_created, SHOW_LONG_NOFLUSH},
{"Threads_running", (char*) &thread_running, SHOW_INT}, {"Threads_running", (char*) &thread_running, SHOW_INT},
{"Uptime", (char*) &show_starttime, SHOW_FUNC}, {"Uptime", (char*) &show_starttime, SHOW_FUNC},
#ifdef COMMUNITY_SERVER #ifdef ENABLED_PROFILING
{"Uptime_since_flush_status",(char*) &show_flushstatustime, SHOW_FUNC}, {"Uptime_since_flush_status",(char*) &show_flushstatustime, SHOW_FUNC},
#endif #endif
{NullS, NullS, SHOW_LONG} {NullS, NullS, SHOW_LONG}
...@@ -7719,10 +7719,10 @@ static int mysql_init_variables(void) ...@@ -7719,10 +7719,10 @@ static int mysql_init_variables(void)
"d:t:i:o,/tmp/mysqld.trace"); "d:t:i:o,/tmp/mysqld.trace");
#endif #endif
opt_error_log= IF_WIN(1,0); opt_error_log= IF_WIN(1,0);
#ifdef COMMUNITY_SERVER #ifdef ENABLED_PROFILING
have_community_features = SHOW_OPTION_YES; have_profiling = SHOW_OPTION_YES;
#else #else
have_community_features = SHOW_OPTION_NO; have_profiling = SHOW_OPTION_NO;
#endif #endif
global_system_variables.ndb_index_stat_enable=FALSE; global_system_variables.ndb_index_stat_enable=FALSE;
max_system_variables.ndb_index_stat_enable=TRUE; max_system_variables.ndb_index_stat_enable=TRUE;
...@@ -8826,9 +8826,7 @@ void refresh_status(THD *thd) ...@@ -8826,9 +8826,7 @@ void refresh_status(THD *thd)
/* Reset the counters of all key caches (default and named). */ /* Reset the counters of all key caches (default and named). */
process_key_caches(reset_key_cache_counters); process_key_caches(reset_key_cache_counters);
#ifdef COMMUNITY_SERVER
flush_status_time= time((time_t*) 0); flush_status_time= time((time_t*) 0);
#endif
pthread_mutex_unlock(&LOCK_status); pthread_mutex_unlock(&LOCK_status);
/* /*
......
...@@ -762,7 +762,7 @@ static sys_var_thd_bit sys_unique_checks(&vars, "unique_checks", 0, ...@@ -762,7 +762,7 @@ static sys_var_thd_bit sys_unique_checks(&vars, "unique_checks", 0,
OPTION_RELAXED_UNIQUE_CHECKS, OPTION_RELAXED_UNIQUE_CHECKS,
1, 1,
sys_var::SESSION_VARIABLE_IN_BINLOG); sys_var::SESSION_VARIABLE_IN_BINLOG);
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER) #if defined(ENABLED_PROFILING)
static sys_var_thd_bit sys_profiling(&vars, "profiling", NULL, static sys_var_thd_bit sys_profiling(&vars, "profiling", NULL,
set_option_bit, set_option_bit,
ulonglong(OPTION_PROFILING)); ulonglong(OPTION_PROFILING));
...@@ -864,9 +864,9 @@ static sys_var_have_plugin sys_have_ndbcluster(&vars, "have_ndbcluster", C_STRIN ...@@ -864,9 +864,9 @@ static sys_var_have_plugin sys_have_ndbcluster(&vars, "have_ndbcluster", C_STRIN
static sys_var_have_variable sys_have_openssl(&vars, "have_openssl", &have_ssl); static sys_var_have_variable sys_have_openssl(&vars, "have_openssl", &have_ssl);
static sys_var_have_variable sys_have_ssl(&vars, "have_ssl", &have_ssl); static sys_var_have_variable sys_have_ssl(&vars, "have_ssl", &have_ssl);
static sys_var_have_plugin sys_have_partition_db(&vars, "have_partitioning", C_STRING_WITH_LEN("partition"), MYSQL_STORAGE_ENGINE_PLUGIN); static sys_var_have_plugin sys_have_partition_db(&vars, "have_partitioning", C_STRING_WITH_LEN("partition"), MYSQL_STORAGE_ENGINE_PLUGIN);
static sys_var_have_variable sys_have_profiling(&vars, "have_profiling", &have_profiling);
static sys_var_have_variable sys_have_query_cache(&vars, "have_query_cache", static sys_var_have_variable sys_have_query_cache(&vars, "have_query_cache",
&have_query_cache); &have_query_cache);
static sys_var_have_variable sys_have_community_features(&vars, "have_community_features", &have_community_features);
static sys_var_have_variable sys_have_rtree_keys(&vars, "have_rtree_keys", &have_rtree_keys); static sys_var_have_variable sys_have_rtree_keys(&vars, "have_rtree_keys", &have_rtree_keys);
static sys_var_have_variable sys_have_symlink(&vars, "have_symlink", &have_symlink); static sys_var_have_variable sys_have_symlink(&vars, "have_symlink", &have_symlink);
/* Global read-only variable describing server license */ /* Global read-only variable describing server license */
......
...@@ -1207,7 +1207,7 @@ sp_head::execute(THD *thd) ...@@ -1207,7 +1207,7 @@ sp_head::execute(THD *thd)
*/ */
thd->spcont->callers_arena= &backup_arena; thd->spcont->callers_arena= &backup_arena;
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER) #if defined(ENABLED_PROFILING)
/* Discard the initial part of executing routines. */ /* Discard the initial part of executing routines. */
thd->profiling.discard_current_query(); thd->profiling.discard_current_query();
#endif #endif
...@@ -1216,7 +1216,7 @@ sp_head::execute(THD *thd) ...@@ -1216,7 +1216,7 @@ sp_head::execute(THD *thd)
sp_instr *i; sp_instr *i;
uint hip; // Handler ip uint hip; // Handler ip
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER) #if defined(ENABLED_PROFILING)
/* /*
Treat each "instr" of a routine as discrete unit that could be profiled. Treat each "instr" of a routine as discrete unit that could be profiled.
Profiling only records information for segments of code that set the Profiling only records information for segments of code that set the
...@@ -1229,7 +1229,7 @@ sp_head::execute(THD *thd) ...@@ -1229,7 +1229,7 @@ sp_head::execute(THD *thd)
i = get_instr(ip); // Returns NULL when we're done. i = get_instr(ip); // Returns NULL when we're done.
if (i == NULL) if (i == NULL)
{ {
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER) #if defined(ENABLED_PROFILING)
thd->profiling.discard_current_query(); thd->profiling.discard_current_query();
#endif #endif
break; break;
...@@ -1312,7 +1312,7 @@ sp_head::execute(THD *thd) ...@@ -1312,7 +1312,7 @@ sp_head::execute(THD *thd)
} }
} while (!err_status && !thd->killed && !thd->is_fatal_error); } while (!err_status && !thd->killed && !thd->is_fatal_error);
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER) #if defined(ENABLED_PROFILING)
thd->profiling.finish_current_query(); thd->profiling.finish_current_query();
thd->profiling.start_new_query("tail end of routine"); thd->profiling.start_new_query("tail end of routine");
#endif #endif
...@@ -2844,7 +2844,7 @@ sp_instr_stmt::execute(THD *thd, uint *nextp) ...@@ -2844,7 +2844,7 @@ sp_instr_stmt::execute(THD *thd, uint *nextp)
query= thd->query; query= thd->query;
query_length= thd->query_length; query_length= thd->query_length;
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER) #if defined(ENABLED_PROFILING)
/* This s-p instr is profilable and will be captured. */ /* This s-p instr is profilable and will be captured. */
thd->profiling.set_query_source(m_query.str, m_query.length); thd->profiling.set_query_source(m_query.str, m_query.length);
#endif #endif
......
...@@ -257,7 +257,7 @@ const char *set_thd_proc_info(THD *thd, const char *info, ...@@ -257,7 +257,7 @@ const char *set_thd_proc_info(THD *thd, const char *info,
const char *old_info= thd->proc_info; const char *old_info= thd->proc_info;
DBUG_PRINT("proc_info", ("%s:%d %s", calling_file, calling_line, DBUG_PRINT("proc_info", ("%s:%d %s", calling_file, calling_line,
(info != NULL) ? info : "(null)")); (info != NULL) ? info : "(null)"));
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER) #if defined(ENABLED_PROFILING)
thd->profiling.status_change(info, calling_function, calling_file, calling_line); thd->profiling.status_change(info, calling_function, calling_file, calling_line);
#endif #endif
thd->proc_info= info; thd->proc_info= info;
...@@ -522,7 +522,7 @@ THD::THD() ...@@ -522,7 +522,7 @@ THD::THD()
*scramble= '\0'; *scramble= '\0';
init(); init();
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER) #if defined(ENABLED_PROFILING)
profiling.set_thd(this); profiling.set_thd(this);
#endif #endif
user_connect=(USER_CONN *)0; user_connect=(USER_CONN *)0;
......
...@@ -1644,7 +1644,7 @@ public: ...@@ -1644,7 +1644,7 @@ public:
CHARSET_INFO *db_charset; CHARSET_INFO *db_charset;
Warning_info *warning_info; Warning_info *warning_info;
Diagnostics_area *stmt_da; Diagnostics_area *stmt_da;
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER) #if defined(ENABLED_PROFILING)
PROFILING profiling; PROFILING profiling;
#endif #endif
......
...@@ -375,7 +375,7 @@ void execute_init_command(THD *thd, sys_var_str *init_command_var, ...@@ -375,7 +375,7 @@ void execute_init_command(THD *thd, sys_var_str *init_command_var,
Vio* save_vio; Vio* save_vio;
ulong save_client_capabilities; ulong save_client_capabilities;
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER) #if defined(ENABLED_PROFILING)
thd->profiling.start_new_query(); thd->profiling.start_new_query();
thd->profiling.set_query_source(init_command_var->value, thd->profiling.set_query_source(init_command_var->value,
init_command_var->value_length); init_command_var->value_length);
...@@ -403,7 +403,7 @@ void execute_init_command(THD *thd, sys_var_str *init_command_var, ...@@ -403,7 +403,7 @@ void execute_init_command(THD *thd, sys_var_str *init_command_var,
thd->client_capabilities= save_client_capabilities; thd->client_capabilities= save_client_capabilities;
thd->net.vio= save_vio; thd->net.vio= save_vio;
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER) #if defined(ENABLED_PROFILING)
thd->profiling.finish_current_query(); thd->profiling.finish_current_query();
#endif #endif
} }
...@@ -479,7 +479,7 @@ static void handle_bootstrap_impl(THD *thd) ...@@ -479,7 +479,7 @@ static void handle_bootstrap_impl(THD *thd)
QUERY_CACHE_FLAGS_SIZE); QUERY_CACHE_FLAGS_SIZE);
thd->set_query(query, length); thd->set_query(query, length);
DBUG_PRINT("query",("%-.4096s",thd->query)); DBUG_PRINT("query",("%-.4096s",thd->query));
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER) #if defined(ENABLED_PROFILING)
thd->profiling.start_new_query(); thd->profiling.start_new_query();
thd->profiling.set_query_source(thd->query, length); thd->profiling.set_query_source(thd->query, length);
#endif #endif
...@@ -496,7 +496,7 @@ static void handle_bootstrap_impl(THD *thd) ...@@ -496,7 +496,7 @@ static void handle_bootstrap_impl(THD *thd)
bootstrap_error= thd->is_error(); bootstrap_error= thd->is_error();
net_end_statement(thd); net_end_statement(thd);
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER) #if defined(ENABLED_PROFILING)
thd->profiling.finish_current_query(); thd->profiling.finish_current_query();
#endif #endif
...@@ -806,7 +806,7 @@ bool do_command(THD *thd) ...@@ -806,7 +806,7 @@ bool do_command(THD *thd)
net_new_transaction(net); net_new_transaction(net);
packet_length= my_net_read(net); packet_length= my_net_read(net);
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER) #if defined(ENABLED_PROFILING)
thd->profiling.start_new_query(); thd->profiling.start_new_query();
#endif #endif
if (packet_length == packet_error) if (packet_length == packet_error)
...@@ -866,7 +866,7 @@ bool do_command(THD *thd) ...@@ -866,7 +866,7 @@ bool do_command(THD *thd)
return_value= dispatch_command(command, thd, packet+1, (uint) (packet_length-1)); return_value= dispatch_command(command, thd, packet+1, (uint) (packet_length-1));
out: out:
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER) #if defined(ENABLED_PROFILING)
thd->profiling.finish_current_query(); thd->profiling.finish_current_query();
#endif #endif
DBUG_RETURN(return_value); DBUG_RETURN(return_value);
...@@ -1223,7 +1223,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, ...@@ -1223,7 +1223,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
general_log_write(thd, command, thd->query, thd->query_length); general_log_write(thd, command, thd->query, thd->query_length);
DBUG_PRINT("query",("%-.4096s",thd->query)); DBUG_PRINT("query",("%-.4096s",thd->query));
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER) #if defined(ENABLED_PROFILING)
thd->profiling.set_query_source(thd->query, thd->query_length); thd->profiling.set_query_source(thd->query, thd->query_length);
#endif #endif
...@@ -1258,7 +1258,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, ...@@ -1258,7 +1258,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
MYSQL_QUERY_DONE(thd->is_error()); MYSQL_QUERY_DONE(thd->is_error());
} }
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER) #if defined(ENABLED_PROFILING)
thd->profiling.finish_current_query(); thd->profiling.finish_current_query();
thd->profiling.start_new_query("continuing"); thd->profiling.start_new_query("continuing");
thd->profiling.set_query_source(beginning_of_next_stmt, length); thd->profiling.set_query_source(beginning_of_next_stmt, length);
...@@ -1778,7 +1778,7 @@ int prepare_schema_table(THD *thd, LEX *lex, Table_ident *table_ident, ...@@ -1778,7 +1778,7 @@ int prepare_schema_table(THD *thd, LEX *lex, Table_ident *table_ident,
Mark this current profiling record to be discarded. We don't Mark this current profiling record to be discarded. We don't
wish to have SHOW commands show up in profiling. wish to have SHOW commands show up in profiling.
*/ */
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER) #if defined(ENABLED_PROFILING)
thd->profiling.discard_current_query(); thd->profiling.discard_current_query();
#endif #endif
break; break;
...@@ -2333,7 +2333,7 @@ mysql_execute_command(THD *thd) ...@@ -2333,7 +2333,7 @@ mysql_execute_command(THD *thd)
} }
case SQLCOM_SHOW_PROFILES: case SQLCOM_SHOW_PROFILES:
{ {
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER) #if defined(ENABLED_PROFILING)
thd->profiling.discard_current_query(); thd->profiling.discard_current_query();
res= thd->profiling.show_profiles(); res= thd->profiling.show_profiles();
if (res) if (res)
......
...@@ -2459,7 +2459,7 @@ void mysqld_stmt_execute(THD *thd, char *packet_arg, uint packet_length) ...@@ -2459,7 +2459,7 @@ void mysqld_stmt_execute(THD *thd, char *packet_arg, uint packet_length)
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER) #if defined(ENABLED_PROFILING)
thd->profiling.set_query_source(stmt->query, stmt->query_length); thd->profiling.set_query_source(stmt->query, stmt->query_length);
#endif #endif
DBUG_PRINT("exec_query", ("%s", stmt->query)); DBUG_PRINT("exec_query", ("%s", stmt->query));
......
...@@ -47,7 +47,7 @@ const char * const _unknown_func_ = "<unknown>"; ...@@ -47,7 +47,7 @@ const char * const _unknown_func_ = "<unknown>";
int fill_query_profile_statistics_info(THD *thd, TABLE_LIST *tables, int fill_query_profile_statistics_info(THD *thd, TABLE_LIST *tables,
Item *cond) Item *cond)
{ {
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER) #if defined(ENABLED_PROFILING)
return(thd->profiling.fill_statistics_info(thd, tables, cond)); return(thd->profiling.fill_statistics_info(thd, tables, cond));
#else #else
my_error(ER_FEATURE_DISABLED, MYF(0), "SHOW PROFILE", "enable-profiling"); my_error(ER_FEATURE_DISABLED, MYF(0), "SHOW PROFILE", "enable-profiling");
...@@ -129,7 +129,7 @@ int make_profile_table_for_show(THD *thd, ST_SCHEMA_TABLE *schema_table) ...@@ -129,7 +129,7 @@ int make_profile_table_for_show(THD *thd, ST_SCHEMA_TABLE *schema_table)
} }
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER) #if defined(ENABLED_PROFILING)
#define RUSAGE_USEC(tv) ((tv).tv_sec*1000*1000 + (tv).tv_usec) #define RUSAGE_USEC(tv) ((tv).tv_sec*1000*1000 + (tv).tv_usec)
#define RUSAGE_DIFF_USEC(tv1, tv2) (RUSAGE_USEC((tv1))-RUSAGE_USEC((tv2))) #define RUSAGE_DIFF_USEC(tv1, tv2) (RUSAGE_USEC((tv1))-RUSAGE_USEC((tv2)))
......
...@@ -41,7 +41,7 @@ int make_profile_table_for_show(THD *thd, ST_SCHEMA_TABLE *schema_table); ...@@ -41,7 +41,7 @@ int make_profile_table_for_show(THD *thd, ST_SCHEMA_TABLE *schema_table);
#define PROFILE_ALL (uint)(~0) #define PROFILE_ALL (uint)(~0)
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER) #if defined(ENABLED_PROFILING)
#include "mysql_priv.h" #include "mysql_priv.h"
#ifdef HAVE_SYS_RESOURCE_H #ifdef HAVE_SYS_RESOURCE_H
......
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