summaryrefslogtreecommitdiff
path: root/sql/sql_connect.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-05-14 13:22:47 +0200
committerSergei Golubchik <serg@mariadb.org>2016-06-04 09:06:00 +0200
commit562c1df7d97cb23145e09b3482fd18d49476752d (patch)
tree0d8e3d45c78dafd5854e8c6d6488b232f3f631a7 /sql/sql_connect.cc
parent7425610c81ca1329d72a97f57770e5b052d08079 (diff)
downloadmariadb-git-562c1df7d97cb23145e09b3482fd18d49476752d.tar.gz
cleanup: thread_count
move thread_count handling into THD: * increment thread_count in THD constructor * decrement thread_count in THD destructor * never modify thread_count directly!
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();
}