summaryrefslogtreecommitdiff
path: root/sql/hostname.cc
diff options
context:
space:
mode:
authorunknown <monty@donna.mysql.com>2000-12-07 14:08:48 +0200
committerunknown <monty@donna.mysql.com>2000-12-07 14:08:48 +0200
commit42018251893357035befbffa256275c71def9ebc (patch)
tree8a5c9d678d477bb2c3fa95057c9299dcf9560aab /sql/hostname.cc
parentd0643438b647048f74a04d73d5685eb2c80f1d4b (diff)
downloadmariadb-git-42018251893357035befbffa256275c71def9ebc.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 Docs/manual.texi: Update of BDB info + Changes configure.in: Added test of readlink include/mysqld_error.h: Added new error message sql/ha_berkeley.cc: Added storing of status, CHECK, ANALYZE and OPTIMIZE TABLE sql/ha_berkeley.h: Added storing of status, CHECK, ANALYZE and OPTIMIZE TABLE sql/handler.cc: Only write full transactions to binary log sql/hostname.cc: cleanup sql/log.cc: Only write full transactions to binary log sql/log_event.h: Only write full transactions to binary log sql/mf_iocache.cc: Changes to be able to use IO_CACHE to save statements in a transaction sql/mysql_priv.h: New variables sql/mysqld.cc: Only write full transactions to binary log Added default values for server_id Lots of new bdb options sql/share/czech/errmsg.sys: Added new error message sql/share/czech/errmsg.txt: Added new error message sql/share/danish/errmsg.sys: Added new error message sql/share/danish/errmsg.txt: Added new error message sql/share/dutch/errmsg.sys: Added new error message sql/share/dutch/errmsg.txt: Added new error message sql/share/english/errmsg.sys: Added new error message sql/share/english/errmsg.txt: Added new error message sql/share/estonian/errmsg.sys: Added new error message sql/share/estonian/errmsg.txt: Added new error message sql/share/french/errmsg.sys: Added new error message sql/share/french/errmsg.txt: Added new error message sql/share/german/errmsg.sys: Added new error message sql/share/german/errmsg.txt: Added new error message sql/share/greek/errmsg.sys: Added new error message sql/share/greek/errmsg.txt: Added new error message sql/share/hungarian/errmsg.sys: Added new error message sql/share/hungarian/errmsg.txt: Added new error message sql/share/italian/errmsg.sys: Added new error message sql/share/italian/errmsg.txt: Added new error message sql/share/japanese/errmsg.sys: Added new error message sql/share/japanese/errmsg.txt: Added new error message sql/share/korean/errmsg.sys: Added new error message sql/share/korean/errmsg.txt: Added new error message sql/share/norwegian-ny/errmsg.txt: Added new error message sql/share/norwegian/errmsg.txt: Added new error message sql/share/polish/errmsg.sys: Added new error message sql/share/polish/errmsg.txt: Added new error message sql/share/portuguese/errmsg.sys: Added new error message sql/share/portuguese/errmsg.txt: Added new error message sql/share/romanian/errmsg.txt: Added new error message sql/share/russian/errmsg.sys: Added new error message sql/share/russian/errmsg.txt: Added new error message sql/share/slovak/errmsg.sys: Added new error message sql/share/slovak/errmsg.txt: Added new error message sql/share/spanish/errmsg.sys: Added new error message sql/share/spanish/errmsg.txt: Added new error message sql/share/swedish/errmsg.OLD: Added new error message sql/share/swedish/errmsg.sys: Added new error message sql/share/swedish/errmsg.txt: Added new error message sql/sql_base.cc: cleanup sql/sql_class.cc: Only write full transactions to binary log sql/sql_class.h: Added error handling of failed writes to logs sql/sql_db.cc: Fix for DROP DATABASE on windows sql/sql_delete.cc: Only write full transactions to binary log sql/sql_insert.cc: Only write full transactions to binary log sql/sql_load.cc: Only write full transactions to binary log sql/sql_parse.cc: End transaction at DROP, RENAME, CREATE and TRUNCATE sql/sql_table.cc: Fixes for ALTER TABLE on BDB tables for windows sql/sql_update.cc: Only write full transactions to binary log sql/sql_yacc.yy: AGAINST is not anymore a reserved word support-files/my-huge.cnf.sh: Changed to use binary log support-files/my-large.cnf.sh: Changed to use binary log support-files/my-medium.cnf.sh: Changed to use binary log support-files/my-small.cnf.sh: Changed to use binary log
Diffstat (limited to 'sql/hostname.cc')
-rw-r--r--sql/hostname.cc18
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);
}