List:Commits« Previous MessageNext Message »
From:Patrick Galbraith Date:January 19 2006 6:44am
Subject:bk commit into 5.1 tree (patg:1.2075)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of patg. When patg 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.2075 06/01/18 22:44:31 patg@stripped +2 -0
  WL# 2986
  
   Only use needed partitions in partition handler
  
  This WL is about using this bitmap in all parts of the partition handler.
  Thus for:
  rnd_init/rnd_next
  index_init/index_next and all other variants of index scans
  read_range_... the various range scans implemented in the partition handler.
  
  Also use those bitmaps in the various other calls that currently loop over all
  partitions.

  sql/ha_partition.h
    1.10 06/01/18 22:44:27 patg@stripped +1 -0
    WL# 2986
    
    Added current_partition_index

  sql/ha_partition.cc
    1.24 06/01/18 22:44:27 patg@stripped +217 -144
    WL# 2986
    
    Used work from 2682 and removed the partition select code.

# 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:	patg
# Host:	govinda.patg.net
# Root:	/home/patg/mysql-build/mysql-5.1-wl2986

--- 1.23/sql/ha_partition.cc	2006-01-18 07:25:48 -08:00
+++ 1.24/sql/ha_partition.cc	2006-01-18 22:44:27 -08:00
@@ -239,6 +239,7 @@
   m_top_entry= NO_CURRENT_PART_ID;
   m_rec_length= 0;
   m_last_part= 0;
+  current_partition_index= MY_BIT_NONE;
   m_rec0= 0;
   m_curr_key_info= 0;
   /*
@@ -611,7 +612,6 @@
   DBUG_ENTER("ha_partition::create");
 
   strmov(t_name, name);
-//  *fn_ext(t_name)= 0;
   DBUG_ASSERT(*fn_rext((char*)name) == '\0');
   if (del_ren_cre_table(t_name, NULL, table_arg, create_info))
   {
@@ -2054,6 +2054,7 @@
     Don't know the size of the underlying storage engine, invent a number of
     bytes allocated for error message if allocation fails
   */
