summaryrefslogtreecommitdiff
path: root/sql/slave.cc
diff options
context:
space:
mode:
authorGleb Shchepa <gshchepa@mysql.com>2009-07-24 21:04:55 +0500
committerGleb Shchepa <gshchepa@mysql.com>2009-07-24 21:04:55 +0500
commit2bc6b6a80099ddb5b57e3d3c8be120e6596daa08 (patch)
tree999d090b1f7c4cb9c23b5e41592e0cec56389c5f /sql/slave.cc
parentc24cccabdda8fad2117e3dea39e4de3c7feb3157 (diff)
parentdc0a87fdc24ed0859856d243ad68a0c1913db3af (diff)
downloadmariadb-git-2bc6b6a80099ddb5b57e3d3c8be120e6596daa08.tar.gz
Merge from 5.0
****** manual merge 5.0-bugteam --> 5.1-bugteam (bug 38816)
Diffstat (limited to 'sql/slave.cc')
-rw-r--r--sql/slave.cc21
1 files changed, 8 insertions, 13 deletions
diff --git a/sql/slave.cc b/sql/slave.cc
index 83a4d8c73d1..3b64e23ece5 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -512,7 +512,7 @@ terminate_slave_thread(THD *thd,
int error;
DBUG_PRINT("loop", ("killing slave thread"));
- pthread_mutex_lock(&thd->LOCK_delete);
+ pthread_mutex_lock(&thd->LOCK_thd_data);
#ifndef DONT_USE_THR_ALARM
/*
Error codes from pthread_kill are:
@@ -523,7 +523,7 @@ terminate_slave_thread(THD *thd,
DBUG_ASSERT(err != EINVAL);
#endif
thd->awake(THD::NOT_KILLED);
- pthread_mutex_unlock(&thd->LOCK_delete);
+ pthread_mutex_unlock(&thd->LOCK_thd_data);
/*
There is a small chance that slave thread might miss the first
@@ -1250,15 +1250,13 @@ static int create_table_from_dump(THD* thd, MYSQL *mysql, const char* db,
DBUG_RETURN(1);
}
thd->command = COM_TABLE_DUMP;
- thd->query_length= packet_len;
- /* Note that we should not set thd->query until the area is initalized */
if (!(query = thd->strmake((char*) net->read_pos, packet_len)))
{
sql_print_error("create_table_from_dump: out of memory");
my_message(ER_GET_ERRNO, "Out of memory", MYF(0));
DBUG_RETURN(1);
}
- thd->query= query;
+ thd->set_query(query, packet_len);
thd->is_slave_error = 0;
bzero((char*) &tables,sizeof(tables));
@@ -2755,10 +2753,8 @@ err:
// print the current replication position
sql_print_information("Slave I/O thread exiting, read up to log '%s', position %s",
IO_RPL_LOG_NAME, llstr(mi->master_log_pos,llbuff));
- VOID(pthread_mutex_lock(&LOCK_thread_count));
- thd->query = thd->db = 0; // extra safety
- thd->query_length= thd->db_length= 0;
- VOID(pthread_mutex_unlock(&LOCK_thread_count));
+ thd->set_query(NULL, 0);
+ thd->reset_db(NULL, 0);
if (mysql)
{
/*
@@ -3110,15 +3106,14 @@ the slave SQL thread with \"SLAVE START\". We stopped at log \
must "proactively" clear playgrounds:
*/
rli->cleanup_context(thd, 1);
- VOID(pthread_mutex_lock(&LOCK_thread_count));
/*
Some extra safety, which should not been needed (normally, event deletion
should already have done these assignments (each event which sets these
variables is supposed to set them to 0 before terminating)).
*/
- thd->query= thd->db= thd->catalog= 0;
- thd->query_length= thd->db_length= 0;
- VOID(pthread_mutex_unlock(&LOCK_thread_count));
+ thd->catalog= 0;
+ thd->set_query(NULL, 0);
+ thd->reset_db(NULL, 0);
thd_proc_info(thd, "Waiting for slave mutex on exit");
pthread_mutex_lock(&rli->run_lock);
/* We need data_lock, at least to wake up any waiting master_pos_wait() */