summaryrefslogtreecommitdiff
path: root/sql/set_var.cc
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2004-09-09 16:52:22 +0300
committerunknown <bell@sanja.is.com.ua>2004-09-09 16:52:22 +0300
commited2c4854dd9d6b75f052d0f7e824b68cc68e35d0 (patch)
tree7615ce281add0dfaa6366a6776a26995613845cb /sql/set_var.cc
parent7de077f7dfc209bdfcc847920a394ff4c55a2e96 (diff)
parentbc787254247cb66a5e1adc0af6834c10737ecc6e (diff)
downloadmariadb-git-ed2c4854dd9d6b75f052d0f7e824b68cc68e35d0.tar.gz
merge
mysql-test/r/view.result: Auto merged mysql-test/t/view.test: Auto merged sql/item.cc: Auto merged sql/mysql_priv.h: Auto merged sql/sql_base.cc: Auto merged sql/sql_delete.cc: Auto merged sql/sql_insert.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_view.cc: Auto merged
Diffstat (limited to 'sql/set_var.cc')
-rw-r--r--sql/set_var.cc36
1 files changed, 26 insertions, 10 deletions
diff --git a/sql/set_var.cc b/sql/set_var.cc
index 458f1a3b08e..4b347f91869 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -34,6 +34,12 @@
- If the variable should show up in 'show variables' add it to the
init_vars[] struct in this file
+ NOTES:
+ - Be careful with var->save_result: sys_var::check() only updates
+ ulonglong_value; so other members of the union are garbage then; to use
+ them you must first assign a value to them (in specific ::check() for
+ example).
+
TODO:
- Add full support for the variable character_set (for 4.1)
@@ -623,8 +629,8 @@ struct show_var_st init_vars[]= {
#ifdef HAVE_BERKELEY_DB
{"bdb_cache_size", (char*) &berkeley_cache_size, SHOW_LONG},
{"bdb_home", (char*) &berkeley_home, SHOW_CHAR_PTR},
- {"bdb_logdir", (char*) &berkeley_logdir, SHOW_CHAR_PTR},
{"bdb_log_buffer_size", (char*) &berkeley_log_buffer_size, SHOW_LONG},
+ {"bdb_logdir", (char*) &berkeley_logdir, SHOW_CHAR_PTR},
{"bdb_max_lock", (char*) &berkeley_max_lock, SHOW_LONG},
{"bdb_shared_data", (char*) &berkeley_shared_data, SHOW_BOOL},
{"bdb_tmpdir", (char*) &berkeley_tmpdir, SHOW_CHAR_PTR},
@@ -664,9 +670,11 @@ struct show_var_st init_vars[]= {
{"have_bdb", (char*) &have_berkeley_db, SHOW_HAVE},
{"have_compress", (char*) &have_compress, SHOW_HAVE},
{"have_crypt", (char*) &have_crypt, SHOW_HAVE},
+ {"have_csv", (char*) &have_csv_db, SHOW_HAVE},
+ {"have_example_engine", (char*) &have_example_db, SHOW_HAVE},
+ {"have_geometry", (char*) &have_geometry, SHOW_HAVE},
{"have_innodb", (char*) &have_innodb, SHOW_HAVE},
{"have_isam", (char*) &have_isam, SHOW_HAVE},
- {"have_geometry", (char*) &have_geometry, SHOW_HAVE},
{"have_ndbcluster", (char*) &have_ndbcluster, SHOW_HAVE},
{"have_openssl", (char*) &have_openssl, SHOW_HAVE},
{"have_query_cache", (char*) &have_query_cache, SHOW_HAVE},
@@ -685,6 +693,7 @@ struct show_var_st init_vars[]= {
{"innodb_fast_shutdown", (char*) &innobase_fast_shutdown, SHOW_MY_BOOL},
{"innodb_file_io_threads", (char*) &innobase_file_io_threads, SHOW_LONG },
{"innodb_file_per_table", (char*) &innobase_file_per_table, SHOW_MY_BOOL},
+ {"innodb_locks_unsafe_for_binlog", (char*) &innobase_locks_unsafe_for_binlog, SHOW_MY_BOOL},
{"innodb_flush_log_at_trx_commit", (char*) &innobase_flush_log_at_trx_commit, SHOW_INT},
{"innodb_flush_method", (char*) &innobase_unix_file_flush_method, SHOW_CHAR_PTR},
{"innodb_force_recovery", (char*) &innobase_force_recovery, SHOW_LONG },
@@ -784,6 +793,8 @@ struct show_var_st init_vars[]= {
SHOW_SYS},
{sys_query_cache_size.name, (char*) &sys_query_cache_size, SHOW_SYS},
{sys_query_cache_type.name, (char*) &sys_query_cache_type, SHOW_SYS},
+ {sys_query_cache_wlock_invalidate.name,
+ (char *) &sys_query_cache_wlock_invalidate, SHOW_SYS},
#endif /* HAVE_QUERY_CACHE */
{sys_query_prealloc_size.name, (char*) &sys_query_prealloc_size, SHOW_SYS},
{sys_range_alloc_block_size.name, (char*) &sys_range_alloc_block_size,
@@ -1147,8 +1158,10 @@ static int check_max_delayed_threads(THD *thd, set_var *var)
static void fix_max_connections(THD *thd, enum_var_type type)
{
+#ifndef EMBEDDED_LIBRARY
resize_thr_alarm(max_connections +
global_system_variables.max_insert_delayed_threads + 10);
+#endif
}
@@ -2347,7 +2360,7 @@ bool sys_var_slave_skip_counter::update(THD *thd, set_var *var)
bool sys_var_sync_binlog_period::update(THD *thd, set_var *var)
{
pthread_mutex_t *lock_log= mysql_bin_log.get_log_lock();
- sync_binlog_period= var->save_result.ulong_value;
+ sync_binlog_period= (ulong) var->save_result.ulonglong_value;
/*
Must reset the counter otherwise it may already be beyond the new period
and so the new period will not be taken into account. Need mutex otherwise
@@ -2389,8 +2402,9 @@ bool sys_var_thd_time_zone::check(THD *thd, set_var *var)
return 1;
}
#endif
-
- if (!(var->save_result.time_zone= my_tz_find(thd, res)))
+
+ if (!(var->save_result.time_zone=
+ my_tz_find(res, thd->lex->time_zone_tables_used)))
{
my_error(ER_UNKNOWN_TIME_ZONE, MYF(0), res ? res->c_ptr() : "NULL");
return 1;
@@ -2435,7 +2449,8 @@ void sys_var_thd_time_zone::set_default(THD *thd, enum_var_type type)
if (default_tz_name)
{
String str(default_tz_name, &my_charset_latin1);
- global_system_variables.time_zone= my_tz_find(thd, &str);
+ global_system_variables.time_zone=
+ my_tz_find(&str, thd->lex->time_zone_tables_used);
}
else
global_system_variables.time_zone= my_tz_SYSTEM;
@@ -2892,8 +2907,9 @@ int set_var_password::check(THD *thd)
if (!user->host.str)
user->host.str= (char*) thd->host_or_ip;
/* Returns 1 as the function sends error to client */
- return check_change_password(thd, user->host.str, user->user.str) ? 1 : 0;
-#else
+ return check_change_password(thd, user->host.str, user->user.str, password) ?
+ 1 : 0;
+#else
return 0;
#endif
}
@@ -2902,8 +2918,8 @@ int set_var_password::update(THD *thd)
{
#ifndef NO_EMBEDDED_ACCESS_CHECKS
/* Returns 1 as the function sends error to client */
- return (change_password(thd, user->host.str, user->user.str, password) ?
- 1 : 0);
+ return change_password(thd, user->host.str, user->user.str, password) ?
+ 1 : 0;
#else
return 0;
#endif