summaryrefslogtreecommitdiff
path: root/sql/mysqld.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/mysqld.cc')
-rw-r--r--sql/mysqld.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index c2fdb5a4026..5452f7164e6 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -1725,7 +1725,14 @@ static void close_connections(void)
tmp->thread_id,
(tmp->main_security_ctx.user ?
tmp->main_security_ctx.user : ""));
+ /*
+ close_connection() might need a valid current_thd
+ for memory allocation tracking.
+ */
+ THD* save_thd= current_thd;
+ set_current_thd(tmp);
close_connection(tmp,ER_SERVER_SHUTDOWN);
+ set_current_thd(save_thd);
}
#endif
#ifdef WITH_WSREP
@@ -4299,6 +4306,11 @@ static int init_common_variables()
/* MyISAM requires two file handles per table. */
wanted_files= (extra_files + max_connections + extra_max_connections +
tc_size * 2);
+#if defined(HAVE_POOL_OF_THREADS) && !defined(__WIN__)
+ // add epoll or kevent fd for each threadpool group, in case pool of threads is used
+ wanted_files+= (thread_handling > SCHEDULER_NO_THREADS) ? 0 : threadpool_size;
+#endif
+
min_tc_size= MY_MIN(tc_size, TABLE_OPEN_CACHE_MIN);
org_max_connections= max_connections;
org_tc_size= tc_size;