summaryrefslogtreecommitdiff
path: root/sql/sys_vars.cc
diff options
context:
space:
mode:
authorunknown <timour@askmonty.org>2013-06-27 12:51:34 +0300
committerunknown <timour@askmonty.org>2013-06-27 12:51:34 +0300
commitecbf36a914b696b01ae1497567025e239f4ea693 (patch)
tree4601dad5ca6d178a6efedfe79d1ef56a9ab257f8 /sql/sys_vars.cc
parent68262ba648886e2d5f35fc85e3cc45df7ffd9ae5 (diff)
downloadmariadb-git-ecbf36a914b696b01ae1497567025e239f4ea693.tar.gz
MDEV-4058
MySQL 5.6.10 performance schema: merge of host_cache table
Diffstat (limited to 'sql/sys_vars.cc')
-rw-r--r--sql/sys_vars.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index cd69bdad5df..2fa24306066 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -48,6 +48,7 @@
// mysql_user_table_is_in_short_password_format
#include "derror.h" // read_texts
#include "sql_base.h" // close_cached_tables
+#include "hostname.h" // host_cache_size
#include <myisam.h>
#include "log_slow.h"
#include "debug_sync.h" // DEBUG_SYNC
@@ -3773,6 +3774,22 @@ static Sys_var_tz Sys_time_zone(
SESSION_VAR(time_zone), NO_CMD_LINE,
DEFAULT(&default_tz), NO_MUTEX_GUARD, IN_BINLOG);
+static bool fix_host_cache_size(sys_var *, THD *, enum_var_type)
+{
+ hostname_cache_resize((uint) host_cache_size);
+ return false;
+}
+
+static Sys_var_ulong Sys_host_cache_size(
+ "host_cache_size",
+ "How many host names should be cached to avoid resolving.",
+ GLOBAL_VAR(host_cache_size),
+ CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 65536),
+ DEFAULT(HOST_CACHE_SIZE),
+ BLOCK_SIZE(1),
+ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(NULL),
+ ON_UPDATE(fix_host_cache_size));
+
static Sys_var_charptr Sys_ignore_db_dirs(
"ignore_db_dirs",
"Specifies a directory to add to the ignore list when collecting "