summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/thread_pool_priv.h2
-rw-r--r--sql/scheduler.cc7
-rw-r--r--sql/scheduler.h1
-rw-r--r--sql/sql_connect.cc11
-rw-r--r--sql/threadpool_common.cc6
-rw-r--r--sql/wsrep_mysqld.cc7
6 files changed, 9 insertions, 25 deletions
diff --git a/include/thread_pool_priv.h b/include/thread_pool_priv.h
index 7eb2800555a..05dff8eedef 100644
--- a/include/thread_pool_priv.h
+++ b/include/thread_pool_priv.h
@@ -82,8 +82,6 @@ bool do_command(THD *thd);
ensure that the proper MySQL Server logic attached to these events is
executed.
*/
-/* Initialise a new connection handler thread */
-bool init_new_connection_handler_thread();
/* Set up connection thread before use as execution thread */
bool setup_connection_thread_globals(THD *thd);
/* Prepare connection as part of connection set-up */
diff --git a/sql/scheduler.cc b/sql/scheduler.cc
index 818bb3818f4..59d7c548871 100644
--- a/sql/scheduler.cc
+++ b/sql/scheduler.cc
@@ -24,7 +24,6 @@
#include "mariadb.h"
#include "mysqld.h"
-#include "sql_connect.h" // init_new_connection_handler_thread
#include "scheduler.h"
#include "sql_class.h"
#include "sql_callback.h"
@@ -133,16 +132,11 @@ void one_thread_per_connection_scheduler(scheduler_functions *func,
func->max_threads= *arg_max_connections + 1;
func->max_connections= arg_max_connections;
func->connection_count= arg_connection_count;
- func->init_new_connection_thread= init_new_connection_handler_thread;
func->add_connection= create_thread_to_handle_connection;
func->end_thread= one_thread_per_connection_end;
func->post_kill_notification= post_kill_notification;
}
#else
-bool init_new_connection_handler_thread()
-{
- return 0;
-}
void handle_connection_in_main_thread(CONNECT *connect)
{
}
@@ -158,7 +152,6 @@ void one_thread_scheduler(scheduler_functions *func)
func->max_threads= 1;
func->max_connections= &max_connections;
func->connection_count= &connection_count;
- func->init_new_connection_thread= init_new_connection_handler_thread;
func->add_connection= handle_connection_in_main_thread;
func->end_thread= no_threads_end;
}
diff --git a/sql/scheduler.h b/sql/scheduler.h
index b067763d9b4..12d54f74c4e 100644
--- a/sql/scheduler.h
+++ b/sql/scheduler.h
@@ -34,7 +34,6 @@ struct scheduler_functions
uint max_threads, *connection_count;
ulong *max_connections;
bool (*init)(void);
- bool (*init_new_connection_thread)(void);
void (*add_connection)(CONNECT *connect);
void (*thd_wait_begin)(THD *thd, int wait_type);
void (*thd_wait_end)(THD *thd);
diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc
index 25a260b2eba..3646aee0f03 100644
--- a/sql/sql_connect.cc
+++ b/sql/sql_connect.cc
@@ -1303,6 +1303,14 @@ pthread_handler_t handle_one_connection(void *arg)
mysql_thread_set_psi_id(connect->thread_id);
+ if (init_new_connection_handler_thread())
+ {
+ scheduler_functions *scheduler= connect->scheduler;
+ connect->close_with_error(0, 0, ER_OUT_OF_RESOURCES);
+ scheduler->end_thread(0, 0);
+ return 0;
+ }
+
do_handle_one_connection(connect);
return 0;
}
@@ -1340,8 +1348,7 @@ void do_handle_one_connection(CONNECT *connect)
{
ulonglong thr_create_utime= microsecond_interval_timer();
THD *thd;
- if (connect->scheduler->init_new_connection_thread() ||
- !(thd= connect->create_thd(NULL)))
+ if (!(thd= connect->create_thd(NULL)))
{
scheduler_functions *scheduler= connect->scheduler;
connect->close_with_error(0, 0, ER_OUT_OF_RESOURCES);
diff --git a/sql/threadpool_common.cc b/sql/threadpool_common.cc
index 695623cd4ea..042814a8321 100644
--- a/sql/threadpool_common.cc
+++ b/sql/threadpool_common.cc
@@ -383,11 +383,6 @@ end:
/* Dummy functions, do nothing */
-static bool tp_init_new_connection_thread()
-{
- return 0;
-}
-
static bool tp_end_thread(THD *, bool)
{
return 0;
@@ -512,7 +507,6 @@ static scheduler_functions tp_scheduler_functions=
NULL,
NULL,
tp_init, // init
- tp_init_new_connection_thread, // init_new_connection_thread
tp_add_connection, // add_connection
tp_wait_begin, // thd_wait_begin
tp_wait_end, // thd_wait_end
diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc
index dba793aba55..a278820efb6 100644
--- a/sql/wsrep_mysqld.cc
+++ b/sql/wsrep_mysqld.cc
@@ -2619,13 +2619,6 @@ void* start_wsrep_THD(void *arg)
mysql_thread_set_psi_id(thd->thread_id);
thd->thr_create_utime= microsecond_interval_timer();
- if (MYSQL_CALLBACK_ELSE(thread_scheduler, init_new_connection_thread, (), 0))
- {
- close_connection(thd, ER_OUT_OF_RESOURCES);
- statistic_increment(aborted_connects,&LOCK_status);
- MYSQL_CALLBACK(thread_scheduler, end_thread, (thd, 0));
- goto error;
- }
// </5.1.17>
/*