List:Internals« Previous MessageNext Message »
From:ramil Date:November 6 2005 7:29am
Subject:bk commit into 5.1 tree (ramil:1.1934)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of ndbdev. When ndbdev 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.1934 05/11/06 08:29:03 ramil@stripped +7 -0
  WL #528: Faster free_tmp_table

  storage/heap/hp_create.c
    1.23 05/11/06 08:28:50 ramil@stripped +22 -4
    WL #528: Faster free_tmp_table

  sql/sql_select.cc
    1.367 05/11/06 08:28:50 ramil@stripped +2 -10
    WL #528: Faster free_tmp_table

  sql/handler.h
    1.163 05/11/06 08:28:50 ramil@stripped +1 -0
    WL #528: Faster free_tmp_table

  sql/handler.cc
    1.190 05/11/06 08:28:50 ramil@stripped +8 -0
    WL #528: Faster free_tmp_table

  sql/ha_heap.h
    1.41 05/11/06 08:28:50 ramil@stripped +1 -0
    WL #528: Faster free_tmp_table

  sql/ha_heap.cc
    1.74 05/11/06 08:28:50 ramil@stripped +8 -0
    WL #528: Faster free_tmp_table

  include/heap.h
    1.25 05/11/06 08:28:50 ramil@stripped +1 -0
    WL #528: Faster free_tmp_table

# 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:	ramil
# Host:	ndbmaster.mysql.com
# Root:	/home/ndbdev/tomas/mysql-5.1-new

--- 1.22/storage/heap/hp_create.c	Fri Nov  4 21:09:58 2005
+++ 1.23/storage/heap/hp_create.c	Sun Nov  6 08:28:50 2005
@@ -234,6 +234,16 @@
        HP_PTRS_IN_NOD * block->level_info[i - 1].records_under_level);
 }
 
+
+static inline void heap_try_free(HP_SHARE *share)
+{
+  if (share->open_count == 0)
+    hp_free(share);
+  else
+    share->delete_on_close= 1;
+}
+
+
 int heap_delete_table(const char *name)
 {
   int result;
@@ -243,10 +253,7 @@
   pthread_mutex_lock(&THR_LOCK_heap);
   if ((share= hp_find_named_heap(name)))
   {
-    if (share->open_count == 0)
-      hp_free(share);
-    else
-     share->delete_on_close= 1;
+    heap_try_free(share);
     result= 0;
   }
   else
@@ -256,6 +263,17 @@
   pthread_mutex_unlock(&THR_LOCK_heap);
   DBUG_RETURN(result);
 }
+
+
+void heap_drop_table(HP_INFO *info)
+{
+  DBUG_ENTER("heap_drop_table");
+  pthread_mutex_lock(&THR_LOCK_heap);
+  heap_try_free(info->s);
+  pthread_mutex_unlock(&THR_LOCK_heap);
+  DBUG_VOID_RETURN;
+}
+
 
 void hp_free(HP_SHARE *share)
 {

--- 1.24/include/heap.h	Wed Mar 16 00:15:42 2005
+++ 1.25/include/heap.h	Sun Nov  6 08:28:50 2005
@@ -206,6 +206,7 @@
 		       uint reclength, ulong max_records, ulong min_records,
 		       HP_CREATE_INFO *create_info);
 extern int heap_delete_table(const char *name);
+extern void heap_drop_table(HP_INFO *info);
 extern int heap_extra(HP_INFO *info,enum ha_extra_function function);
 extern int heap_rename(const char *old_name,const char *new_name);
 extern int heap_panic(enum ha_panic_function flag);

--- 1.73/sql/ha_heap.cc	Thu Oct  6 10:25:57 2005
+++ 1.74/sql/ha_heap.cc	Sun Nov  6 08:28:50 2005
@@ -477,6 +477,14 @@
   return error == ENOENT ? 0 : error;
 }
 
+
+void ha_heap::drop_table(const char *name)
+{
+  heap_drop_table(file);
+  close();
+}
+
+
 int ha_heap::rename_table(const char * from, const char * to)
 {
   return heap_rename(from,to);

--- 1.40/sql/ha_heap.h	Sat Nov  5 12:20:31 2005
+++ 1.41/sql/ha_heap.h	Sun Nov  6 08:28:50 2005
@@ -94,6 +94,7 @@
   int indexes_are_disabled(void);
   ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key);
   int delete_table(const char *from);
+  void drop_table(const char *name);
   int rename_table(const char * from, const char * to);
   int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info);
   void update_create_info(HA_CREATE_INFO *create_info);

--- 1.189/sql/handler.cc	Sat Nov  5 12:20:31 2005
+++ 1.190/sql/handler.cc	Sun Nov  6 08:28:50 2005
@@ -2062,6 +2062,14 @@
   return error;
 }
 
+
+void handler::drop_table(const char *name)
+{
+  close();
+  delete_table(name);
+}
+
+
 /*
   Tell the storage engine that it is allowed to "disable transaction" in the
   handler. It is a hint that ACID is not required - it is used in NDB for

--- 1.162/sql/handler.h	Sat Nov  5 12:20:31 2005
+++ 1.163/sql/handler.h	Sun Nov  6 08:28:50 2005
@@ -1288,6 +1288,7 @@
   */
   virtual int rename_table(const char *from, const char *to);
   virtual int delete_table(const char *name);
+  virtual void drop_table(const char *name);
   
   virtual int create(const char *name, TABLE *form, HA_CREATE_INFO *info)=0;
   virtual int create_handler_files(const char *name) { return FALSE;}

--- 1.366/sql/sql_select.cc	Fri Nov  4 21:09:57 2005
+++ 1.367/sql/sql_select.cc	Sun Nov  6 08:28:50 2005
@@ -8848,16 +8848,8 @@
   if (entry->file)
   {
     if (entry->db_stat)
-    {
-      (void) entry->file->close();
-    }
-    /*
-      We can't call ha_delete_table here as the table may created in mixed case
-      here and we have to ensure that delete_table gets the table name in
-      the original case.
-    */
-    if (!(test_flags & TEST_KEEP_TMP_TABLES) ||
-        entry->s->db_type == DB_TYPE_HEAP)
+      entry->file->drop_table(entry->s->table_name);
+    else
       entry->file->delete_table(entry->s->table_name);
     delete entry->file;
   }
Thread
bk commit into 5.1 tree (ramil:1.1934)ramil6 Nov