summaryrefslogtreecommitdiff
path: root/sql/hostname.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-05-07 16:12:29 +0200
committerSergei Golubchik <sergii@pisem.net>2014-05-07 16:12:29 +0200
commitbff1b52a101abc17ef05ee1602e261f06da35403 (patch)
tree817d1ebe887d4bc108fe4499626b30e032cc3b7c /sql/hostname.cc
parent5ffe939a6c00f072d885fc324354ccf3ebaa2657 (diff)
downloadmariadb-git-bff1b52a101abc17ef05ee1602e261f06da35403.tar.gz
revno: 5305.1.1
committer: Marc Alff <marc.alff@oracle.com> branch nick: mysql-5.6-bug17156507 timestamp: Tue 2013-07-23 15:08:32 +0200 message: Bug#17156507 SUCCESSFUL CONNECTION ATTEMPT DOESN'T RESET THE SUM_CONNECT_ERRORS COUNTER (test case was merged with perfschema 5.6.17)
Diffstat (limited to 'sql/hostname.cc')
-rw-r--r--sql/hostname.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/hostname.cc b/sql/hostname.cc
index 11cd16ac857..c6c58a0db92 100644
--- a/sql/hostname.cc
+++ b/sql/hostname.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2012, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
Copyright (c) 2011, 2014, SkySQL Ab.
This program is free software; you can redistribute it and/or modify
@@ -457,12 +457,12 @@ int ip_to_hostname(struct sockaddr_storage *ip_storage,
if (entry)
{
entry->m_last_seen= now;
+ *connect_errors= entry->m_errors.m_connect;
- if (entry->m_errors.m_connect > max_connect_errors)
+ if (entry->m_errors.m_connect >= max_connect_errors)
{
entry->m_errors.m_host_blocked++;
entry->set_error_timestamps(now);
- *connect_errors= entry->m_errors.m_connect;
mysql_mutex_unlock(&hostname_cache->lock);
DBUG_RETURN(RC_BLOCKED_HOST);
}