# 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! --- /dev/null +++ b/patch_info/log_connection_error.patch @@ -0,0 +1,6 @@ +File=log_connection_error.patch +Name=logging abandoned connections +Version=1.0 +Author=Percona +License=GPL +Comment= --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5098,6 +5098,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; } @@ -5481,6 +5485,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; @@ -5676,6 +5684,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;