diff options
Diffstat (limited to 'sql/slave.cc')
-rw-r--r-- | sql/slave.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sql/slave.cc b/sql/slave.cc index 30a0018f490..3fd4b2a19c3 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -292,9 +292,8 @@ handle_slave_init(void *arg __attribute__((unused))) THD *thd; my_thread_init(); - thd= new THD; + thd= new THD(next_thread_id()); thd->thread_stack= (char*) &thd; /* Set approximate stack start */ - thd->thread_id= next_thread_id(); thd->system_thread = SYSTEM_THREAD_SLAVE_INIT; thread_safe_increment32(&service_thread_count); thd->store_globals(); @@ -3071,7 +3070,6 @@ static int init_slave_thread(THD* thd, Master_info *mi, thd->variables.log_slow_filter= global_system_variables.log_slow_filter; set_slave_thread_options(thd); thd->client_capabilities = CLIENT_LOCAL_FILES; - thd->thread_id= thd->variables.pseudo_thread_id= next_thread_id(); if (thd_type == SLAVE_THD_SQL) THD_STAGE_INFO(thd, stage_waiting_for_the_next_event_in_relay_log); @@ -3940,7 +3938,7 @@ pthread_handler_t handle_slave_io(void *arg) mysql= NULL ; retry_count= 0; - thd= new THD; // note that contructor of THD uses DBUG_ ! + thd= new THD(next_thread_id()); // note that contructor of THD uses DBUG_ ! mysql_mutex_lock(&mi->run_lock); /* Inform waiting threads that slave has started */ @@ -4512,7 +4510,7 @@ pthread_handler_t handle_slave_sql(void *arg) #endif serial_rgi= new rpl_group_info(rli); - thd = new THD; // note that contructor of THD uses DBUG_ ! + thd = new THD(next_thread_id()); // note that contructor of THD uses DBUG_ ! thd->thread_stack = (char*)&thd; // remember where our stack is thd->system_thread_info.rpl_sql_info= &sql_info; |