diff options
author | Harin Vadodaria <harin.vadodaria@oracle.com> | 2012-06-13 17:00:55 +0530 |
---|---|---|
committer | Harin Vadodaria <harin.vadodaria@oracle.com> | 2012-06-13 17:00:55 +0530 |
commit | b3a7fbce808535e8204876f2fd4196ec90634167 (patch) | |
tree | 1302a030e7c404d8e073bb0fd98814f7f39a604d /sql/sql_connect.cc | |
parent | 2436e4c1bc3ce8c18a8f0a5e1101ed9d07a1c215 (diff) | |
parent | cf37a481f0114d4cdb40c4d8fb483939f6b1bc5a (diff) | |
download | mariadb-git-b3a7fbce808535e8204876f2fd4196ec90634167.tar.gz |
Bug#11753779: MAX_CONNECT_ERRORS WORKS ONLY WHEN 1ST
INC_HOST_ERRORS() IS CALLED.
Description: Merge from MySQL-5.1 to MySQL-5.5
Diffstat (limited to 'sql/sql_connect.cc')
-rw-r--r-- | sql/sql_connect.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc index cdb0f5de049..14a1acdef5e 100644 --- a/sql/sql_connect.cc +++ b/sql/sql_connect.cc @@ -499,6 +499,19 @@ static int check_connection(THD *thd) my_error(ER_BAD_HOST_ERROR, MYF(0)); return 1; } + /* BEGIN : DEBUG */ + DBUG_EXECUTE_IF("addr_fake_ipv4", + { + struct sockaddr *sa= (sockaddr *) &net->vio->remote; + sa->sa_family= AF_INET; + struct in_addr *ip4= &((struct sockaddr_in *)sa)->sin_addr; + /* See RFC 5737, 192.0.2.0/23 is reserved */ + const char* fake= "192.0.2.4"; + ip4->s_addr= inet_addr(fake); + strcpy(ip, fake); + };); + /* END : DEBUG */ + if (!(thd->main_security_ctx.ip= my_strdup(ip,MYF(MY_WME)))) return 1; /* The error is set by my_strdup(). */ thd->main_security_ctx.host_or_ip= thd->main_security_ctx.ip; |