summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Black <daniel@mariadb.org>2022-11-18 21:28:06 +1100
committerGitHub <noreply@github.com>2022-11-18 10:28:06 +0000
commitf4a1298f245f678badc8a5b55571ca4f460718b1 (patch)
tree9edaef7771dd9acf4a77abc93946acdd37f8e8dd
parent6216a2dfa2faabf8abfd3099a6cd46b00cef4115 (diff)
downloadmariadb-git-f4a1298f245f678badc8a5b55571ca4f460718b1.tar.gz
MDEV-12274: Too many connections warning in error log (#2213)
Because of the default warning level, aborted unauthenticated connections are in the error log. These errors frequently occur in production environments because cancelled connectiosn occur all the time when web pages are shutdown. Rather than flood our user's errors log with these ordinary messages, lets push them down to the warning level at log-warnings=4 level. Concept approved by Monty.
-rw-r--r--sql/sql_connect.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc
index 4d9ef98d22b..91a99e0aded 100644
--- a/sql/sql_connect.cc
+++ b/sql/sql_connect.cc
@@ -1263,7 +1263,8 @@ void prepare_new_connection_state(THD* thd)
and the main Diagnostics Area contains an error condition.
*/
if (packet_length != packet_error)
- my_error(ER_NEW_ABORTING_CONNECTION, MYF(0),
+ my_error(ER_NEW_ABORTING_CONNECTION,
+ (thd->db.str || sctx->user) ? MYF(0) : MYF(ME_JUST_WARNING),
thd->thread_id,
thd->db.str ? thd->db.str : "unconnected",
sctx->user ? sctx->user : "unauthenticated",