summaryrefslogtreecommitdiff
path: root/sql/log.cc
diff options
context:
space:
mode:
authorguilhem@mysql.com <>2003-08-25 14:13:58 +0200
committerguilhem@mysql.com <>2003-08-25 14:13:58 +0200
commit6c9cff9534dbf183666a04ca598be726a8da5b73 (patch)
tree5eaeaf155432b25ed8d2cf1b156f9df1e00d0ddd /sql/log.cc
parentcc918272edb3e3d2cfb199ccdff54fc3710b63a1 (diff)
downloadmariadb-git-6c9cff9534dbf183666a04ca598be726a8da5b73.tar.gz
Clearer states in SHOW PROCESSLIST for replication threads.
For example the Binlog_dump thread (on the master) sometimes showed "Slave:". And there were confusing messages where "binlog" was employed instead of "relay log".
Diffstat (limited to 'sql/log.cc')
-rw-r--r--sql/log.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/sql/log.cc b/sql/log.cc
index 6e9fa38c407..ce06092cfb7 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -1526,6 +1526,9 @@ bool MYSQL_LOG::write(THD *thd,const char *query, uint query_length,
SYNOPSIS
wait_for_update()
thd Thread variable
+ master_or_slave If 0, the caller is the Binlog_dump thread from master;
+ if 1, the caller is the SQL thread from the slave. This
+ influences only thd->proc_info.
NOTES
One must have a lock on LOCK_log before calling this function.
@@ -1538,11 +1541,15 @@ bool MYSQL_LOG::write(THD *thd,const char *query, uint query_length,
*/
-void MYSQL_LOG:: wait_for_update(THD* thd)
+void MYSQL_LOG:: wait_for_update(THD* thd, bool master_or_slave)
{
safe_mutex_assert_owner(&LOCK_log);
const char* old_msg = thd->enter_cond(&update_cond, &LOCK_log,
- "Slave: waiting for binlog update");
+ master_or_slave ?
+ "Has read all relay log; waiting for \
+the I/O slave thread to update it" :
+ "Has sent all binlog to slave; \
+waiting for binlog to be updated");
pthread_cond_wait(&update_cond, &LOCK_log);
pthread_mutex_unlock(&LOCK_log); // See NOTES
thd->exit_cond(old_msg);