diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-11-06 08:41:48 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-11-06 08:41:48 +0200 |
commit | 32062cc61cd00e4cd3b7939c8a09f9c3ac34ec76 (patch) | |
tree | 098d64b7c988bab8cca25b0f716d92f6f7e72ed9 /sql/mysqld.cc | |
parent | af9649c722810eb1754953eb406a84ec876ce693 (diff) | |
parent | bae21bfb5de17328c33c3da8d191c6d3af14ae02 (diff) | |
download | mariadb-git-32062cc61cd00e4cd3b7939c8a09f9c3ac34ec76.tar.gz |
Merge 10.1 into 10.2
Diffstat (limited to 'sql/mysqld.cc')
-rw-r--r-- | sql/mysqld.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc index a79cf7eecde..77736607e22 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1785,7 +1785,14 @@ static void close_connections(void) (ulong) 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 @@ -4402,6 +4409,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; |