summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <gluh@gluh.mysql.r18.ru>2004-06-23 18:13:25 +0400
committerunknown <gluh@gluh.mysql.r18.ru>2004-06-23 18:13:25 +0400
commit85e9258b05b2490e35aa60adecf48a3f65245eb0 (patch)
treedb59a111dc3c38013871d0247c06cb09bfe0164c /sql
parent540121e1f9f16e32f80dce3a536c6b6d67486681 (diff)
downloadmariadb-git-85e9258b05b2490e35aa60adecf48a3f65245eb0.tar.gz
Fix for bug#3950: Check/Repair caused by "Field List" doesn't show table name in processlist
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_myisam.cc31
1 files changed, 22 insertions, 9 deletions
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc
index 318e0fbb507..625a00d3558 100644
--- a/sql/ha_myisam.cc
+++ b/sql/ha_myisam.cc
@@ -1013,16 +1013,29 @@ bool ha_myisam::check_and_repair(THD *thd)
if (!file->state->del && (myisam_recover_options & HA_RECOVER_QUICK))
check_opt.flags|=T_QUICK;
sql_print_error("Warning: Checking table: '%s'",table->path);
- if ((marked_crashed=mi_is_crashed(file)) || check(thd, &check_opt))
+ if ((marked_crashed=mi_is_crashed(file)))
{
- sql_print_error("Warning: Recovering table: '%s'",table->path);
- check_opt.flags=
- ((myisam_recover_options & HA_RECOVER_BACKUP ? T_BACKUP_DATA : 0) |
- (marked_crashed ? 0 : T_QUICK) |
- (myisam_recover_options & HA_RECOVER_FORCE ? 0 : T_SAFE_REPAIR) |
- T_AUTO_REPAIR);
- if (repair(thd, &check_opt))
- error=1;
+ char *old_query= thd->query;
+ uint old_query_length= thd->query_length;
+ pthread_mutex_lock(&LOCK_thread_count);
+ thd->query= table->real_name;
+ thd->query_length= strlen(table->real_name);
+ pthread_mutex_unlock(&LOCK_thread_count);
+ if (check(thd, &check_opt))
+ {
+ sql_print_error("Warning: Recovering table: '%s'",table->path);
+ check_opt.flags=
+ ((myisam_recover_options & HA_RECOVER_BACKUP ? T_BACKUP_DATA : 0) |
+ (marked_crashed ? 0 : T_QUICK) |
+ (myisam_recover_options & HA_RECOVER_FORCE ? 0 : T_SAFE_REPAIR) |
+ T_AUTO_REPAIR);
+ if (repair(thd, &check_opt))
+ error=1;
+ }
+ pthread_mutex_lock(&LOCK_thread_count);
+ thd->query= old_query;
+ thd->query_length= old_query_length;
+ pthread_mutex_unlock(&LOCK_thread_count);
}
DBUG_RETURN(error);
}