summaryrefslogtreecommitdiff
path: root/sql/hostname.cc
diff options
context:
space:
mode:
authorHarin Vadodaria <harin.vadodaria@oracle.com>2012-09-17 17:02:17 +0530
committerHarin Vadodaria <harin.vadodaria@oracle.com>2012-09-17 17:02:17 +0530
commit9d007e075d6b933df9dbd1a42d52ab00ee91827c (patch)
treef93a212d0e2ebb9df7496d6770ad8f758c446060 /sql/hostname.cc
parent5cbdb908270a052284155cd5b7eff7eacb177218 (diff)
downloadmariadb-git-9d007e075d6b933df9dbd1a42d52ab00ee91827c.tar.gz
Bug#11753779: MAX_CONNECT_ERRORS WORKS ONLY WHEN 1ST
INC_HOST_ERRORS() IS CALLED. Issue : Sequence of calling inc_host_errors() and reset_host_errors() required some changes in order to maintain correct connection error count. Solution : Call to reset_host_errors() is shifted to a location after which no calls to inc_host_errors() are made.
Diffstat (limited to 'sql/hostname.cc')
-rw-r--r--sql/hostname.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/sql/hostname.cc b/sql/hostname.cc
index 9796755e9fb..38316a8ee19 100644
--- a/sql/hostname.cc
+++ b/sql/hostname.cc
@@ -214,6 +214,15 @@ char * ip_to_hostname(struct in_addr *in, uint *errors)
}
my_gethostbyname_r_free();
#else
+
+ DBUG_EXECUTE_IF("addr_fake_ipv4",
+ {
+ const char* fake_host= "santa.claus.ipv4.example.com";
+ name=my_strdup(fake_host, MYF(0));
+ add_hostname(in,name);
+ DBUG_RETURN(name);
+ };);
+
VOID(pthread_mutex_lock(&LOCK_hostname));
if (!(hp=gethostbyaddr((char*) in,sizeof(*in), AF_INET)))
{