List:Commits« Previous MessageNext Message »
From:Sergey Vojtovich Date:September 2 2009 11:19am
Subject:bzr commit into mysql-5.1 branch (svoj:3093) Bug#46483
View as plain text  
#At file:///home/svoj/devel/bzr-mysql/mysql-5.1-bugteam-bug46483/ based on revid:dao-gang.qu@stripped

 3093 Sergey Vojtovich	2009-09-02
      BUG#46483 - drop table of partitioned table may leave
                  extraneous file
      
      Online/fast ALTER TABLE of a partitioned table may leave
      temporary file in database directory.
      
      Fixed by removing unnecessary call to
      handler::ha_create_handler_files(), which was creating
      partitioning definition file.
     @ mysql-test/r/partition_innodb.result
        A test case for BUG#46483.
     @ mysql-test/t/partition_innodb.test
        A test case for BUG#46483.
     @ sql/unireg.cc
        Do not call ha_create_handler_files() when we were requested
        to create only dot-frm file.

    modified:
      mysql-test/r/partition_innodb.result
      mysql-test/t/partition_innodb.test
      sql/unireg.cc
=== modified file 'mysql-test/r/partition_innodb.result'
--- a/mysql-test/r/partition_innodb.result	2008-11-10 20:13:24 +0000
+++ b/mysql-test/r/partition_innodb.result	2009-09-02 11:19:28 +0000
@@ -256,3 +256,7 @@ SUBPARTITION BY KEY (char_column)
 SUBPARTITIONS 2
 (PARTITION p1 VALUES LESS THAN (5) ENGINE = MyISAM) */
 drop table t1;
+CREATE TABLE t1 (a INT) ENGINE=InnoDB
+PARTITION BY list(a) (PARTITION p1 VALUES IN (1));
+CREATE INDEX i1 ON t1 (a);
+DROP TABLE t1;

=== modified file 'mysql-test/t/partition_innodb.test'
--- a/mysql-test/t/partition_innodb.test	2008-11-14 22:51:17 +0000
+++ b/mysql-test/t/partition_innodb.test	2009-09-02 11:19:28 +0000
@@ -270,3 +270,15 @@ PARTITION BY RANGE (int_column)
   (PARTITION p1 VALUES LESS THAN (5));
 show create table t1;
 drop table t1;
+
+#
+# BUG#46483 - drop table of partitioned table may leave extraneous file
+# Note: was only repeatable with InnoDB plugin
+#
+CREATE TABLE t1 (a INT) ENGINE=InnoDB
+  PARTITION BY list(a) (PARTITION p1 VALUES IN (1));
+CREATE INDEX i1 ON t1 (a);
+DROP TABLE t1;
+let $MYSQLD_DATADIR= `SELECT @@datadir`;
+# Before the fix it should show extra file like #sql-2405_2.par
+--list_files $MYSQLD_DATADIR/test/ *

=== modified file 'sql/unireg.cc'
--- a/sql/unireg.cc	2009-06-11 16:21:32 +0000
+++ b/sql/unireg.cc	2009-09-02 11:19:28 +0000
@@ -412,10 +412,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 (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))
+  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)))
     goto err_handler;
   DBUG_RETURN(0);
 


Attachment: [text/bzr-bundle] bzr/svoj@sun.com-20090902111928-6878plkgiar7i8qi.bundle
Thread
bzr commit into mysql-5.1 branch (svoj:3093) Bug#46483Sergey Vojtovich2 Sep
  • Re: bzr commit into mysql-5.1 branch (svoj:3093) Bug#46483Mattias Jonsson3 Sep