+  alloc_len= 128;
   do
   {
     part_elem= part_it++;
@@ -2144,7 +2145,7 @@
   if (!(engine_array= (handlerton **) my_malloc(m_tot_parts * sizeof(handlerton*),MYF(0))))
     goto err2;
   for (i= 0; i < m_tot_parts; i++)
-    engine_array[i]= ha_resolve_by_legacy_type(current_thd, 
+    engine_array[i]= ha_resolve_by_legacy_type(current_thd,
                 (enum legacy_db_type) *(uchar *) ((file_buffer) + 12 + i));
   address_tot_name_len= file_buffer + 12 + 4 * tot_partition_words;
   tot_name_words= (uint4korr(address_tot_name_len) + 3) / 4;
@@ -2198,11 +2199,11 @@
 
 int ha_partition::open(const char *name, int mode, uint test_if_locked)
 {
-  int error;
   char name_buff[FN_REFLEN];
   char *name_buffer_ptr= m_name_buffer_ptr;
+  int error;
+  uint alloc_len,i, j, part_num_counter= 0;
   handler **file;
-  uint alloc_len;
   DBUG_ENTER("ha_partition::open");
 
   ref_length= 0;
@@ -2214,7 +2215,7 @@
   m_start_key.length= 0;
   m_rec0= table->record[0];
   m_rec_length= table->s->reclength;
-  alloc_len= m_tot_parts * (m_rec_length + PARTITION_BYTES_IN_POS); 
+  alloc_len= m_tot_parts * (m_rec_length + PARTITION_BYTES_IN_POS);
   alloc_len+= table->s->max_key_length;
   if (!m_ordered_rec_buffer)
   {
@@ -2240,6 +2241,11 @@
       m_start_key.key= (const byte*)ptr;
     }
   }
+
+  /* Initialze the bitmap we use to determine what partitions are used */
+  bitmap_init(&(m_part_info->used_partitions), NULL, m_tot_parts, TRUE);
+  bitmap_set_all(&(m_part_info->used_partitions));
+
   file= m_file;
   do
   {
@@ -2252,6 +2258,7 @@
     name_buffer_ptr+= strlen(name_buffer_ptr) + 1;
     set_if_bigger(ref_length, ((*file)->ref_length));
   } while (*(++file));
+
   /*
     Add 2 bytes for partition id in position ref length.
     ref_length=max_in_all_partitions(ref_length) + PARTITION_BYTES_IN_POS
@@ -2269,6 +2276,9 @@
   if ((error= init_queue(&m_queue, m_tot_parts, (uint) PARTITION_BYTES_IN_POS,
                          0, key_rec_cmp, (void*)this)))
     goto err_handler;
+
+
+
   /*
     Some handlers update statistics as part of the open call. This will in
     some cases corrupt the statistics of the partition handler and thus
@@ -2305,11 +2315,13 @@
 
 int ha_partition::close(void)
 {
-  handler **file;
   bool first= TRUE;
+  int i;
+  handler **file;
   DBUG_ENTER("ha_partition::close");
 
   delete_queue(&m_queue);
+  bitmap_free(&(m_part_info->used_partitions));
   file= m_file;
 
 repeat:
@@ -2317,16 +2329,17 @@
   {
     (*file)->close();
   } while (*(++file));
+
   if (first && m_added_file && m_added_file[0])
   {
     file= m_added_file;
     first= FALSE;
     goto repeat;
   }
+
   DBUG_RETURN(0);
 }
 
-
 /****************************************************************************
                 MODULE start/end statement
 ****************************************************************************/
@@ -2369,9 +2382,9 @@
 
 int ha_partition::external_lock(THD *thd, int lock_type)
 {
+  bool first= TRUE;
   uint error;
   handler **file;
-  bool first= TRUE;
   DBUG_ENTER("ha_partition::external_lock");
 
   file= m_file;
@@ -2380,12 +2393,16 @@
 repeat:
   do
   {
-    if ((error= (*file)->external_lock(thd, lock_type)))
+    if (_bitmap_is_set(&(m_part_info->used_partitions), (file - m_file)))
     {
-      if (lock_type != F_UNLCK)
-	goto err_handler;
+      if ((error= (*file)->external_lock(thd, lock_type)))
+      {
+        if (F_UNLCK != lock_type)
+          goto err_handler;
+      }
     }
   } while (*(++file));
+
   if (first && m_added_file && m_added_file[0])
   {
     DBUG_ASSERT(lock_type == F_UNLCK);
@@ -2397,7 +2414,12 @@
 
 err_handler:
   while (file-- != m_file)
-    (*file)->external_lock(thd, F_UNLCK);
+  {
+    if (_bitmap_is_set(&(m_part_info->used_partitions), (file - m_file)))
+    {
+      (*file)->external_lock(thd, F_UNLCK);
+    }
+  }
   DBUG_RETURN(error);
 }
 
@@ -2454,7 +2476,6 @@
 {
   handler **file;
   DBUG_ENTER("ha_partition::store_lock");
-
   file= m_file;
   do
   {
@@ -2482,6 +2503,7 @@
 
 int ha_partition::start_stmt(THD *thd, thr_lock_type lock_type)
 {
+  int i= 0;
   int error= 0;
   handler **file;
   DBUG_ENTER("ha_partition::start_stmt");
@@ -2489,8 +2511,11 @@
   file= m_file;
   do
   {
-    if ((error= (*file)->start_stmt(thd, lock_type)))
-      break;
+    if (_bitmap_is_set(&(m_part_info->used_partitions), (file - m_file)))
+    {
+      if ((error= (*file)->start_stmt(thd, lock_type)))
+        break;
+    }
   } while (*(++file));
   DBUG_RETURN(error);
 }
@@ -2514,8 +2539,9 @@
 
 uint ha_partition::lock_count() const
 {
+  handler **file= m_file;
   DBUG_ENTER("ha_partition::lock_count");
-
+  DBUG_PRINT("info", ("m_no_locks %d", m_no_locks));
   DBUG_RETURN(m_no_locks);
 }
 
@@ -2772,8 +2798,9 @@
   file= m_file;
   do
   {
-    if ((error= (*file)->delete_all_rows()))
-      DBUG_RETURN(error);
+    if (_bitmap_is_set(&(m_part_info->used_partitions), (file - m_file)))
+      if ((error= (*file)->delete_all_rows()))
+        DBUG_RETURN(error);
   } while (*(++file));
   DBUG_RETURN(0);
 }
@@ -2807,7 +2834,8 @@
   file= m_file;
   do
   {
-    (*file)->start_bulk_insert(rows);
+    if (_bitmap_is_set(&(m_part_info->used_partitions),(file - m_file)))
+      (*file)->start_bulk_insert(rows);
   } while (*(++file));
   DBUG_VOID_RETURN;
 }
@@ -2834,9 +2862,9 @@
   do
   {
     int tmp;
-    /* We want to execute end_bulk_insert() on all handlers */
-    if ((tmp= (*file)->end_bulk_insert()))
-      error= tmp;
+    if (_bitmap_is_set(&(m_part_info->used_partitions), (file - m_file)))
+      if ((tmp= (*file)->end_bulk_insert()))
+        error= tmp;
   } while (*(++file));
   DBUG_RETURN(error);
 }
@@ -2874,50 +2902,64 @@
 int ha_partition::rnd_init(bool scan)
 {
   int error;
+  uint i= 0;
   handler **file;
   DBUG_ENTER("ha_partition::rnd_init");
 
   include_partition_fields_in_used_fields();
+  
+  /*
+    we are going to be scanning through rnd_next so we should eliminate as many
+    of the partitions as possible.
+  */
   if (scan)
   {
     /*
       rnd_end() is needed for partitioning to reset internal data if scan
       is already in use
     */
-
     rnd_end();
-    if (partition_scan_set_up(rec_buf(0), FALSE))
-    {
-      /*
-        The set of partitions to scan is empty. We return success and return
-        end of file on first rnd_next.
-      */
-      DBUG_RETURN(0);
-    }
+    partition_scan_set_up(rec_buf(0), FALSE);
+  }
+
+  /* now we see what the index of our first important partition is */
+  DBUG_PRINT("info", ("m_part_info->used_partitions %lx", m_part_info->used_partitions.bitmap));
+  current_partition_index = bitmap_get_first_set(&(m_part_info->used_partitions));
+  DBUG_PRINT("info", ("current_partition_index %d", current_partition_index));
+  if (MY_BIT_NONE == current_partition_index)
+  {
     /*
-      We will use the partition set in our scan, using the start and stop
-      partition and checking each scan before start dependent on bittfields.
+      The set of partitions to scan is empty. We return success and return
+      end of file on first rnd_next.
     */
-    late_extra_cache(m_part_spec.start_part);
-    DBUG_PRINT("info", ("rnd_init on partition %d",m_part_spec.start_part));
-    error= m_file[m_part_spec.start_part]->ha_rnd_init(1);
-    m_scan_value= 1;                            // Scan active
-    if (error)
-      m_scan_value= 2;                          // No scan active
-    DBUG_RETURN(error);
+    DBUG_RETURN(0);
   }
-  file= m_file;
-  do
+
+  /* we have a partition and we are scanning with rnd_next so we bump our cache */
+  if (scan)
+    late_extra_cache(current_partition_index);
+
+  DBUG_PRINT("info", ("rnd_init on partition %d", current_partition_index));
+
+  for (i= current_partition_index; i < m_tot_parts; i++)
   {
-    if ((error= (*file)->ha_rnd_init(0)))
-      goto err;
-  } while (*(++file));
-  m_scan_value= 0;
+    if (_bitmap_is_set(&(m_part_info->used_partitions), i))
+      if ((error= m_file[i]->ha_rnd_init(scan)))
+        goto err;
+    if (scan)
+      break;
+  }
+  m_scan_value= scan ? 1 : 0;
+  DBUG_PRINT("info", ("m_scan_value=%d", m_scan_value));
   DBUG_RETURN(0);
 
 err:
-  while (file--)
-    (*file)->ha_rnd_end();
+  while (i >= current_partition_index)
+  {
+    if (_bitmap_is_set(&(m_part_info->used_partitions), i))
+	  m_file[i--]->ha_rnd_end();
+  }
+  m_scan_value= scan ? 2 : 0;
   DBUG_RETURN(error);
 }
 
@@ -2937,31 +2979,29 @@
 {
   handler **file;
   DBUG_ENTER("ha_partition::rnd_end");
-
   switch (m_scan_value) {
   case 2:                                       // Error
     break;
-  case 1:                                       // Table scan
-    if (m_part_spec.start_part != NO_CURRENT_PART_ID)
+  case 1:
+    if (MY_BIT_NONE != current_partition_index)         // Table scan
     {
-      late_extra_no_cache(m_part_spec.start_part);
-      m_file[m_part_spec.start_part]->ha_rnd_end();
+      late_extra_no_cache(current_partition_index);
+      m_file[current_partition_index]->ha_rnd_end();
     }
     break;
   case 0:
     file= m_file;
     do
     {
-      (*file)->ha_rnd_end();
+      if (_bitmap_is_set(&(m_part_info->used_partitions), (file - m_file)))
+        (*file)->ha_rnd_end();
     } while (*(++file));
     break;
   }
-  m_part_spec.start_part= NO_CURRENT_PART_ID;
   m_scan_value= 2;
   DBUG_RETURN(0);
 }
 
-
 /*
   read next row during full table scan (scan in random row order)
 
@@ -2985,14 +3025,13 @@
 
 int ha_partition::rnd_next(byte *buf)
 {
-  uint part_id= m_part_spec.start_part;         // Cache of this variable
-  handler *file= m_file[part_id];
+  handler *file;
   int result= HA_ERR_END_OF_FILE;
   DBUG_ENTER("ha_partition::rnd_next");
+  DBUG_PRINT("info", ("m_scan_value %d", m_scan_value));
 
-  DBUG_ASSERT(m_scan_value == 1);
 
-  if (part_id > m_part_spec.end_part)
+  if (MY_BIT_NONE == current_partition_index)
   {
     /*
       The original set of partitions to scan was empty and thus we report
@@ -3000,44 +3039,52 @@
     */
     goto end;
   }
