List:Internals« Previous MessageNext Message »
From:gluh Date:June 17 2004 3:16pm
Subject:bk commit into 4.0 tree (gluh:1.1867)
View as plain text  
Below is the list of changes that have just been committed into a local
4.0 repository of gluh. When gluh does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://www.mysql.com/doc/I/n/Installing_source_tree.html

ChangeSet
  1.1867 04/06/17 19:16:42 gluh@stripped +1 -0
  Fix for bug #3950: Check/Repair caused by "Field List" doesn't show table name in processlist(2nd version)

  sql/ha_myisam.cc
    1.131 04/06/17 19:16:40 gluh@stripped +26 -9
    Fix for bug #3950: Check/Repair caused by "Field List" doesn't show table name in processlist(2nd version)

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	gluh
# Host:	gluh.mysql.r18.ru
# Root:	/home/gluh/MySQL-BUGS/mysql-4.0

--- 1.130/sql/ha_myisam.cc	Wed Mar 10 12:50:14 2004
+++ 1.131/sql/ha_myisam.cc	Thu Jun 17 19:16:40 2004
@@ -767,16 +767,33 @@
   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= 0;
+    bool thd_query_changed= 0;
+   /* For 'SHOW PROCESSLIST', it shows table name in field 'info'*/
+    if ((thd_query_changed= !thd->query_length))
+    {
+      old_query= thd->query;
+      thd->query= table->real_name;
+      thd->query_length= strlen(table->real_name);
+    }
+    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;
+    }
+    if (thd_query_changed)
+    {
+      thd->query= old_query;
+      thd->query_length= 0;
+    }
   }
   DBUG_RETURN(error);
 }
Thread
bk commit into 4.0 tree (gluh:1.1867)gluh17 Jun