diff options
author | Alexander Nozdrin <alik@sun.com> | 2009-11-02 14:10:04 +0300 |
---|---|---|
committer | Alexander Nozdrin <alik@sun.com> | 2009-11-02 14:10:04 +0300 |
commit | a708ba6524f27d0f0bc3bc4b4b9952f372d38bd0 (patch) | |
tree | 52d813ba1e4f0b538b1f175a1d157d865cce8a22 /sql/sql_connect.cc | |
parent | 487bfd56d4386fe9abbd4beb80d759b0c5c95909 (diff) | |
parent | 46aa4c2672e2d0b1727dde5b80bd5039adbf96f6 (diff) | |
download | mariadb-git-a708ba6524f27d0f0bc3bc4b4b9952f372d38bd0.tar.gz |
Manual merge from mysql-next-mr.
Diffstat (limited to 'sql/sql_connect.cc')
-rw-r--r-- | sql/sql_connect.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc index c6cd57f9ad9..959209df412 100644 --- a/sql/sql_connect.cc +++ b/sql/sql_connect.cc @@ -497,6 +497,18 @@ check_user(THD *thd, enum enum_server_command command, thd->main_security_ctx.user, thd->main_security_ctx.host_or_ip, passwd_len ? ER(ER_YES) : ER(ER_NO)); + /* + log access denied messages to the error log when log-warnings = 2 + so that the overhead of the general query log is not required to track + failed connections + */ + if (global_system_variables.log_warnings > 1) + { + sql_print_warning(ER(ER_ACCESS_DENIED_ERROR), + thd->main_security_ctx.user, + thd->main_security_ctx.host_or_ip, + passwd_len ? ER(ER_YES) : ER(ER_NO)); + } DBUG_RETURN(1); #endif /* NO_EMBEDDED_ACCESS_CHECKS */ } |