summaryrefslogtreecommitdiff
path: root/sql/hostname.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2020-01-29 13:50:26 +0100
committerSergei Golubchik <serg@mariadb.org>2020-03-10 19:24:22 +0100
commit7c58e97bf6f80a251046c5b3e7bce826fe058bd6 (patch)
tree7d32d26b320cf83296ee0ede2ea164ad116c4de8 /sql/hostname.cc
parent2ac3121af2767186c489054db5d4871d04b8eef4 (diff)
downloadmariadb-git-7c58e97bf6f80a251046c5b3e7bce826fe058bd6.tar.gz
perfschema memory related instrumentation changes
Diffstat (limited to 'sql/hostname.cc')
-rw-r--r--sql/hostname.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/sql/hostname.cc b/sql/hostname.cc
index 968914fd56e..edf31c11081 100644
--- a/sql/hostname.cc
+++ b/sql/hostname.cc
@@ -150,10 +150,9 @@ bool hostname_cache_init()
Host_entry tmp;
uint key_offset= (uint) ((char*) (&tmp.ip_key) - (char*) &tmp);
- if (!(hostname_cache= new Hash_filo<Host_entry>(host_cache_size,
- key_offset, HOST_ENTRY_KEY_SIZE,
- NULL, (my_hash_free_key) free,
- &my_charset_bin)))
+ if (!(hostname_cache= new Hash_filo<Host_entry>(key_memory_host_cache_hostname,
+ host_cache_size, key_offset, HOST_ENTRY_KEY_SIZE,
+ NULL, (my_hash_free_key) free, &my_charset_bin)))
return 1;
hostname_cache->clear();
@@ -476,7 +475,8 @@ int ip_to_hostname(struct sockaddr_storage *ip_storage,
if (entry->m_host_validated)
{
if (entry->m_hostname_length)
- *hostname= my_strdup(entry->m_hostname, MYF(0));
+ *hostname= my_strdup(key_memory_host_cache_hostname,
+ entry->m_hostname, MYF(0));
DBUG_PRINT("info",("IP (%s) has been found in the cache. "
"Hostname: '%s'",
@@ -926,7 +926,8 @@ int ip_to_hostname(struct sockaddr_storage *ip_storage,
{
/* Copy host name string to be stored in the cache. */
- *hostname= my_strdup(hostname_buffer, MYF(0));
+ *hostname= my_strdup(key_memory_host_cache_hostname,
+ hostname_buffer, MYF(0));
if (!*hostname)
{