1
# name : log_connection_error.patch
6
# Any small change to this file in the main branch
7
# should be done or reviewed by the maintainer!
8
diff -ruN a/mysql-test/r/connect.result b/mysql-test/r/connect.result
9
--- a/mysql-test/r/connect.result 2010-07-28 16:47:46.895318726 +0400
10
+++ b/mysql-test/r/connect.result 2010-07-28 16:47:48.234134231 +0400
12
+set global log_warnings=0;
13
drop table if exists t1,t2;
17
# ------------------------------------------------------------------
19
# ------------------------------------------------------------------
20
+set global log_warnings=1;
21
diff -ruN a/mysql-test/t/connect.test b/mysql-test/t/connect.test
22
--- a/mysql-test/t/connect.test 2010-07-28 16:47:46.865318816 +0400
23
+++ b/mysql-test/t/connect.test 2010-07-28 16:47:48.057260581 +0400
25
+set global log_warnings=0;
27
# This test is to check various cases of connections
28
# with right and wrong password, with and without database
29
# Unfortunately the check is incomplete as we can't connect without database
31
# Wait till all disconnects are completed
32
--source include/wait_until_count_sessions.inc
34
+set global log_warnings=1;
35
diff -ruN a/patch_info/log_connection_error.patch b/patch_info/log_connection_error.patch
36
--- a/patch_info/log_connection_error.patch 1970-01-01 03:00:00.000000000 +0300
37
+++ b/patch_info/log_connection_error.patch 2010-07-28 16:47:47.634070367 +0400
39
+File=log_connection_error.patch
40
+Name=logging abandoned connections
42
+Author=Percona <info@percona.com>
45
diff -ruN a/sql/mysqld.cc b/sql/mysqld.cc
46
--- a/sql/mysqld.cc 2010-07-28 16:47:47.105319218 +0400
47
+++ b/sql/mysqld.cc 2010-07-28 16:47:47.644101813 +0400
48
@@ -5004,6 +5004,10 @@
50
DBUG_PRINT("error",("Too many connections"));
51
close_connection(thd, ER_CON_COUNT_ERROR, 1);
52
+ if (global_system_variables.log_warnings)
54
+ sql_print_warning("%s", ER_DEFAULT(ER_CON_COUNT_ERROR));
59
@@ -5384,6 +5388,10 @@
60
if (!(thd->net.vio= vio_new_win32pipe(hConnectedPipe)) ||
61
my_net_init(&thd->net, thd->net.vio))
63
+ if (global_system_variables.log_warnings)
65
+ sql_print_warning("%s", ER_DEFAULT(ER_OUT_OF_RESOURCES));
67
close_connection(thd, ER_OUT_OF_RESOURCES, 1);
70
@@ -5579,6 +5587,10 @@
71
event_conn_closed)) ||
72
my_net_init(&thd->net, thd->net.vio))
74
+ if (global_system_variables.log_warnings)
76
+ sql_print_warning("%s", ER_DEFAULT(ER_OUT_OF_RESOURCES));
78
close_connection(thd, ER_OUT_OF_RESOURCES, 1);