MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Sergey Vojtovich Date:September 11 2009 10:45am
Subject:bzr push into mysql-pe branch (svoj:3598 to 3599) Bug#46483
View as plain text  
 3599 Sergey Vojtovich	2009-09-11
      Follow-up to fix for
      BUG#46483 - drop table of partitioned table may leave extraneous file
      
      With 6.0 code base we need to create and drop handler files for
      temporary altered table. This is different from 5.1 where temporary
      altered table is never referenced during fast add/drop index.
     @ sql/sql_base.cc
        When requested to drop only dot-frm file of temporary table,
        drop handler files as well (they're accompanying dot-frm).
     @ sql/sql_partition.cc
        Added missing DBUG_RETURN.
     @ sql/unireg.cc
        Revert fix for BUG#46483.

    modified:
      sql/sql_base.cc
      sql/sql_partition.cc
      sql/unireg.cc
 3598 Alexander Nozdrin	2009-09-10 [merge]
      Merge from 5.1-bugteam

    modified:
      include/my_dbug.h
=== modified file 'sql/sql_base.cc'
--- a/sql/sql_base.cc	2009-08-31 20:25:11 +0000
+++ b/sql/sql_base.cc	2009-09-11 10:45:04 +0000
@@ -5265,14 +5265,19 @@ bool rm_temporary_table(handlerton *base
   if (my_delete(path,MYF(0)))
     error=1; /* purecov: inspected */
   *ext= 0;				// remove extension
-  file= get_new_handler((TABLE_SHARE*) 0, current_thd->mem_root, base);
-  if (!frm_only && file && file->ha_delete_table(path))
+  if ((file= get_new_handler((TABLE_SHARE*) 0, current_thd->mem_root, base)))
   {
-    error=1;
-    sql_print_warning("Could not remove temporary table: '%s', error: %d",
-                      path, my_errno);
+    int rc= frm_only ?
+            file->ha_create_handler_files(path, NULL, CHF_DELETE_FLAG, NULL) :
+            file->ha_delete_table(path);
+    if (rc)
+    {
+      error= 1;
+      sql_print_warning("Could not remove temporary table: '%s', error: %d",
+                        path, my_errno);
+    }
+    delete file;
   }
-  delete file;
   DBUG_RETURN(error);
 }
 

=== modified file 'sql/sql_partition.cc'
--- a/sql/sql_partition.cc	2009-09-03 09:40:21 +0000
+++ b/sql/sql_partition.cc	2009-09-11 10:45:04 +0000
@@ -6807,7 +6807,7 @@ int get_part_iter_for_interval_via_mappi
         part_iter->part_nums.cur= part_iter->part_nums.start= 0;
         part_iter->part_nums.end= 0;
         part_iter->ret_null_part= part_iter->ret_null_part_orig= TRUE;
-        return 1;
+        DBUG_RETURN(1);
       }
       part_iter->part_nums.cur= part_iter->part_nums.start;
       if (part_iter->part_nums.start == max_endpoint_val)

=== modified file 'sql/unireg.cc'
--- a/sql/unireg.cc	2009-09-10 07:13:39 +0000
+++ b/sql/unireg.cc	2009-09-11 10:45:04 +0000
@@ -493,10 +493,10 @@ int rea_create_table(THD *thd, const cha
   DBUG_ASSERT(*fn_rext(frm_name));
   if (thd->variables.keep_files_on_create)
     create_info->options|= HA_CREATE_KEEP_FILES;
-  if (!create_info->frm_only &&
-      (file->ha_create_handler_files(path, NULL, CHF_CREATE_FLAG,
-                                     create_info) ||
-       ha_create_table(thd, path, db, table_name, create_info, 0)))
+  if (file->ha_create_handler_files(path, NULL, CHF_CREATE_FLAG, create_info))
+    goto err_handler;
+  if (!create_info->frm_only && ha_create_table(thd, path, db, table_name,
+                                                create_info, 0))
     goto err_handler;
   DBUG_RETURN(0);
 


Attachment: [text/bzr-bundle] bzr/svoj@sun.com-20090911104504-cwv60ua3grbtiqlm.bundle
Thread
bzr push into mysql-pe branch (svoj:3598 to 3599) Bug#46483Sergey Vojtovich11 Sep