summaryrefslogtreecommitdiff
path: root/sql/mysqld.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-10-30 13:02:59 +0100
committerSergei Golubchik <serg@mariadb.org>2018-10-30 15:10:01 +0100
commit44f6f445933e12cbc4cce63e2b7d983b9938d3b9 (patch)
treef5230fb24510bb201eb33122a62939ce74588b83 /sql/mysqld.cc
parent8772824ce72a811ea92dd5cfb73602eb93237891 (diff)
parentf4b8b6b9a3ad4ce5e5218e2ec2dfe6dd34112e45 (diff)
downloadmariadb-git-44f6f445933e12cbc4cce63e2b7d983b9938d3b9.tar.gz
Merge branch '10.0' into 10.1
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;