+  
+  DBUG_ASSERT(m_scan_value == 1);
+  file= m_file[current_partition_index];
+  
   while (TRUE)
   {
-    if ((result= file->rnd_next(buf)))
+    int result= file->rnd_next(buf);
+    if (!result)
     {
-      if (result == HA_ERR_RECORD_DELETED)
-        continue;                               // Probably MyISAM
-
-      if (result != HA_ERR_END_OF_FILE)
-        break;                                  // Return error
+      table->status= 0;
+      DBUG_RETURN(0);
+    }
 
-      /* End current partition */
-      late_extra_no_cache(part_id);
-      DBUG_PRINT("info", ("rnd_end on partition %d", part_id));
-      if ((result= file->ha_rnd_end()))
-        break;
-      /* Shift to next partition */
-      if (++part_id > m_part_spec.end_part)
-      {
-        result= HA_ERR_END_OF_FILE;
-        break;
-      }
-      file= m_file[part_id];
-      DBUG_PRINT("info", ("rnd_init on partition %d", part_id));
-      if ((result= file->ha_rnd_init(1)))
-        break;
-      late_extra_cache(part_id);
+    /* if we get here, then the current partition rnd_next returned failure */    
+    if (result == HA_ERR_RECORD_DELETED)
+      continue;                               // Probably MyISAM
+
+    if (result != HA_ERR_END_OF_FILE)
+      break;                                  // Return error
+
+    /* End current partition */
+    late_extra_no_cache(current_partition_index);
+    DBUG_PRINT("info", ("rnd_end on partition %d", current_partition_index));
+    if ((result= file->ha_rnd_end()))
+      break;
+    
+    /* Shift to next partition */
+    while (++current_partition_index < m_tot_parts &&
+           !bitmap_is_set(&(m_part_info->used_partitions), current_partition_index))
+    {
     }
-    else
+    if (current_partition_index >= m_tot_parts)
     {
-      m_part_spec.start_part= part_id;
-      m_last_part= part_id;
-      table->status= 0;
-      DBUG_RETURN(0);
+      result= HA_ERR_END_OF_FILE;
+      break;
     }
+    file= m_file[current_partition_index];
+    DBUG_PRINT("info", ("rnd_init on partition %d", current_partition_index));
+    if ((result= file->ha_rnd_init(1)))
+      break;
+    late_extra_cache(current_partition_index);
   }
 
 end:
