diff options
author | Harin Vadodaria <harin.vadodaria@oracle.com> | 2012-06-13 16:03:58 +0530 |
---|---|---|
committer | Harin Vadodaria <harin.vadodaria@oracle.com> | 2012-06-13 16:03:58 +0530 |
commit | cf37a481f0114d4cdb40c4d8fb483939f6b1bc5a (patch) | |
tree | 990bf2f8b0578056d7196b7e5134cea67b09b3b7 /sql/hostname.cc | |
parent | 4a2d65cc3154ce410fe6d5067b07204fe7a9cbf0 (diff) | |
download | mariadb-git-cf37a481f0114d4cdb40c4d8fb483939f6b1bc5a.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.cc | 9 |
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))) { |