~tsarev/percona-server/5.5.12-valgrind_786645_fixes

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