From 0901dbc5835b1a5aac3c871cd1ac4eac22505fec Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 2 May 2007 14:13:33 -0400 Subject: Fix up merge. Some macros are now functions. Some functions are renamed. Some new THD proc_info states are new. Directories must be encountered in make in a specific order, to have symlinks already set. Move community-server-specific tests into own tests, so that we can exempt them from testing on enterprise servers. BitKeeper/deleted/.del-profiling.inc: Delete: mysql-test/include/profiling.inc BitKeeper/deleted/.del-profiling.require: Delete: mysql-test/r/profiling.require configure.in: Set a new order of sql_client_dirs, so that the make directory traversal doesn't miss symlink dependencies. mysql-test/r/not_embedded_server.result: Account for new "executing" state. mysql-test/t/information_schema.test: Move community-feature test to another test file. mysql-test/t/profiling.test: Make test more generic to community features. sql/lex.h: Add symbol lost in manual merge. sql/mysql_priv.h: Insert a preprocessor layer between setting the caller and the function that sets the thread state, so we can get caller information. sql/mysqld.cc: Add new server variable "have_community_features". sql/set_var.cc: Add new server variable "have_community_features". sql/sql_class.cc: Insert a preprocessor layer between setting the caller and the function that sets the thread state, so we can get caller information. sql/sql_profile.cc: Function name change, my_strndup() sql/sql_profile.h: Insert a preprocessor layer between setting the caller and the function that sets the thread state, so we can get caller information. mysql-test/include/have_community_features.inc: New BitKeeper file ``mysql-test/include/have_community_features.inc'' mysql-test/r/have_community_features.require: New BitKeeper file ``mysql-test/r/have_community_features.require'' mysql-test/r/variables+c.result: New BitKeeper file ``mysql-test/r/variables+c.result'' mysql-test/t/variables+c.test: New BitKeeper file ``mysql-test/t/variables+c.test'' --- sql/lex.h | 1 + sql/mysql_priv.h | 3 +++ sql/mysqld.cc | 10 ++++++++++ sql/set_var.cc | 2 ++ sql/sql_class.cc | 9 ++++++++- sql/sql_profile.cc | 2 +- sql/sql_profile.h | 19 +------------------ 7 files changed, 26 insertions(+), 20 deletions(-) (limited to 'sql') diff --git a/sql/lex.h b/sql/lex.h index 81ae014b069..0b601de772a 100644 --- a/sql/lex.h +++ b/sql/lex.h @@ -387,6 +387,7 @@ static SYMBOL symbols[] = { { "PACK_KEYS", SYM(PACK_KEYS_SYM)}, { "PARSER", SYM(PARSER_SYM)}, { "PARTIAL", SYM(PARTIAL)}, + { "PAGE", SYM(PAGE_SYM)}, { "PARTITION", SYM(PARTITION_SYM)}, { "PARTITIONING", SYM(PARTITIONING_SYM)}, { "PARTITIONS", SYM(PARTITIONS_SYM)}, diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 1261b2bc20c..5ce91f87b0d 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -496,6 +496,8 @@ enum enum_parsing_place }; struct st_table; + +#define thd_proc_info(thd, msg) set_thd_proc_info(thd, msg, __func__, __FILE__, __LINE__) class THD; /* Struct to handle simple linked lists */ @@ -1756,6 +1758,7 @@ extern SHOW_COMP_OPTION have_innodb; extern SHOW_COMP_OPTION have_csv_db; extern SHOW_COMP_OPTION have_ndbcluster; extern SHOW_COMP_OPTION have_partition_db; +extern SHOW_COMP_OPTION have_community_features; extern handlerton *partition_hton; extern handlerton *myisam_hton; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 333a2aeaf5c..c2281ebabb6 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -576,6 +576,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; /* Thread specific variables */ @@ -6529,6 +6530,7 @@ static int show_starttime(THD *thd, SHOW_VAR *var, char *buff) return 0; } +#ifdef COMMUNITY_SERVER static int show_flushstatustime(THD *thd, SHOW_VAR *var, char *buff) { var->type= SHOW_LONG; @@ -6536,6 +6538,7 @@ static int show_flushstatustime(THD *thd, SHOW_VAR *var, char *buff) *((long *)buff)= (long) (thd->query_start() - flush_status_time); return 0; } +#endif #ifdef HAVE_REPLICATION static int show_rpl_status(THD *thd, SHOW_VAR *var, char *buff) @@ -7089,7 +7092,9 @@ 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 {"Uptime_since_flush_status",(char*) &show_flushstatustime, SHOW_FUNC}, +#endif {NullS, NullS, SHOW_LONG} }; @@ -7314,6 +7319,11 @@ static void mysql_init_variables(void) #else have_partition_db= SHOW_OPTION_NO; #endif +#ifdef COMMUNITY_SERVER + have_community_features = SHOW_OPTION_YES; +#else + have_community_features = SHOW_OPTION_NO; +#endif #ifdef WITH_NDBCLUSTER_STORAGE_ENGINE have_ndbcluster=SHOW_OPTION_DISABLED; global_system_variables.ndb_index_stat_enable=FALSE; diff --git a/sql/set_var.cc b/sql/set_var.cc index bfd4806ab99..cc0c7374139 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -692,6 +692,7 @@ sys_var_have_variable sys_have_query_cache("have_query_cache", &have_query_cache); sys_var_have_variable sys_have_rtree_keys("have_rtree_keys", &have_rtree_keys); sys_var_have_variable sys_have_symlink("have_symlink", &have_symlink); +sys_var_have_variable sys_have_community_features("have_community_features", &have_community_features); /* Global read-only variable describing server license */ sys_var_const_str sys_license("license", STRINGIFY_ARG(LICENSE)); /* Global variables which enable|disable logging */ @@ -803,6 +804,7 @@ SHOW_VAR init_vars[]= { {sys_var_general_log_path.name, (char*) &sys_var_general_log_path, SHOW_SYS}, {sys_group_concat_max_len.name, (char*) &sys_group_concat_max_len, SHOW_SYS}, {sys_hostname.name, (char*) &sys_hostname, SHOW_SYS}, + {sys_have_community_features.name, (char*) &have_community_features, SHOW_HAVE}, {sys_have_compress.name, (char*) &have_compress, SHOW_HAVE}, {sys_have_crypt.name, (char*) &have_crypt, SHOW_HAVE}, {sys_have_csv_db.name, (char*) &have_csv_db, SHOW_HAVE}, diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 51fdca7dd16..e25aba9ef78 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -181,9 +181,16 @@ my_bool thd_tablespace_op(const THD *thd) } -const char *thd_proc_info(THD *thd, const char *info) +const char *set_thd_proc_info(THD *thd, const char *info, + const char *calling_function, + const char *calling_file, + const unsigned int calling_line) { const char *old_info= thd->proc_info; + DBUG_PRINT("proc_info", ("%s:%d %s", calling_file, calling_line, info)); +#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER) + thd->profiling.status_change(info, calling_function, calling_file, calling_line); +#endif thd->proc_info= info; return old_info; } diff --git a/sql/sql_profile.cc b/sql/sql_profile.cc index 77dea4f9954..fa1728895b8 100644 --- a/sql/sql_profile.cc +++ b/sql/sql_profile.cc @@ -177,7 +177,7 @@ void QUERY_PROFILE::set_query_source(char *query_source_arg, DBUG_ASSERT(query_source == NULL); if (query_source_arg != NULL) - query_source= my_strdup_with_length(query_source_arg, length, MYF(0)); + query_source= my_strndup(query_source_arg, length, MYF(0)); } QUERY_PROFILE::~QUERY_PROFILE() diff --git a/sql/sql_profile.h b/sql/sql_profile.h index c070f2f72d7..a398c3d7a94 100644 --- a/sql/sql_profile.h +++ b/sql/sql_profile.h @@ -53,24 +53,7 @@ int fill_query_profile_statistics_info(THD *thd, struct st_table_list *tables, I #define PROFILE_ALL (~0) -#if !defined(ENABLED_PROFILING) || !defined(COMMUNITY_SERVER) - -# define thd_proc_info(thd, msg) do { (thd)->proc_info= (msg); } while (0) - -#else - -# define thd_proc_info(thd, msg) \ - do { \ - if (unlikely(((thd)->options & OPTION_PROFILING) != 0)) \ - { \ - (thd)->profiling.status_change((msg), __func__, __FILE__, __LINE__); \ - } \ - else \ - { \ - (thd)->proc_info= (msg); \ - } \ - } while (0) - +#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER) #include "mysql_priv.h" #ifdef HAVE_SYS_RESOURCE_H -- cgit v1.2.1