From 32be7dffbe7c9bf5c65210e2775e6e2d3d6d411e Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Sun, 18 Jan 2015 13:39:59 +0200 Subject: Return to original stage after mysql_lock_tables Stage "Filling schema table" is now properly shown in 'show processlist' mysys/mf_keycache.c: Simple cleanup with more comments sql/lock.cc: Return to original stage after mysql_lock_tables Made 'Table lock' as a true stage sql/sql_show.cc: Restore original stage after get_schema_tables_result --- sql/lock.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'sql/lock.cc') diff --git a/sql/lock.cc b/sql/lock.cc index fbed8d8331c..e713990bd58 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -301,15 +301,16 @@ bool mysql_lock_tables(THD *thd, MYSQL_LOCK *sql_lock, uint flags) int rc= 1; ulong timeout= (flags & MYSQL_LOCK_IGNORE_TIMEOUT) ? LONG_TIMEOUT : thd->variables.lock_wait_timeout; - + PSI_stage_info org_stage; DBUG_ENTER("mysql_lock_tables(sql_lock)"); - THD_STAGE_INFO(thd, stage_system_lock); + thd->enter_stage(&stage_system_lock, &org_stage, __func__, __FILE__, + __LINE__); if (sql_lock->table_count && lock_external(thd, sql_lock->table, sql_lock->table_count)) goto end; - thd_proc_info(thd, "Table lock"); + THD_STAGE_INFO(thd, stage_table_lock); /* Copy the lock data array. thr_multi_lock() reorders its contents. */ memmove(sql_lock->locks + sql_lock->lock_count, sql_lock->locks, @@ -323,7 +324,7 @@ bool mysql_lock_tables(THD *thd, MYSQL_LOCK *sql_lock, uint flags) (void) unlock_external(thd, sql_lock->table, sql_lock->table_count); end: - THD_STAGE_INFO(thd, stage_after_table_lock); + THD_STAGE_INFO(thd, org_stage); if (thd->killed) { -- cgit v1.2.1