MySQL Lists are EOL. Please join:

List:Internals« Previous MessageNext Message »
From:ingo Date:October 26 2005 12:02pm
Subject:bk commit into 5.0 tree (ingo:1.2048) BUG#12166
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of mydev. When mydev 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://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2048 05/10/26 14:01:54 ingo@stripped +2 -0
  1.2048 05/10/20 10:31:16 ingo@stripped +1 -0
  Bug#12166 - Unable to index very large tables
  Moved clearing of errors behind the second repair attempt,
  but will clear only if no error happened.
  
  No test case. The error can be repeated with little free
  space on tmpdir only. I do not know of a way to create this
  in a portable way with our test suite.
  
  I did however attach a shell script to the bug report which
  can easily be adapted to the situation on the test machine.

  sql/ha_myisam.cc
    1.163 05/10/26 14:01:47 ingo@stripped +8 -3
    Bug#12166 - Unable to index very large tables
    Moved clearing of errors behind the second repair attempt,
    but will clear only if no error happened.

  myisam/mi_check.c
    1.138 05/10/26 14:01:47 ingo@stripped +12 -7
    Bug#12166 - Unable to index very large tables
    Changed comments.
    Removed unnecessary use of param->keys_in_use.

# 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:	ingo
# Host:	chilla.local
# Root:	/home/mydev/mysql-5.0-bug12166

--- 1.137/myisam/mi_check.c	2005-10-15 12:23:57 +02:00
+++ 1.138/myisam/mi_check.c	2005-10-26 14:01:47 +02:00
@@ -1294,25 +1294,30 @@
     param->calc_checksum=1;
 
   info->update= (short) (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED);
+
+  /*
+    Clear all keys. Note that all key blocks allocated until now remain
+    "dead" parts of the key file. (Bug #4692)
+  */
   for (i=0 ; i < info->s->base.keys ; i++)
     share->state.key_root[i]= HA_OFFSET_ERROR;
+
+  /* Drop the delete chain. */
   for (i=0 ; i < share->state.header.max_block_size ; i++)
     share->state.key_del[i]=  HA_OFFSET_ERROR;
 
   /*
-    I think mi_repair and mi_repair_by_sort should do the same
-    (according, e.g. to ha_myisam::repair), but as mi_repair doesn't
-    touch key_map it cannot be used to T_CREATE_MISSING_KEYS.
-    That is what the next line is for
+    If requested, activate (enable) all keys in key_map. In this case,
+    all indexes will be (re-)built.
   */
-
   if (param->testflag & T_CREATE_MISSING_KEYS)
-    mi_copy_keys_active(share->state.key_map, share->base.keys,
-                        param->keys_in_use);
+    mi_set_all_keys_active(share->state.key_map, share->base.keys);
 
   info->state->key_file_length=share->base.keystart;
 
   lock_memory(param);			/* Everything is alloced */
+
+  /* Re-create all keys, which are set in key_map. */
   while (!(error=sort_get_next_record(&sort_param)))
   {
     if (writekeys(param,info,(byte*)sort_param.record,sort_param.filepos))

--- 1.162/sql/ha_myisam.cc	2005-10-03 05:03:42 +02:00
+++ 1.163/sql/ha_myisam.cc	2005-10-26 14:01:47 +02:00
@@ -985,11 +985,16 @@
     {
       sql_print_warning("Warning: Enabling keys got errno %d, retrying",
                         my_errno);
-      thd->clear_error();
+      /* Repairing by sort failed. Now try standard repair method. */
       param.testflag&= ~(T_REP_BY_SORT | T_QUICK);
       error= (repair(thd,param,0) != HA_ADMIN_OK);
-      if (!error && thd->net.report_error)
-        error= HA_ERR_CRASHED;
+      /*
+        If the standard repair succeeded, clear all error messages which
+        might have been set by the first repair. They can still be seen
+        with SHOW WARNINGS then.
+      */
+      if (! error)
+        thd->clear_error();
     }
     info(HA_STATUS_CONST);
     thd->proc_info=save_proc_info;
Thread
bk commit into 5.0 tree (ingo:1.2048) BUG#12166ingo26 Oct