summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <cmiller@zippy.cornsilk.net>2007-10-31 16:39:59 -0400
committerunknown <cmiller@zippy.cornsilk.net>2007-10-31 16:39:59 -0400
commitfc70ac4627c4d7094dc1c1b4d6d61ab81fcd5546 (patch)
tree2d672702cc1c3fe78fd5fb908a40ab5b38eff83e
parent41a9bb8c636a2f99248f77f6af6c88d97b72d3b2 (diff)
downloadmariadb-git-fc70ac4627c4d7094dc1c1b4d6d61ab81fcd5546.tar.gz
Sundry changes to fix merge problems. Most of these are duplicated
in 5.0-community, but pulling to merge was very hard. sql/mysql_priv.h: Add new extern "C" qualification to set_thd_proc_info(). Fix typo in merge. sql/mysqld.cc: Replace obselete gptr with uchar* . Add missing #endif from merge problem. sql/set_var.cc: Include new parameter to user variable contruction. sql/sql_cache.cc: Remove duplicate line from merge problem. sql/sql_profile.cc: struct st_table_list is now typedef'd to a new name. ST_FIELD_INFO now includes a new member, a pointer to an open_table function. sql/sql_profile.h: struct st_table_list is now typedef'd to a new name.
-rw-r--r--sql/mysql_priv.h3
-rw-r--r--sql/mysqld.cc5
-rw-r--r--sql/set_var.cc9
-rw-r--r--sql/sql_cache.cc1
-rw-r--r--sql/sql_profile.cc44
-rw-r--r--sql/sql_profile.h4
6 files changed, 31 insertions, 35 deletions
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index 24770a45bdb..d83df03de82 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -648,6 +648,7 @@ inline THD *_current_thd(void)
The meat of thd_proc_info(THD*, char*), a macro that packs the last
three calling-info parameters.
*/
+extern "C"
const char *set_thd_proc_info(THD *thd, const char *info,
const char *calling_func,
const char *calling_file,
@@ -1912,7 +1913,7 @@ extern handlerton *myisam_hton;
extern handlerton *heap_hton;
extern SHOW_COMP_OPTION have_ssl, have_symlink, have_dlopen;
-uextern SHOW_COMP_OPTION have_query_cache;
+extern SHOW_COMP_OPTION have_query_cache;
extern SHOW_COMP_OPTION have_geometry, have_rtree_keys;
extern SHOW_COMP_OPTION have_crypt;
extern SHOW_COMP_OPTION have_compress;
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 3e982867f08..a490c63fa79 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -5654,8 +5654,8 @@ master-ssl",
(uchar**) &mysqld_port_timeout, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
{"profiling_history_size", OPT_PROFILING, "Limit of query profiling memory",
- (gptr*) &global_system_variables.profiling_history_size,
- (gptr*) &max_system_variables.profiling_history_size,
+ (uchar**) &global_system_variables.profiling_history_size,
+ (uchar**) &max_system_variables.profiling_history_size,
0, GET_ULONG, REQUIRED_ARG, 15, 0, 100, 0, 0, 0},
#endif
{"relay-log", OPT_RELAY_LOG,
@@ -7204,7 +7204,6 @@ static void mysql_init_variables(void)
"d:t:i:o,/tmp/mysqld.trace");
#endif
opt_error_log= IF_WIN(1,0);
-#endif
#ifdef COMMUNITY_SERVER
have_community_features = SHOW_OPTION_YES;
#else
diff --git a/sql/set_var.cc b/sql/set_var.cc
index 6389f869c2d..5564a58ce5d 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -583,9 +583,10 @@ static sys_var_thd_bit sys_unique_checks(&vars, "unique_checks", 0,
OPTION_RELAXED_UNIQUE_CHECKS,
1);
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
-static sys_var_thd_bit sys_profiling("profiling", NULL, set_option_bit,
+static sys_var_thd_bit sys_profiling(&vars, "profiling", NULL,
+ set_option_bit,
ulonglong(OPTION_PROFILING));
-static sys_var_thd_ulong sys_profiling_history_size("profiling_history_size",
+static sys_var_thd_ulong sys_profiling_history_size(&vars, "profiling_history_size",
&SV::profiling_history_size);
#endif
@@ -699,10 +700,6 @@ static SHOW_VAR fixed_vars[]= {
{"pid_file", (char*) pidfile_name, SHOW_CHAR},
{"plugin_dir", (char*) opt_plugin_dir, SHOW_CHAR},
{"port", (char*) &mysqld_port, SHOW_INT},
-#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
- {sys_profiling.name, (char*) &sys_profiling, SHOW_SYS},
- {sys_profiling_history_size.name, (char*) &sys_profiling_history_size, SHOW_SYS},
-#endif
{"protocol_version", (char*) &protocol_version, SHOW_INT},
#ifdef HAVE_SMEM
{"shared_memory", (char*) &opt_enable_shared_memory, SHOW_MY_BOOL},
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index 9bb35e4371c..0fd5527495a 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -1455,7 +1455,6 @@ void Query_cache::invalidate(THD *thd, TABLE_LIST *tables_used,
void Query_cache::invalidate(CHANGED_TABLE_LIST *tables_used)
{
- THD *thd= current_thd;
DBUG_ENTER("Query_cache::invalidate (changed table list)");
THD *thd= current_thd;
for (; tables_used; tables_used= tables_used->next)
diff --git a/sql/sql_profile.cc b/sql/sql_profile.cc
index fa1728895b8..90b4c4768af 100644
--- a/sql/sql_profile.cc
+++ b/sql/sql_profile.cc
@@ -28,7 +28,7 @@ const char * const _unknown_func_ = "<unknown>";
/**
Connects Information_Schema and Profiling.
*/
-int fill_query_profile_statistics_info(THD *thd, struct st_table_list *tables,
+int fill_query_profile_statistics_info(THD *thd, TABLE_LIST *tables,
Item *cond)
{
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
@@ -40,26 +40,26 @@ int fill_query_profile_statistics_info(THD *thd, struct st_table_list *tables,
ST_FIELD_INFO query_profile_statistics_info[]=
{
- /* name, length, type, value, maybe_null, old_name */
- {"QUERY_ID", 20, MYSQL_TYPE_LONG, 0, false, NULL},
- {"SEQ", 20, MYSQL_TYPE_LONG, 0, false, NULL},
- {"STATE", 30, MYSQL_TYPE_STRING, 0, false, NULL},
- {"DURATION", TIME_FLOAT_DIGITS, MYSQL_TYPE_DOUBLE, 0, false, NULL},
- {"CPU_USER", TIME_FLOAT_DIGITS, MYSQL_TYPE_DOUBLE, 0, true, NULL},
- {"CPU_SYSTEM", TIME_FLOAT_DIGITS, MYSQL_TYPE_DOUBLE, 0, true, NULL},
- {"CONTEXT_VOLUNTARY", 20, MYSQL_TYPE_LONG, 0, true, NULL},
- {"CONTEXT_INVOLUNTARY", 20, MYSQL_TYPE_LONG, 0, true, NULL},
- {"BLOCK_OPS_IN", 20, MYSQL_TYPE_LONG, 0, true, NULL},
- {"BLOCK_OPS_OUT", 20, MYSQL_TYPE_LONG, 0, true, NULL},
- {"MESSAGES_SENT", 20, MYSQL_TYPE_LONG, 0, true, NULL},
- {"MESSAGES_RECEIVED", 20, MYSQL_TYPE_LONG, 0, true, NULL},
- {"PAGE_FAULTS_MAJOR", 20, MYSQL_TYPE_LONG, 0, true, NULL},
- {"PAGE_FAULTS_MINOR", 20, MYSQL_TYPE_LONG, 0, true, NULL},
- {"SWAPS", 20, MYSQL_TYPE_LONG, 0, true, NULL},
- {"SOURCE_FUNCTION", 30, MYSQL_TYPE_STRING, 0, true, NULL},
- {"SOURCE_FILE", 20, MYSQL_TYPE_STRING, 0, true, NULL},
- {"SOURCE_LINE", 20, MYSQL_TYPE_LONG, 0, true, NULL},
- {NULL, 0, MYSQL_TYPE_STRING, 0, true, NULL}
+ /* name, length, type, value, maybe_null, old_name, open_method */
+ {"QUERY_ID", 20, MYSQL_TYPE_LONG, 0, false, NULL, SKIP_OPEN_TABLE},
+ {"SEQ", 20, MYSQL_TYPE_LONG, 0, false, NULL, SKIP_OPEN_TABLE},
+ {"STATE", 30, MYSQL_TYPE_STRING, 0, false, NULL, SKIP_OPEN_TABLE},
+ {"DURATION", TIME_FLOAT_DIGITS, MYSQL_TYPE_DOUBLE, 0, false, NULL, SKIP_OPEN_TABLE},
+ {"CPU_USER", TIME_FLOAT_DIGITS, MYSQL_TYPE_DOUBLE, 0, true, NULL, SKIP_OPEN_TABLE},
+ {"CPU_SYSTEM", TIME_FLOAT_DIGITS, MYSQL_TYPE_DOUBLE, 0, true, NULL, SKIP_OPEN_TABLE},
+ {"CONTEXT_VOLUNTARY", 20, MYSQL_TYPE_LONG, 0, true, NULL, SKIP_OPEN_TABLE},
+ {"CONTEXT_INVOLUNTARY", 20, MYSQL_TYPE_LONG, 0, true, NULL, SKIP_OPEN_TABLE},
+ {"BLOCK_OPS_IN", 20, MYSQL_TYPE_LONG, 0, true, NULL, SKIP_OPEN_TABLE},
+ {"BLOCK_OPS_OUT", 20, MYSQL_TYPE_LONG, 0, true, NULL, SKIP_OPEN_TABLE},
+ {"MESSAGES_SENT", 20, MYSQL_TYPE_LONG, 0, true, NULL, SKIP_OPEN_TABLE},
+ {"MESSAGES_RECEIVED", 20, MYSQL_TYPE_LONG, 0, true, NULL, SKIP_OPEN_TABLE},
+ {"PAGE_FAULTS_MAJOR", 20, MYSQL_TYPE_LONG, 0, true, NULL, SKIP_OPEN_TABLE},
+ {"PAGE_FAULTS_MINOR", 20, MYSQL_TYPE_LONG, 0, true, NULL, SKIP_OPEN_TABLE},
+ {"SWAPS", 20, MYSQL_TYPE_LONG, 0, true, NULL, SKIP_OPEN_TABLE},
+ {"SOURCE_FUNCTION", 30, MYSQL_TYPE_STRING, 0, true, NULL, SKIP_OPEN_TABLE},
+ {"SOURCE_FILE", 20, MYSQL_TYPE_STRING, 0, true, NULL, SKIP_OPEN_TABLE},
+ {"SOURCE_LINE", 20, MYSQL_TYPE_LONG, 0, true, NULL, SKIP_OPEN_TABLE},
+ {NULL, 0, MYSQL_TYPE_STRING, 0, true, NULL, NULL}
};
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
@@ -663,7 +663,7 @@ bool PROFILING::show_last(uint options)
/**
Fill the information schema table, "query_profile", as defined in show.cc .
*/
-int PROFILING::fill_statistics_info(THD *thd, struct st_table_list *tables, Item *cond)
+int PROFILING::fill_statistics_info(THD *thd, TABLE_LIST *tables, Item *cond)
{
DBUG_ENTER("PROFILING::fill_statistics_info");
TABLE *table= tables->table;
diff --git a/sql/sql_profile.h b/sql/sql_profile.h
index a398c3d7a94..7d2fbb7827d 100644
--- a/sql/sql_profile.h
+++ b/sql/sql_profile.h
@@ -38,7 +38,7 @@ extern const char * const _unknown_func_;
#endif
extern ST_FIELD_INFO query_profile_statistics_info[];
-int fill_query_profile_statistics_info(THD *thd, struct st_table_list *tables, Item *cond);
+int fill_query_profile_statistics_info(THD *thd, TABLE_LIST *tables, Item *cond);
#define PROFILE_NONE 0
@@ -322,7 +322,7 @@ public:
bool show_last(uint options);
/* ... from INFORMATION_SCHEMA.PROFILING ... */
- int fill_statistics_info(THD *thd, struct st_table_list *tables, Item *cond);
+ int fill_statistics_info(THD *thd, TABLE_LIST *tables, Item *cond);
};
# endif /* HAVE_PROFILING */