mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
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.
This commit is contained in:
parent
220d9b8c4a
commit
0da357645c
19 changed files with 46 additions and 74 deletions
33
configure.in
33
configure.in
|
@ -617,24 +617,6 @@ then
|
|||
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,
|
||||
[ --with-server-suffix Append value to the version string.],
|
||||
[ MYSQL_SERVER_SUFFIX=`echo "$withval" | sed -e 's/^\(...................................\)..*$/\1/'` ],
|
||||
|
@ -700,21 +682,14 @@ fi
|
|||
# Add query profiler
|
||||
AC_MSG_CHECKING(if SHOW PROFILE should be enabled.)
|
||||
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=$ENABLE_COMMUNITY_FEATURES ])
|
||||
[ ENABLED_PROFILING=no ])
|
||||
|
||||
AC_DEFINE([ENABLED_PROFILING], [1], [If SHOW PROFILE should be enabled])
|
||||
if test "$ENABLED_PROFILING" = "yes"
|
||||
then
|
||||
if test "$ENABLE_COMMUNITY_FEATURES" = "yes";
|
||||
then
|
||||
AC_DEFINE([ENABLED_PROFILING], [1],
|
||||
[If SHOW PROFILE should be enabled])
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
ENABLED_PROFILING="no"
|
||||
AC_MSG_RESULT([no, overridden by community-features disabled])
|
||||
fi
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
|
|
@ -353,7 +353,6 @@ inline ulonglong double2ulonglong(double d)
|
|||
#define HAVE_OPENSSL 1
|
||||
#define HAVE_YASSL 1
|
||||
|
||||
#define COMMUNITY_SERVER 1
|
||||
#define ENABLED_PROFILING 1
|
||||
|
||||
/*
|
||||
|
|
|
@ -98,7 +98,7 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
|
|||
thd= (THD *) mysql->thd;
|
||||
}
|
||||
|
||||
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
|
||||
#if defined(ENABLED_PROFILING)
|
||||
thd->profiling.start_new_query();
|
||||
#endif
|
||||
|
||||
|
@ -142,7 +142,7 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
|
|||
if (!skip_check)
|
||||
result= thd->is_error() ? -1 : 0;
|
||||
|
||||
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
|
||||
#if defined(ENABLED_PROFILING)
|
||||
thd->profiling.finish_current_query();
|
||||
#endif
|
||||
return result;
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
--require r/have_community_features.require
|
||||
--disable_query_log
|
||||
show variables like 'have_community_features';
|
||||
--enable_query_log
|
4
mysql-test/include/have_profiling.inc
Normal file
4
mysql-test/include/have_profiling.inc
Normal file
|
@ -0,0 +1,4 @@
|
|||
--require r/have_profiling.require
|
||||
--disable_query_log
|
||||
show variables like 'have_profiling';
|
||||
--enable_query_log
|
|
@ -1,2 +0,0 @@
|
|||
Variable_name Value
|
||||
have_community_features YES
|
2
mysql-test/r/have_profiling.require
Normal file
2
mysql-test/r/have_profiling.require
Normal file
|
@ -0,0 +1,2 @@
|
|||
Variable_name Value
|
||||
have_profiling YES
|
|
@ -1,4 +1,4 @@
|
|||
--source include/have_community_features.inc
|
||||
--source include/have_profiling.inc
|
||||
|
||||
# Verify that the protocol isn't violated if we ask for profiling info
|
||||
# before profiling has recorded anything.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
--source include/have_community_features.inc
|
||||
--source include/have_profiling.inc
|
||||
|
||||
#
|
||||
# Bug#24822: Patch: uptime_since_flush_status
|
||||
|
|
|
@ -2082,7 +2082,7 @@ extern uint sql_command_flags[];
|
|||
extern TYPELIB log_output_typelib;
|
||||
|
||||
/* optional things, have_* variables */
|
||||
extern SHOW_COMP_OPTION have_community_features;
|
||||
extern SHOW_COMP_OPTION have_profiling;
|
||||
|
||||
extern handlerton *partition_hton;
|
||||
extern handlerton *myisam_hton;
|
||||
|
|
|
@ -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_geometry, have_rtree_keys;
|
||||
SHOW_COMP_OPTION have_crypt, have_compress;
|
||||
SHOW_COMP_OPTION have_community_features;
|
||||
SHOW_COMP_OPTION have_profiling;
|
||||
|
||||
/* Thread specific variables */
|
||||
|
||||
|
@ -6230,7 +6230,7 @@ master-ssl",
|
|||
"Maximum time in seconds to wait for the port to become free. "
|
||||
"(Default: no wait)", (uchar**) &mysqld_port_timeout,
|
||||
(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",
|
||||
(uchar**) &global_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)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef COMMUNITY_SERVER
|
||||
#ifdef ENABLED_PROFILING
|
||||
static int show_flushstatustime(THD *thd, SHOW_VAR *var, char *buff)
|
||||
{
|
||||
var->type= SHOW_LONG;
|
||||
|
@ -7486,7 +7486,7 @@ SHOW_VAR status_vars[]= {
|
|||
{"Threads_created", (char*) &thread_created, SHOW_LONG_NOFLUSH},
|
||||
{"Threads_running", (char*) &thread_running, SHOW_INT},
|
||||
{"Uptime", (char*) &show_starttime, SHOW_FUNC},
|
||||
#ifdef COMMUNITY_SERVER
|
||||
#ifdef ENABLED_PROFILING
|
||||
{"Uptime_since_flush_status",(char*) &show_flushstatustime, SHOW_FUNC},
|
||||
#endif
|
||||
{NullS, NullS, SHOW_LONG}
|
||||
|
@ -7719,10 +7719,10 @@ static int mysql_init_variables(void)
|
|||
"d:t:i:o,/tmp/mysqld.trace");
|
||||
#endif
|
||||
opt_error_log= IF_WIN(1,0);
|
||||
#ifdef COMMUNITY_SERVER
|
||||
have_community_features = SHOW_OPTION_YES;
|
||||
#ifdef ENABLED_PROFILING
|
||||
have_profiling = SHOW_OPTION_YES;
|
||||
#else
|
||||
have_community_features = SHOW_OPTION_NO;
|
||||
have_profiling = SHOW_OPTION_NO;
|
||||
#endif
|
||||
global_system_variables.ndb_index_stat_enable=FALSE;
|
||||
max_system_variables.ndb_index_stat_enable=TRUE;
|
||||
|
@ -8826,9 +8826,7 @@ void refresh_status(THD *thd)
|
|||
|
||||
/* Reset the counters of all key caches (default and named). */
|
||||
process_key_caches(reset_key_cache_counters);
|
||||
#ifdef COMMUNITY_SERVER
|
||||
flush_status_time= time((time_t*) 0);
|
||||
#endif
|
||||
pthread_mutex_unlock(&LOCK_status);
|
||||
|
||||
/*
|
||||
|
|
|
@ -762,7 +762,7 @@ static sys_var_thd_bit sys_unique_checks(&vars, "unique_checks", 0,
|
|||
OPTION_RELAXED_UNIQUE_CHECKS,
|
||||
1,
|
||||
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,
|
||||
set_option_bit,
|
||||
ulonglong(OPTION_PROFILING));
|
||||
|
@ -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_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_variable sys_have_profiling(&vars, "have_profiling", &have_profiling);
|
||||
static sys_var_have_variable sys_have_query_cache(&vars, "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_symlink(&vars, "have_symlink", &have_symlink);
|
||||
/* Global read-only variable describing server license */
|
||||
|
|
|
@ -1207,7 +1207,7 @@ sp_head::execute(THD *thd)
|
|||
*/
|
||||
thd->spcont->callers_arena= &backup_arena;
|
||||
|
||||
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
|
||||
#if defined(ENABLED_PROFILING)
|
||||
/* Discard the initial part of executing routines. */
|
||||
thd->profiling.discard_current_query();
|
||||
#endif
|
||||
|
@ -1216,7 +1216,7 @@ sp_head::execute(THD *thd)
|
|||
sp_instr *i;
|
||||
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.
|
||||
Profiling only records information for segments of code that set the
|
||||
|
@ -1229,7 +1229,7 @@ sp_head::execute(THD *thd)
|
|||
i = get_instr(ip); // Returns NULL when we're done.
|
||||
if (i == NULL)
|
||||
{
|
||||
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
|
||||
#if defined(ENABLED_PROFILING)
|
||||
thd->profiling.discard_current_query();
|
||||
#endif
|
||||
break;
|
||||
|
@ -1312,7 +1312,7 @@ sp_head::execute(THD *thd)
|
|||
}
|
||||
} 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.start_new_query("tail end of routine");
|
||||
#endif
|
||||
|
@ -2844,7 +2844,7 @@ sp_instr_stmt::execute(THD *thd, uint *nextp)
|
|||
|
||||
query= thd->query;
|
||||
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. */
|
||||
thd->profiling.set_query_source(m_query.str, m_query.length);
|
||||
#endif
|
||||
|
|
|
@ -257,7 +257,7 @@ const char *set_thd_proc_info(THD *thd, const char *info,
|
|||
const char *old_info= thd->proc_info;
|
||||
DBUG_PRINT("proc_info", ("%s:%d %s", calling_file, calling_line,
|
||||
(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);
|
||||
#endif
|
||||
thd->proc_info= info;
|
||||
|
@ -522,7 +522,7 @@ THD::THD()
|
|||
*scramble= '\0';
|
||||
|
||||
init();
|
||||
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
|
||||
#if defined(ENABLED_PROFILING)
|
||||
profiling.set_thd(this);
|
||||
#endif
|
||||
user_connect=(USER_CONN *)0;
|
||||
|
|
|
@ -1644,7 +1644,7 @@ public:
|
|||
CHARSET_INFO *db_charset;
|
||||
Warning_info *warning_info;
|
||||
Diagnostics_area *stmt_da;
|
||||
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
|
||||
#if defined(ENABLED_PROFILING)
|
||||
PROFILING profiling;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -375,7 +375,7 @@ void execute_init_command(THD *thd, sys_var_str *init_command_var,
|
|||
Vio* save_vio;
|
||||
ulong save_client_capabilities;
|
||||
|
||||
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
|
||||
#if defined(ENABLED_PROFILING)
|
||||
thd->profiling.start_new_query();
|
||||
thd->profiling.set_query_source(init_command_var->value,
|
||||
init_command_var->value_length);
|
||||
|
@ -403,7 +403,7 @@ void execute_init_command(THD *thd, sys_var_str *init_command_var,
|
|||
thd->client_capabilities= save_client_capabilities;
|
||||
thd->net.vio= save_vio;
|
||||
|
||||
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
|
||||
#if defined(ENABLED_PROFILING)
|
||||
thd->profiling.finish_current_query();
|
||||
#endif
|
||||
}
|
||||
|
@ -479,7 +479,7 @@ static void handle_bootstrap_impl(THD *thd)
|
|||
QUERY_CACHE_FLAGS_SIZE);
|
||||
thd->set_query(query, length);
|
||||
DBUG_PRINT("query",("%-.4096s",thd->query));
|
||||
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
|
||||
#if defined(ENABLED_PROFILING)
|
||||
thd->profiling.start_new_query();
|
||||
thd->profiling.set_query_source(thd->query, length);
|
||||
#endif
|
||||
|
@ -496,7 +496,7 @@ static void handle_bootstrap_impl(THD *thd)
|
|||
bootstrap_error= thd->is_error();
|
||||
net_end_statement(thd);
|
||||
|
||||
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
|
||||
#if defined(ENABLED_PROFILING)
|
||||
thd->profiling.finish_current_query();
|
||||
#endif
|
||||
|
||||
|
@ -806,7 +806,7 @@ bool do_command(THD *thd)
|
|||
net_new_transaction(net);
|
||||
|
||||
packet_length= my_net_read(net);
|
||||
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
|
||||
#if defined(ENABLED_PROFILING)
|
||||
thd->profiling.start_new_query();
|
||||
#endif
|
||||
if (packet_length == packet_error)
|
||||
|
@ -866,7 +866,7 @@ bool do_command(THD *thd)
|
|||
return_value= dispatch_command(command, thd, packet+1, (uint) (packet_length-1));
|
||||
|
||||
out:
|
||||
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
|
||||
#if defined(ENABLED_PROFILING)
|
||||
thd->profiling.finish_current_query();
|
||||
#endif
|
||||
DBUG_RETURN(return_value);
|
||||
|
@ -1223,7 +1223,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
|
|||
|
||||
general_log_write(thd, command, thd->query, thd->query_length);
|
||||
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);
|
||||
#endif
|
||||
|
||||
|
@ -1258,7 +1258,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
|
|||
MYSQL_QUERY_DONE(thd->is_error());
|
||||
}
|
||||
|
||||
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
|
||||
#if defined(ENABLED_PROFILING)
|
||||
thd->profiling.finish_current_query();
|
||||
thd->profiling.start_new_query("continuing");
|
||||
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,
|
|||
Mark this current profiling record to be discarded. We don't
|
||||
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();
|
||||
#endif
|
||||
break;
|
||||
|
@ -2333,7 +2333,7 @@ mysql_execute_command(THD *thd)
|
|||
}
|
||||
case SQLCOM_SHOW_PROFILES:
|
||||
{
|
||||
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
|
||||
#if defined(ENABLED_PROFILING)
|
||||
thd->profiling.discard_current_query();
|
||||
res= thd->profiling.show_profiles();
|
||||
if (res)
|
||||
|
|
|
@ -2459,7 +2459,7 @@ void mysqld_stmt_execute(THD *thd, char *packet_arg, uint packet_length)
|
|||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
|
||||
#if defined(ENABLED_PROFILING)
|
||||
thd->profiling.set_query_source(stmt->query, stmt->query_length);
|
||||
#endif
|
||||
DBUG_PRINT("exec_query", ("%s", stmt->query));
|
||||
|
|
|
@ -47,7 +47,7 @@ const char * const _unknown_func_ = "<unknown>";
|
|||
int fill_query_profile_statistics_info(THD *thd, TABLE_LIST *tables,
|
||||
Item *cond)
|
||||
{
|
||||
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
|
||||
#if defined(ENABLED_PROFILING)
|
||||
return(thd->profiling.fill_statistics_info(thd, tables, cond));
|
||||
#else
|
||||
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)
|
|||
}
|
||||
|
||||
|
||||
#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_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);
|
|||
#define PROFILE_ALL (uint)(~0)
|
||||
|
||||
|
||||
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
|
||||
#if defined(ENABLED_PROFILING)
|
||||
#include "mysql_priv.h"
|
||||
|
||||
#ifdef HAVE_SYS_RESOURCE_H
|
||||
|
|
Loading…
Reference in a new issue