-  m_part_spec.start_part= NO_CURRENT_PART_ID;
+  current_partition_index= MY_BIT_NONE;
+  m_part_spec.start_part= NO_CURRENT_PART_ID;  //TODO: should be removed
   table->status= STATUS_NOT_FOUND;
   DBUG_RETURN(result);
 }
@@ -3070,11 +3117,11 @@
 
 void ha_partition::position(const byte *record)
 {
-  handler *file= m_file[m_last_part];
+  handler *file= m_file[current_partition_index];
   DBUG_ENTER("ha_partition::position");
 
   file->position(record);
-  int2store(ref, m_last_part);
+  //store_part_id_in_pos(ref, current_partition_index);
   memcpy((ref + PARTITION_BYTES_IN_POS), file->ref,
 	 (ref_length - PARTITION_BYTES_IN_POS));
 
@@ -3116,7 +3163,8 @@
   part_id= uint2korr((const byte *) pos);
   DBUG_ASSERT(part_id < m_tot_parts);
   file= m_file[part_id];
-  m_last_part= part_id;
+  current_partition_index= part_id;
+  m_last_part= part_id;  // TODO: remove
   DBUG_RETURN(file->rnd_pos(buf, (pos + PARTITION_BYTES_IN_POS)));
 }
 
@@ -3160,6 +3208,7 @@
 int ha_partition::index_init(uint inx, bool sorted)
 {
   int error= 0;
+  uint i= 0;
   handler **file;
   DBUG_ENTER("ha_partition::index_init");
 
@@ -3169,16 +3218,16 @@
   m_ordered= sorted;
   m_curr_key_info= table->key_info+inx;
   include_partition_fields_in_used_fields();
-
   file= m_file;
   do
   {
     /* TODO RONM: Change to index_init() when code is stable */
-    if ((error= (*file)->ha_index_init(inx, sorted)))
-    {
-      DBUG_ASSERT(0);                           // Should never happen
-      break;
-    }
+    if (_bitmap_is_set(&(m_part_info->used_partitions), (file - m_file)))
+      if ((error= (*file)->ha_index_init(inx, sorted)))
+      {
+        DBUG_ASSERT(0);                           // Should never happen
+        break;
+      }
   } while (*(++file));
   DBUG_RETURN(error);
 }
