1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

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.
This commit is contained in:
Harin Vadodaria
2012-09-17 17:02:17 +05:30
parent 5cbdb90827
commit 9d007e075d
2 changed files with 69 additions and 8 deletions

View File

@@ -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)))
{