~tsarev/percona-server/5.5.12-valgrind_786645_fixes

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# name       : log_connection_error.patch
# introduced : 12
# maintainer : Oleg
#
#!!! notice !!!
# Any small change to this file in the main branch
# should be done or reviewed by the maintainer!
diff -ruN /dev/null b/patch_info/log_connection_error.patch
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ b/patch_info/log_connection_error.patch	2011-04-09 18:48:54.000000000 +0400
@@ -0,0 +1,6 @@
+File=log_connection_error.patch
+Name=logging abandoned connections
+Version=1.0
+Author=Percona <info@percona.com>
+License=GPL
+Comment=
diff -ruN a/sql/mysqld.cc b/sql/mysqld.cc
--- a/sql/mysqld.cc	2011-04-09 18:48:53.000000000 +0400
+++ b/sql/mysqld.cc	2011-04-09 18:48:54.000000000 +0400
@@ -5044,6 +5044,10 @@
 
     DBUG_PRINT("error",("Too many connections"));
     close_connection(thd, ER_CON_COUNT_ERROR);
+    if (global_system_variables.log_warnings)
+    {
+      sql_print_warning("%s", ER_DEFAULT(ER_CON_COUNT_ERROR));
+    }
     delete thd;
     DBUG_VOID_RETURN;
   }
@@ -5424,6 +5428,10 @@
     if (!(thd->net.vio= vio_new_win32pipe(hConnectedPipe)) ||
 	my_net_init(&thd->net, thd->net.vio))
     {
+      if (global_system_variables.log_warnings)
+      {
+        sql_print_warning("%s", ER_DEFAULT(ER_OUT_OF_RESOURCES));
+      }
       close_connection(thd, ER_OUT_OF_RESOURCES);
       delete thd;
       continue;
@@ -5619,6 +5627,10 @@
                                                    event_conn_closed)) ||
                         my_net_init(&thd->net, thd->net.vio))
     {
+      if (global_system_variables.log_warnings)
+      {
+        sql_print_warning("%s", ER_DEFAULT(ER_OUT_OF_RESOURCES));
+      }
       close_connection(thd, ER_OUT_OF_RESOURCES);
       errmsg= 0;
       goto errorconn;