summaryrefslogtreecommitdiff
path: root/sql/sql_acl.cc
diff options
context:
space:
mode:
authorHarin Vadodaria <harin.vadodaria@oracle.com>2012-09-17 17:06:18 +0530
committerHarin Vadodaria <harin.vadodaria@oracle.com>2012-09-17 17:06:18 +0530
commit42eac7dfc1d95ec14fa80263ee6157759d495088 (patch)
tree2e060e985e18b5f8f87a7bfc8aa29be5cb82c63d /sql/sql_acl.cc
parent3b48d80b996b13be3a66af73abe24d8322b857f8 (diff)
parent9f0727804c34d792c6fb7ee40941a5ab2b57821f (diff)
downloadmariadb-git-42eac7dfc1d95ec14fa80263ee6157759d495088.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_acl.cc')
-rw-r--r--sql/sql_acl.cc33
1 files changed, 31 insertions, 2 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 242967fff6a..575017a800e 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -8540,8 +8540,6 @@ static ulong parse_client_handshake_packet(MPVIO_EXT *mpvio,
bool packet_has_required_size= false;
DBUG_ASSERT(mpvio->status == MPVIO_EXT::FAILURE);
- if (mpvio->connect_errors)
- reset_host_errors(mpvio->ip);
uint charset_code= 0;
end= (char *)net->read_pos;
@@ -8552,6 +8550,11 @@ static ulong parse_client_handshake_packet(MPVIO_EXT *mpvio,
*/
size_t bytes_remaining_in_packet= pkt_len;
+ DBUG_EXECUTE_IF("host_error_packet_length",
+ {
+ bytes_remaining_in_packet= 0;
+ };);
+
/*
Peek ahead on the client capability packet and determine which version of
the protocol should be used.
@@ -8609,6 +8612,11 @@ static ulong parse_client_handshake_packet(MPVIO_EXT *mpvio,
*/
charset_code= default_charset_info->number;
}
+ DBUG_EXECUTE_IF("host_error_charset",
+ {
+ return packet_error;
+ };);
+
DBUG_PRINT("info", ("client_character_set: %u", charset_code));
if (mpvio->charset_adapter->init_client_charset(charset_code))
@@ -8671,6 +8679,11 @@ skip_to_ssl:
bytes_remaining_in_packet -= AUTH_PACKET_HEADER_SIZE_PROTO_40;
}
+ DBUG_EXECUTE_IF("host_error_SSL_layering",
+ {
+ packet_has_required_size= 0;
+ };);
+
if (!packet_has_required_size)
return packet_error;
}
@@ -8702,6 +8715,11 @@ skip_to_ssl:
size_t user_len;
char *user= get_string(&end, &bytes_remaining_in_packet, &user_len);
+ DBUG_EXECUTE_IF("host_error_user",
+ {
+ user= NULL;
+ };);
+
if (user == NULL)
return packet_error;
@@ -8729,6 +8747,11 @@ skip_to_ssl:
passwd= get_string(&end, &bytes_remaining_in_packet, &passwd_len);
}
+ DBUG_EXECUTE_IF("host_error_password",
+ {
+ passwd= NULL;
+ };);
+
if (passwd == NULL)
return packet_error;
@@ -9527,6 +9550,12 @@ acl_authenticate(THD *thd, uint connect_errors, uint com_change_user_pkt_len)
thd->net.skip_big_packet= TRUE;
#endif
+ /*
+ Reset previous connection failures if any.
+ */
+ if (mpvio.connect_errors)
+ reset_host_errors(mpvio.ip);
+
/* Ready to handle queries */
DBUG_RETURN(0);
}