diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-11-06 16:24:16 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-11-06 16:24:16 +0200 |
commit | 074c68409921032f8a64416cc4d5ebc35d95dca9 (patch) | |
tree | 615c99d326fd2ce8c0e3b533b40f0e4e3475bbc1 /sql/mysqld.cc | |
parent | 563efeceece09154f71da6303244b1df36875428 (diff) | |
parent | df563e0c037f9b2cdb22e145575f92a121b4b529 (diff) | |
download | mariadb-git-074c68409921032f8a64416cc4d5ebc35d95dca9.tar.gz |
Merge 10.3 into 10.4
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 80172d6a070..9ff47dc1ff1 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1734,7 +1734,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 @@ -4312,6 +4319,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; |