Skip to content

Commit f00d765

Browse files
committed
MDEV-7806 - thread_pool_size is not auto-sized
thread_pool_size is auto-sized before my_getopt(). But my_getopt starts from resetting all options to their default values. So the auto-sized value is lost. Fixed by moving thread_pool_size auto-sizing after my_getopt().
1 parent 370a2cb commit f00d765

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

sql/mysqld.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4111,10 +4111,6 @@ static int init_common_variables()
41114111
return 1;
41124112
}
41134113

4114-
#if defined(HAVE_POOL_OF_THREADS) && !defined(_WIN32)
4115-
SYSVAR_AUTOSIZE(threadpool_size, my_getncpus());
4116-
#endif
4117-
41184114
if (init_thread_environment() ||
41194115
mysql_init_variables())
41204116
return 1;
@@ -4344,6 +4340,11 @@ static int init_common_variables()
43444340
#endif /* HAVE_SOLARIS_LARGE_PAGES */
43454341

43464342

4343+
#if defined(HAVE_POOL_OF_THREADS) && !defined(_WIN32)
4344+
if (IS_SYSVAR_AUTOSIZE(&threadpool_size))
4345+
SYSVAR_AUTOSIZE(threadpool_size, my_getncpus());
4346+
#endif
4347+
43474348
/* Fix host_cache_size. */
43484349
if (IS_SYSVAR_AUTOSIZE(&host_cache_size))
43494350
{

0 commit comments

Comments
 (0)