summaryrefslogtreecommitdiff
path: root/sql/sql_connect.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_connect.cc')
-rw-r--r--sql/sql_connect.cc24
1 files changed, 1 insertions, 23 deletions
diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc
index f210762db50..625f40a7ff8 100644
--- a/sql/sql_connect.cc
+++ b/sql/sql_connect.cc
@@ -1403,14 +1403,7 @@ void CONNECT::close_and_delete()
if (vio)
vio_close(vio);
if (thread_count_incremented)
- {
- /*
- Normally this is handled by THD::unlink. As we haven't yet created
- a THD and put it in the thread list, we have to manage counting here.
- */
- dec_thread_count();
dec_connection_count(scheduler);
- }
statistic_increment(connection_errors_internal, &LOCK_status);
statistic_increment(aborted_connects,&LOCK_status);
@@ -1434,23 +1427,8 @@ void CONNECT::close_with_error(uint sql_errno,
close_connection(thd, close_error);
delete thd;
set_current_thd(0);
- if (thread_count_incremented)
- {
- dec_thread_count();
- dec_connection_count(scheduler);
- }
- delete this;
- statistic_increment(connection_errors_internal, &LOCK_status);
- statistic_increment(aborted_connects,&LOCK_status);
- }
- else
- {
- /*
- Out of memory; We can't generate an error, just close the connection
- close_and_delete() will increment statistics.
- */
- close_and_delete();
}
+ close_and_delete();
}