@@ -3211,10 +3260,10 @@
   do
   {
     int tmp;
-    /* We want to execute index_end() on all handlers */
-    /* TODO RONM: Change to index_end() when code is stable */
-    if ((tmp= (*file)->ha_index_end()))
-      error= tmp;
+    /* TODO RONM: Change to index_init() when code is stable */
+    if (_bitmap_is_set(&(m_part_info->used_partitions), (file - m_file)))
+      if ((tmp= (*file)->ha_index_end()))
+        error= tmp;
   } while (*(++file));
   DBUG_RETURN(error);
 }
@@ -3832,43 +3881,61 @@
 
   m_top_entry= NO_CURRENT_PART_ID;
   queue_remove_all(&m_queue);
-  for (i= m_part_spec.start_part; i <= m_part_spec.end_part; i++)
+
+  /* now we see what the index of our first important partition is */
+  current_partition_index = bitmap_get_first_set(&(m_part_info->used_partitions));
+  if (MY_BIT_NONE == current_partition_index)
   {
-    int error;
-    byte *rec_buf_ptr= rec_buf(i);
-    handler *file= m_file[i];
+    /*
+      The set of partitions to scan is empty. We return success and return
+      end of file on first rnd_next.
+    */
+    DBUG_RETURN(0);
+  }
 
