Below is the list of changes that have just been committed into a local
5.0 repository of msvensson. When msvensson does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2165 06/04/18 17:07:35 msvensson@neptunus.(none) +3 -0
Merge neptunus.(none):/home/msvensson/mysql/mysql-5.0
into neptunus.(none):/home/msvensson/mysql/bug18564/my50-bug18564
sql/set_var.cc
1.152 06/04/18 17:07:26 msvensson@neptunus.(none) +0 -0
Auto merged
sql/mysqld.cc
1.544 06/04/18 17:07:26 msvensson@neptunus.(none) +0 -0
Auto merged
sql/mysql_priv.h
1.383 06/04/18 17:07:25 msvensson@neptunus.(none) +0 -0
Auto merged
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: msvensson
# Host: neptunus.(none)
# Root: /home/msvensson/mysql/bug18564/my50-bug18564/RESYNC
--- 1.382/sql/mysql_priv.h 2006-04-13 22:05:38 +02:00
+++ 1.383/sql/mysql_priv.h 2006-04-18 17:07:25 +02:00
@@ -1299,7 +1299,7 @@
#endif
extern SHOW_COMP_OPTION have_isam;
-extern SHOW_COMP_OPTION have_raid, have_openssl, have_symlink;
+extern SHOW_COMP_OPTION have_raid, have_openssl, have_symlink, have_dlopen;
extern SHOW_COMP_OPTION have_query_cache;
extern SHOW_COMP_OPTION have_geometry, have_rtree_keys;
extern SHOW_COMP_OPTION have_crypt;
--- 1.543/sql/mysqld.cc 2006-04-15 13:06:11 +02:00
+++ 1.544/sql/mysqld.cc 2006-04-18 17:07:26 +02:00
@@ -490,7 +490,7 @@
SHOW_COMP_OPTION have_isam;
SHOW_COMP_OPTION have_raid, have_openssl, have_symlink, have_query_cache;
-SHOW_COMP_OPTION have_geometry, have_rtree_keys;
+SHOW_COMP_OPTION have_geometry, have_rtree_keys, have_dlopen;
SHOW_COMP_OPTION have_crypt, have_compress;
/* Thread specific variables */
@@ -6439,6 +6439,11 @@
have_symlink=SHOW_OPTION_NO;
#else
have_symlink=SHOW_OPTION_YES;
+#endif
+#ifdef HAVE_DLOPEN
+ have_dlopen=SHOW_OPTION_YES;
+#else
+ have_dlopen=SHOW_OPTION_NO;
#endif
#ifdef HAVE_QUERY_CACHE
have_query_cache=SHOW_OPTION_YES;
--- 1.151/sql/set_var.cc 2006-04-12 15:13:10 +02:00
+++ 1.152/sql/set_var.cc 2006-04-18 17:07:26 +02:00
@@ -120,6 +120,7 @@
void fix_sql_mode_var(THD *thd, enum_var_type type);
static byte *get_error_count(THD *thd);
static byte *get_warning_count(THD *thd);
+static byte *get_prepared_stmt_count(THD *thd);
static byte *get_have_innodb(THD *thd);
/*
@@ -204,7 +205,7 @@
sys_var_trust_routine_creators
sys_trust_routine_creators("log_bin_trust_routine_creators",
&trust_function_creators);
-sys_var_bool_ptr
+sys_var_bool_ptr
sys_trust_function_creators("log_bin_trust_function_creators",
&trust_function_creators);
sys_var_thd_ulong sys_log_warnings("log_warnings", &SV::log_warnings);
@@ -257,6 +258,10 @@
&SV::max_join_size,
fix_max_join_size);
#endif
+static sys_var_long_ptr_global
+sys_max_prepared_stmt_count("max_prepared_stmt_count",
+ &max_prepared_stmt_count,
+ &LOCK_prepared_stmt_count);
sys_var_long_ptr sys_max_relay_log_size("max_relay_log_size",
&max_relay_log_size,
fix_max_relay_log_size);
@@ -371,17 +376,6 @@
&SV::table_type);
sys_var_thd_storage_engine sys_storage_engine("storage_engine",
&SV::table_type);
-#ifdef HAVE_REPLICATION
-sys_var_sync_binlog_period sys_sync_binlog_period("sync_binlog", &sync_binlog_period);
-sys_var_thd_ulong sys_sync_replication("sync_replication",
- &SV::sync_replication);
-sys_var_thd_ulong sys_sync_replication_slave_id(
- "sync_replication_slave_id",
- &SV::sync_replication_slave_id);
-sys_var_thd_ulong sys_sync_replication_timeout(
- "sync_replication_timeout",
- &SV::sync_replication_timeout);
-#endif
sys_var_bool_ptr sys_sync_frm("sync_frm", &opt_sync_frm);
sys_var_long_ptr sys_table_cache_size("table_cache",
&table_cache_size);
@@ -531,6 +525,9 @@
OPT_SESSION,
SHOW_LONG,
get_warning_count);
+static sys_var_readonly sys_prepared_stmt_count("prepared_stmt_count",
+ OPT_GLOBAL, SHOW_LONG,
+ get_prepared_stmt_count);
/* alias for last_insert_id() to be compatible with Sybase */
#ifdef HAVE_REPLICATION
@@ -635,6 +632,7 @@
&sys_max_heap_table_size,
&sys_max_join_size,
&sys_max_length_for_sort_data,
+ &sys_max_prepared_stmt_count,
&sys_max_relay_log_size,
&sys_max_seeks_for_key,
&sys_max_sort_length,
@@ -658,6 +656,7 @@
&sys_optimizer_prune_level,
&sys_optimizer_search_depth,
&sys_preload_buff_size,
+ &sys_prepared_stmt_count,
&sys_pseudo_thread_id,
&sys_query_alloc_block_size,
&sys_query_cache_size,
@@ -698,12 +697,6 @@
&sys_sql_warnings,
&sys_sql_notes,
&sys_storage_engine,
-#ifdef HAVE_REPLICATION
- &sys_sync_binlog_period,
- &sys_sync_replication,
- &sys_sync_replication_slave_id,
- &sys_sync_replication_timeout,
-#endif
&sys_sync_frm,
&sys_table_cache_size,
&sys_table_lock_wait_timeout,
@@ -732,7 +725,7 @@
&sys_innodb_thread_concurrency,
&sys_innodb_commit_concurrency,
&sys_innodb_flush_log_at_trx_commit,
-#endif
+#endif
&sys_trust_routine_creators,
&sys_trust_function_creators,
&sys_engine_condition_pushdown,
@@ -793,7 +786,7 @@
{sys_delayed_insert_timeout.name, (char*) &sys_delayed_insert_timeout, SHOW_SYS},
{sys_delayed_queue_size.name,(char*) &sys_delayed_queue_size, SHOW_SYS},
{sys_div_precincrement.name,(char*) &sys_div_precincrement,SHOW_SYS},
- {sys_engine_condition_pushdown.name,
+ {sys_engine_condition_pushdown.name,
(char*) &sys_engine_condition_pushdown, SHOW_SYS},
{sys_expire_logs_days.name, (char*) &sys_expire_logs_days, SHOW_SYS},
{sys_flush.name, (char*) &sys_flush, SHOW_SYS},
@@ -904,6 +897,8 @@
{sys_max_join_size.name, (char*) &sys_max_join_size, SHOW_SYS},
{sys_max_length_for_sort_data.name, (char*) &sys_max_length_for_sort_data,
SHOW_SYS},
+ {sys_max_prepared_stmt_count.name, (char*) &sys_max_prepared_stmt_count,
+ SHOW_SYS},
{sys_max_relay_log_size.name, (char*) &sys_max_relay_log_size, SHOW_SYS},
{sys_max_seeks_for_key.name, (char*) &sys_max_seeks_for_key, SHOW_SYS},
{sys_max_sort_length.name, (char*) &sys_max_sort_length, SHOW_SYS},
@@ -920,9 +915,9 @@
{sys_myisam_repair_threads.name, (char*) &sys_myisam_repair_threads,
SHOW_SYS},
{sys_myisam_sort_buffer_size.name, (char*) &sys_myisam_sort_buffer_size, SHOW_SYS},
-
+
{sys_myisam_stats_method.name, (char*) &sys_myisam_stats_method, SHOW_SYS},
-
+
#ifdef __NT__
{"named_pipe", (char*) &opt_enable_named_pipe, SHOW_MY_BOOL},
#endif
@@ -946,6 +941,7 @@
{sys_optimizer_search_depth.name,(char*) &sys_optimizer_search_depth,
SHOW_SYS},
{"pid_file", (char*) pidfile_name, SHOW_CHAR},
+ {sys_prepared_stmt_count.name, (char*) &sys_prepared_stmt_count, SHOW_SYS},
{"port", (char*) &mysqld_port, SHOW_INT},
{sys_preload_buff_size.name, (char*) &sys_preload_buff_size, SHOW_SYS},
{"protocol_version", (char*) &protocol_version, SHOW_INT},
@@ -997,15 +993,7 @@
{"sql_notes", (char*) &sys_sql_notes, SHOW_BOOL},
{"sql_warnings", (char*) &sys_sql_warnings, SHOW_BOOL},
{sys_storage_engine.name, (char*) &sys_storage_engine, SHOW_SYS},
-#ifdef HAVE_REPLICATION
- {sys_sync_binlog_period.name,(char*) &sys_sync_binlog_period, SHOW_SYS},
-#endif
{sys_sync_frm.name, (char*) &sys_sync_frm, SHOW_SYS},
-#ifdef HAVE_REPLICATION
- {sys_sync_replication.name, (char*) &sys_sync_replication, SHOW_SYS},
- {sys_sync_replication_slave_id.name, (char*) &sys_sync_replication_slave_id,SHOW_SYS},
- {sys_sync_replication_timeout.name, (char*) &sys_sync_replication_timeout,SHOW_SYS},
-#endif
#ifdef HAVE_TZNAME
{"system_time_zone", system_time_zone, SHOW_CHAR},
#endif
@@ -1192,7 +1180,7 @@
thd->variables.tx_isolation);
}
-static void fix_completion_type(THD *thd __attribute__(unused),
+static void fix_completion_type(THD *thd __attribute__(unused),
enum_var_type type __attribute__(unused)) {}
static int check_completion_type(THD *thd, set_var *var)
@@ -1260,7 +1248,7 @@
#ifdef HAVE_QUERY_CACHE
static void fix_query_cache_min_res_unit(THD *thd, enum_var_type type)
{
- query_cache_min_res_unit=
+ query_cache_min_res_unit=
query_cache.set_min_res_unit(query_cache_min_res_unit);
}
#endif
@@ -1324,7 +1312,7 @@
static void fix_max_connections(THD *thd, enum_var_type type)
{
#ifndef EMBEDDED_LIBRARY
- resize_thr_alarm(max_connections +
+ resize_thr_alarm(max_connections +
global_system_variables.max_insert_delayed_threads + 10);
#endif
}
@@ -1355,29 +1343,40 @@
server_id_supplied = 1;
}
-bool sys_var_long_ptr::check(THD *thd, set_var *var)
+
+sys_var_long_ptr::
+sys_var_long_ptr(const char *name_arg, ulong *value_ptr,
+ sys_after_update_func after_update_arg)
+ :sys_var_long_ptr_global(name_arg, value_ptr,
+ &LOCK_global_system_variables, after_update_arg)
+{}
+
+
+bool sys_var_long_ptr_global::check(THD *thd, set_var *var)
{
longlong v= var->value->val_int();
var->save_result.ulonglong_value= v < 0 ? 0 : v;
return 0;
}
-bool sys_var_long_ptr::update(THD *thd, set_var *var)
+bool sys_var_long_ptr_global::update(THD *thd, set_var *var)
{
ulonglong tmp= var->save_result.ulonglong_value;
- pthread_mutex_lock(&LOCK_global_system_variables);
+ pthread_mutex_lock(guard);
if (option_limits)
*value= (ulong) getopt_ull_limit_value(tmp, option_limits);
else
*value= (ulong) tmp;
- pthread_mutex_unlock(&LOCK_global_system_variables);
+ pthread_mutex_unlock(guard);
return 0;
}
-void sys_var_long_ptr::set_default(THD *thd, enum_var_type type)
+void sys_var_long_ptr_global::set_default(THD *thd, enum_var_type type)
{
+ pthread_mutex_lock(guard);
*value= (ulong) option_limits->def_value;
+ pthread_mutex_unlock(guard);
}
@@ -1491,7 +1490,7 @@
if (var->type == OPT_GLOBAL)
{
/* Lock is needed to make things safe on 32 bit systems */
- pthread_mutex_lock(&LOCK_global_system_variables);
+ pthread_mutex_lock(&LOCK_global_system_variables);
global_system_variables.*offset= (ha_rows) tmp;
pthread_mutex_unlock(&LOCK_global_system_variables);
}
@@ -1865,7 +1864,7 @@
my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, res->c_ptr());
return 1;
}
-
+
/*
We must copy result to thread space to not get a memory leak if
update is aborted
@@ -1922,7 +1921,7 @@
const char *new_name;
} my_old_conv;
-static my_old_conv old_conv[]=
+static my_old_conv old_conv[]=
{
{ "cp1251_koi8" , "cp1251" },
{ "cp1250_latin2" , "cp1250" },
@@ -1940,7 +1939,7 @@
CHARSET_INFO *get_old_charset_by_name(const char *name)
{
my_old_conv *conv;
-
+
for (conv= old_conv; conv->old_name; conv++)
{
if (!my_strcasecmp(&my_charset_latin1, name, conv->old_name))
@@ -2321,7 +2320,7 @@
pthread_mutex_lock(&LOCK_global_system_variables);
key_cache= get_key_cache(base_name);
-
+
if (!key_cache)
{
/* Key cache didn't exists */
@@ -2358,7 +2357,7 @@
Move tables using this key cache to the default key cache
and clear the old key cache.
*/
- NAMED_LIST *list;
+ NAMED_LIST *list;
key_cache= (KEY_CACHE *) find_named(&key_caches, base_name->str,
base_name->length, &list);
key_cache->in_init= 1;
@@ -2387,7 +2386,7 @@
error= (bool)(ha_resize_key_cache(key_cache));
pthread_mutex_lock(&LOCK_global_system_variables);
- key_cache->in_init= 0;
+ key_cache->in_init= 0;
end:
pthread_mutex_unlock(&LOCK_global_system_variables);
@@ -2436,7 +2435,7 @@
error= (bool) (ha_resize_key_cache(key_cache));
pthread_mutex_lock(&LOCK_global_system_variables);
- key_cache->in_init= 0;
+ key_cache->in_init= 0;
end:
pthread_mutex_unlock(&LOCK_global_system_variables);
@@ -2609,7 +2608,7 @@
byte *sys_var_thd_time_zone::value_ptr(THD *thd, enum_var_type type,
LEX_STRING *base)
{
- /*
+ /*
We can use ptr() instead of c_ptr() here because String contaning
time zone name is guaranteed to be zero ended.
*/
@@ -2763,7 +2762,7 @@
See sql/mysqld.cc/, comments in function init_server_components() for an
explaination of the different warnings we send below
*/
-
+
if (opt_sql_bin_update)
{
((sys_var_thd_bit*) var->var)->bit_flag|= (OPTION_BIN_LOG |
@@ -2815,7 +2814,7 @@
static byte *get_error_count(THD *thd)
{
- thd->sys_var_tmp.long_value=
+ thd->sys_var_tmp.long_value=
thd->warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_ERROR];
return (byte*) &thd->sys_var_tmp.long_value;
}
@@ -2827,6 +2826,14 @@
}
+static byte *get_prepared_stmt_count(THD *thd)
+{
+ pthread_mutex_lock(&LOCK_prepared_stmt_count);
+ thd->sys_var_tmp.ulong_value= prepared_stmt_count;
+ pthread_mutex_unlock(&LOCK_prepared_stmt_count);
+ return (byte*) &thd->sys_var_tmp.ulong_value;
+}
+
/****************************************************************************
Main handling of variables:
- Initialisation
@@ -2847,7 +2854,7 @@
ptr pointer to option structure
*/
-static struct my_option *find_option(struct my_option *opt, const char *name)
+static struct my_option *find_option(struct my_option *opt, const char *name)
{
uint length=strlen(name);
for (; opt->name; opt++)
@@ -3255,7 +3262,7 @@
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_DEPRECATED_SYNTAX,
ER(ER_WARN_DEPRECATED_SYNTAX), "table_type",
- "storage_engine");
+ "storage_engine");
}
void sys_var_thd_table_type::set_default(THD *thd, enum_var_type type)
@@ -3354,7 +3361,7 @@
ulong fix_sql_mode(ulong sql_mode)
{
/*
- Note that we dont set
+ Note that we dont set
MODE_NO_KEY_OPTIONS | MODE_NO_TABLE_OPTIONS | MODE_NO_FIELD_OPTIONS
to allow one to get full use of MySQL in this mode.
*/
@@ -3363,7 +3370,7 @@
{
sql_mode|= (MODE_REAL_AS_FLOAT | MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES |
MODE_IGNORE_SPACE);
- /*
+ /*
MODE_ONLY_FULL_GROUP_BY removed from ANSI mode because it is currently
overly restrictive (see BUG#8510).
*/
@@ -3448,7 +3455,7 @@
KEY_CACHE *key_cache;
DBUG_ENTER("create_key_cache");
DBUG_PRINT("enter",("name: %.*s", length, name));
-
+
if ((key_cache= (KEY_CACHE*) my_malloc(sizeof(KEY_CACHE),
MYF(MY_ZEROFILL | MY_WME))))
{
@@ -3515,7 +3522,7 @@
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_DEPRECATED_SYNTAX,
ER(ER_WARN_DEPRECATED_SYNTAX), "log_bin_trust_routine_creators",
- "log_bin_trust_function_creators");
+ "log_bin_trust_function_creators");
}
void sys_var_trust_routine_creators::set_default(THD *thd, enum_var_type type)
| Thread |
|---|
| • bk commit into 5.0 tree (msvensson:1.2165) | msvensson | 18 Apr |