~sergei.glushchenko/percona-server/55-tp

« back to all changes in this revision

Viewing changes to log_connection_error.patch

  • Committer: Oleg Tsarev
  • Date: 2010-12-09 18:30:58 UTC
  • Revision ID: oleg.tsarev@percona.com-20101209183058-1mq1qrgjjkz3qxof
propogate Oleg's patches

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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!
 
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
 
11
@@ -1,3 +1,4 @@
 
12
+set global log_warnings=0;
 
13
 drop table if exists t1,t2;
 
14
 show tables;
 
15
 Tables_in_mysql
 
16
@@ -221,3 +222,4 @@
 
17
 # ------------------------------------------------------------------
 
18
 # -- End of 5.1 tests
 
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
 
24
@@ -1,3 +1,5 @@
 
25
+set global log_warnings=0;
 
26
+
 
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
 
30
@@ -300,3 +302,4 @@
 
31
 # Wait till all disconnects are completed
 
32
 --source include/wait_until_count_sessions.inc
 
33
 
 
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
 
38
@@ -0,0 +1,6 @@
 
39
+File=log_connection_error.patch
 
40
+Name=logging abandoned connections
 
41
+Version=1.0
 
42
+Author=Percona <info@percona.com>
 
43
+License=GPL
 
44
+Comment=
 
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 @@
 
49
 
 
50
     DBUG_PRINT("error",("Too many connections"));
 
51
     close_connection(thd, ER_CON_COUNT_ERROR, 1);
 
52
+    if (global_system_variables.log_warnings)
 
53
+    {
 
54
+      sql_print_warning("%s", ER_DEFAULT(ER_CON_COUNT_ERROR));
 
55
+    }
 
56
     delete thd;
 
57
     DBUG_VOID_RETURN;
 
58
   }
 
59
@@ -5384,6 +5388,10 @@
 
60
     if (!(thd->net.vio= vio_new_win32pipe(hConnectedPipe)) ||
 
61
        my_net_init(&thd->net, thd->net.vio))
 
62
     {
 
63
+      if (global_system_variables.log_warnings)
 
64
+      {
 
65
+        sql_print_warning("%s", ER_DEFAULT(ER_OUT_OF_RESOURCES));
 
66
+      }
 
67
       close_connection(thd, ER_OUT_OF_RESOURCES, 1);
 
68
       delete thd;
 
69
       continue;
 
70
@@ -5579,6 +5587,10 @@
 
71
                                                    event_conn_closed)) ||
 
72
                         my_net_init(&thd->net, thd->net.vio))
 
73
     {
 
74
+      if (global_system_variables.log_warnings)
 
75
+      {
 
76
+        sql_print_warning("%s", ER_DEFAULT(ER_OUT_OF_RESOURCES));
 
77
+      }
 
78
       close_connection(thd, ER_OUT_OF_RESOURCES, 1);
 
79
       errmsg= 0;
 
80
       goto errorconn;