-    switch (m_index_scan_type) {
-    case partition_index_read:
-      error= file->index_read(rec_buf_ptr,
-			      m_start_key.key,
-			      m_start_key.length,
-			      m_start_key.flag);
-      reverse_order= FALSE;
-      break;
-    case partition_index_first:
-      error= file->index_first(rec_buf_ptr);
-      reverse_order= FALSE;
-      break;
-    case partition_index_last:
-      error= file->index_last(rec_buf_ptr);
-      reverse_order= TRUE;
-      break;
-    default:
-      DBUG_ASSERT(FALSE);
-      DBUG_RETURN(HA_ERR_END_OF_FILE);
-    }
-    if (!error)
-    {
-      found= TRUE;
-      /*
-        Initialise queue without order first, simply insert
-      */
-      queue_element(&m_queue, j++)= (byte*)queue_buf(i);
-    }
-    else if (error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE)
+  DBUG_PRINT("info", ("current_partition_index %d", current_partition_index));
+  for (i= current_partition_index; i <= m_part_spec.end_part; i++)
+  {
+    DBUG_PRINT("info", ("i %d", i));
+    if (_bitmap_is_set(&(m_part_info->used_partitions), i))
     {
-      DBUG_RETURN(error);
+      byte *rec_buf_ptr= rec_buf(i);
+      int error;
+      handler *file= m_file[i];
+      DBUG_PRINT("info", ("i %d is set", i));
+
+      switch (m_index_scan_type) {
+      case partition_index_read:
+        error= file->index_read(rec_buf_ptr,
+                                m_start_key.key,
+                                m_start_key.length,
+                                m_start_key.flag);
+        reverse_order= FALSE;
+        break;
+      case partition_index_first:
+        error= file->index_first(rec_buf_ptr);
+        reverse_order= FALSE;
+        break;
+      case partition_index_last:
+        error= file->index_last(rec_buf_ptr);
+        reverse_order= TRUE;
+        break;
+      default:
+        DBUG_ASSERT(FALSE);
+        DBUG_RETURN(HA_ERR_END_OF_FILE);
+      }
+      if (!error)
+      {
+        found= TRUE;
+        /*
+          Initialise queue without order first, simply insert
+        */
+        queue_element(&m_queue, j++)= (byte*)queue_buf(i);
+      }
+      else if (error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE)
+      {
+        DBUG_RETURN(error);
+      }
     }
   }
   if (found)
@@ -4664,10 +4731,9 @@
   int result= 0, tmp;
   handler **file;
   DBUG_ENTER("ha_partition::reset");
-
-  file= m_file;
   if (m_part_info)
     bitmap_clear_all(&m_part_info->used_partitions);
+  file= m_file;
   do
   {
     if ((tmp= (*file)->reset()))
@@ -4676,7 +4742,6 @@
   DBUG_RETURN(result);
 }
 
-
 /*
   Special extra method for HA_EXTRA_CACHE with cachesize as extra parameter
 
@@ -4901,14 +4966,15 @@
 ha_rows ha_partition::records_in_range(uint inx, key_range *min_key,
 				       key_range *max_key)
 {
-  ha_rows in_range= 0;
   handler **file;
+  ha_rows in_range= 0;
   DBUG_ENTER("ha_partition::records_in_range");
 
   file= m_file;
   do
   {
-    in_range+= (*file)->records_in_range(inx, min_key, max_key);
+    if (_bitmap_is_set(&(m_part_info->used_partitions), (file - m_file)))
+      in_range+= (*file)->records_in_range(inx, min_key, max_key);
   } while (*(++file));
   DBUG_RETURN(in_range);
 }
@@ -4933,10 +4999,13 @@
   file= m_file;
   do
   {
-    rows= (*file)->estimate_rows_upper_bound();
-    if (rows == HA_POS_ERROR)
-      DBUG_RETURN(HA_POS_ERROR);
-    tot_rows+= rows;
+    if (_bitmap_is_set(&(m_part_info->used_partitions), (file - m_file)))
+    {
+      rows= (*file)->estimate_rows_upper_bound();
+      if (rows == HA_POS_ERROR)
+        DBUG_RETURN(HA_POS_ERROR);
+      tot_rows+= rows;
+    }
   } while (*(++file));
   DBUG_RETURN(tot_rows);
 }
@@ -5323,6 +5392,10 @@
     hash_delete(&partition_open_tables, (byte *) share);
     thr_lock_delete(&share->lock);
     pthread_mutex_destroy(&share->mutex);
+    /*
+      this doesn't seem to free m_part_info->partition_names,
+      need to know how to make sure this happens
+    */
     my_free((gptr) share, MYF(0));
   }
   pthread_mutex_unlock(&partition_mutex);

--- 1.9/sql/ha_partition.h	2006-01-16 23:37:24 -08:00
+++ 1.10/sql/ha_partition.h	2006-01-18 22:44:27 -08:00
@@ -93,6 +93,7 @@
   uint m_top_entry;                      // Which partition is to
                                          // deliver next result
   uint m_rec_length;                     // Local copy of record length
+  uint current_partition_index;          // Index of current partition in bitmap
 
   bool m_ordered;                        // Ordered/Unordered index scan
   bool m_has_transactions;               // Can we support transactions
Thread
bk commit into 5.1 tree (patg:1.2075)Patrick Galbraith19 Jan