diff options
author | unknown <cmiller@zippy.cornsilk.net> | 2007-05-02 14:13:33 -0400 |
---|---|---|
committer | unknown <cmiller@zippy.cornsilk.net> | 2007-05-02 14:13:33 -0400 |
commit | 0901dbc5835b1a5aac3c871cd1ac4eac22505fec (patch) | |
tree | a3f368b5c0fe064f88744b2233b685ef3bb63d8a | |
parent | 4687fe01d7e3ff566e045b1f538562412f4f4c00 (diff) | |
download | mariadb-git-0901dbc5835b1a5aac3c871cd1ac4eac22505fec.tar.gz |
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''
-rw-r--r-- | configure.in | 5 | ||||
-rw-r--r-- | mysql-test/include/have_community_features.inc | 4 | ||||
-rw-r--r-- | mysql-test/include/profiling.inc | 4 | ||||
-rw-r--r-- | mysql-test/r/have_community_features.require | 2 | ||||
-rw-r--r-- | mysql-test/r/not_embedded_server.result | 2 | ||||
-rw-r--r-- | mysql-test/r/profiling.require | 2 | ||||
-rw-r--r-- | mysql-test/r/variables+c.result | 7 | ||||
-rw-r--r-- | mysql-test/t/information_schema.test | 8 | ||||
-rw-r--r-- | mysql-test/t/profiling.test | 2 | ||||
-rw-r--r-- | mysql-test/t/variables+c.test | 11 | ||||
-rw-r--r-- | sql/lex.h | 1 | ||||
-rw-r--r-- | sql/mysql_priv.h | 3 | ||||
-rw-r--r-- | sql/mysqld.cc | 10 | ||||
-rw-r--r-- | sql/set_var.cc | 2 | ||||
-rw-r--r-- | sql/sql_class.cc | 9 | ||||
-rw-r--r-- | sql/sql_profile.cc | 2 | ||||
-rw-r--r-- | sql/sql_profile.h | 19 |
17 files changed, 55 insertions, 38 deletions
diff --git a/configure.in b/configure.in index fb6e85f6aae..fe8367eabb4 100644 --- a/configure.in +++ b/configure.in @@ -2496,16 +2496,17 @@ thread_dirs= dnl This probably should be cleaned up more - for now the threaded dnl client is just using plain-old libs. -sql_client_dirs="strings regex mysys libmysql client" +sql_client_dirs="strings regex mysys libmysql" AM_CONDITIONAL(THREAD_SAFE_CLIENT, test "$THREAD_SAFE_CLIENT" != "no") if test "$THREAD_SAFE_CLIENT" != "no" then - sql_client_dirs="libmysql_r $sql_client_dirs" + sql_client_dirs="$sql_client_dirs libmysql_r" AC_CONFIG_FILES(libmysql_r/Makefile) AC_DEFINE([THREAD_SAFE_CLIENT], [1], [Should the client be thread safe]) fi +sql_client_dirs="$sql_client_dirs client" CLIENT_LIBS="$NON_THREADED_LIBS $openssl_libs $ZLIB_LIBS $STATIC_NSS_FLAGS" diff --git a/mysql-test/include/have_community_features.inc b/mysql-test/include/have_community_features.inc new file mode 100644 index 00000000000..01ed6142500 --- /dev/null +++ b/mysql-test/include/have_community_features.inc @@ -0,0 +1,4 @@ +--require r/have_community_features.require +--disable_query_log +show variables like "have_community_features"; +--enable_query_log diff --git a/mysql-test/include/profiling.inc b/mysql-test/include/profiling.inc deleted file mode 100644 index bc2228eaa10..00000000000 --- a/mysql-test/include/profiling.inc +++ /dev/null @@ -1,4 +0,0 @@ --- require r/profiling.require -disable_query_log; -show variables like "profiling"; -enable_query_log; diff --git a/mysql-test/r/have_community_features.require b/mysql-test/r/have_community_features.require new file mode 100644 index 00000000000..9233bba91e1 --- /dev/null +++ b/mysql-test/r/have_community_features.require @@ -0,0 +1,2 @@ +Variable_name Value +have_community_features YES diff --git a/mysql-test/r/not_embedded_server.result b/mysql-test/r/not_embedded_server.result index 63351d187b6..f2ffe28895d 100644 --- a/mysql-test/r/not_embedded_server.result +++ b/mysql-test/r/not_embedded_server.result @@ -1,5 +1,5 @@ prepare stmt1 from ' SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST WHERE COMMAND!=\'Daemon\' '; execute stmt1; ID USER HOST DB COMMAND TIME STATE INFO -number root localhost test Query time preparing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST WHERE COMMAND!='Daemon' +number root localhost test Query time executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST WHERE COMMAND!='Daemon' deallocate prepare stmt1; diff --git a/mysql-test/r/profiling.require b/mysql-test/r/profiling.require deleted file mode 100644 index a5f2b71f22a..00000000000 --- a/mysql-test/r/profiling.require +++ /dev/null @@ -1,2 +0,0 @@ -Variable_name Value -profiling OFF diff --git a/mysql-test/r/variables+c.result b/mysql-test/r/variables+c.result new file mode 100644 index 00000000000..7a2976d1267 --- /dev/null +++ b/mysql-test/r/variables+c.result @@ -0,0 +1,7 @@ +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 # diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test index f9a2be499cb..a49044e63c1 100644 --- a/mysql-test/t/information_schema.test +++ b/mysql-test/t/information_schema.test @@ -1023,14 +1023,6 @@ where t.table_schema = 'information_schema' and (c2.column_type = 'varchar(7)' or c2.column_type = 'varchar(20)') group by c2.column_type order by num limit 1) group by t.table_name order by num1, t.table_name; -# 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 - --echo End of 5.0 tests. # diff --git a/mysql-test/t/profiling.test b/mysql-test/t/profiling.test index 549d075d227..173d7ec0c96 100644 --- a/mysql-test/t/profiling.test +++ b/mysql-test/t/profiling.test @@ -1,4 +1,4 @@ ---source include/profiling.inc +--source include/have_community_features.inc # default is OFF show session variables like 'profil%'; diff --git a/mysql-test/t/variables+c.test b/mysql-test/t/variables+c.test new file mode 100644 index 00000000000..0092d34133d --- /dev/null +++ b/mysql-test/t/variables+c.test @@ -0,0 +1,11 @@ +--source include/have_community_features.inc + +# +# 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 + 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 |