diff options
author | monty@donna.mysql.com <> | 2000-12-07 14:08:48 +0200 |
---|---|---|
committer | monty@donna.mysql.com <> | 2000-12-07 14:08:48 +0200 |
commit | 87d9388e52a128427481064e21373f8460d6b24f (patch) | |
tree | 8a5c9d678d477bb2c3fa95057c9299dcf9560aab /sql/hostname.cc | |
parent | a5c75df390e9b67454bd0a04e75583057e9579f7 (diff) | |
download | mariadb-git-87d9388e52a128427481064e21373f8460d6b24f.tar.gz |
Only write full transactions to binary log
A lot of new functions for BDB tables
Fix for DROP DATABASE on windows
Default server_id variables
Diffstat (limited to 'sql/hostname.cc')
-rw-r--r-- | sql/hostname.cc | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/sql/hostname.cc b/sql/hostname.cc index 47953020ffb..db8f8349446 100644 --- a/sql/hostname.cc +++ b/sql/hostname.cc @@ -180,20 +180,21 @@ my_string ip_to_hostname(struct in_addr *in, uint *errors) VOID(pthread_mutex_lock(&hostname_cache->lock)); if (!(hp=gethostbyaddr((char*) in,sizeof(*in), AF_INET))) { - DBUG_PRINT("error",("gethostbyaddr returned %d",errno)); VOID(pthread_mutex_unlock(&hostname_cache->lock)); - add_wrong_ip(in); - DBUG_RETURN(0); + DBUG_PRINT("error",("gethostbyaddr returned %d",errno)); + goto err; } - if (!hp->h_name[0]) + if (!hp->h_name[0]) // Don't allow empty hostnames { VOID(pthread_mutex_unlock(&hostname_cache->lock)); DBUG_PRINT("error",("Got an empty hostname")); - add_wrong_ip(in); - DBUG_RETURN(0); // Don't allow empty hostnames + goto err; } if (!(name=my_strdup(hp->h_name,MYF(0)))) + { + VOID(pthread_mutex_unlock(&hostname_cache->lock)); DBUG_RETURN(0); // out of memory + } check=gethostbyname(name); VOID(pthread_mutex_unlock(&hostname_cache->lock)); if (!check) @@ -214,8 +215,7 @@ my_string ip_to_hostname(struct in_addr *in, uint *errors) { DBUG_PRINT("error",("mysqld doesn't accept hostnames that starts with a number followed by a '.'")); my_free(name,MYF(0)); - add_wrong_ip(in); - DBUG_RETURN(0); + goto err; } } @@ -230,6 +230,8 @@ my_string ip_to_hostname(struct in_addr *in, uint *errors) } DBUG_PRINT("error",("Couldn't verify hostname with gethostbyname")); my_free(name,MYF(0)); + +err: add_wrong_ip(in); DBUG_RETURN(0); } |