MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Sergey Vojtovich Date:November 25 2008 9:56am
Subject:bzr commit into mysql-6.0-falcon-team branch (svoj:2917) Bug#39702
View as plain text  
#At file:///home/svoj/devel/bzr-mysql/mysql-6.0-falcon-team-bug39702/

 2917 Sergey Vojtovich	2008-11-25
      BUG#39702 - Unspecific error msg when using non-existent
                  tablespace in partition definition
      
      Partitioning handler create function didn't pass through
      error code from a storage engine, resulting in generic
      error message being returned.
added:
  mysql-test/suite/falcon/r/falcon_bug_39702.result
  mysql-test/suite/falcon/t/falcon_bug_39702.test
modified:
  sql/ha_partition.cc

per-file messages:
  mysql-test/suite/falcon/r/falcon_bug_39702.result
    A test case for BUG#39702.
  mysql-test/suite/falcon/t/falcon_bug_39702.test
    A test case for BUG#39702.
  sql/ha_partition.cc
    Pass through error code from del_ren_cre_table().
=== added file 'mysql-test/suite/falcon/r/falcon_bug_39702.result'
--- a/mysql-test/suite/falcon/r/falcon_bug_39702.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/falcon/r/falcon_bug_39702.result	2008-11-25 09:56:21 +0000
@@ -0,0 +1,7 @@
+*** Bug #39702 ***
+SET @@storage_engine = 'Falcon';
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(a INT) PARTITION BY RANGE(a) (
+PARTITION p1 VALUES LESS THAN (10) TABLESPACE nosuchtablespace,
+PARTITION p2 VALUES LESS THAN MAXVALUE TABLESPACE nosuchtablespace);
+ERROR HY000: Tablespace 'nosuchtablespace' doesn't exist

=== added file 'mysql-test/suite/falcon/t/falcon_bug_39702.test'
--- a/mysql-test/suite/falcon/t/falcon_bug_39702.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/falcon/t/falcon_bug_39702.test	2008-11-25 09:56:21 +0000
@@ -0,0 +1,34 @@
+--source include/have_falcon.inc
+--source include/have_partition.inc
+
+#
+# Bug #39702: Unspecific error msg when using non-existent tablespace in
+#             partition definition
+#
+--echo *** Bug #39702 ***
+
+# ----------------------------------------------------- #
+# --- Initialisation                                --- #
+# ----------------------------------------------------- #
+let $engine = 'Falcon';
+eval SET @@storage_engine = $engine;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+# ----------------------------------------------------- #
+# --- Test                                          --- #
+# ----------------------------------------------------- #
+--error ER_NO_SUCH_TABLESPACE
+CREATE TABLE t1(a INT) PARTITION BY RANGE(a) (
+  PARTITION p1 VALUES LESS THAN (10) TABLESPACE nosuchtablespace,
+  PARTITION p2 VALUES LESS THAN MAXVALUE TABLESPACE nosuchtablespace);
+
+# ----------------------------------------------------- #
+# --- Check                                         --- #
+# ----------------------------------------------------- #
+
+# ----------------------------------------------------- #
+# --- Final cleanup                                 --- #
+# ----------------------------------------------------- #

=== modified file 'sql/ha_partition.cc'
--- a/sql/ha_partition.cc	2008-11-06 18:39:27 +0000
+++ b/sql/ha_partition.cc	2008-11-25 09:56:21 +0000
@@ -552,14 +552,15 @@ int ha_partition::create(const char *nam
 			 HA_CREATE_INFO *create_info)
 {
   char t_name[FN_REFLEN];
+  int error;
   DBUG_ENTER("ha_partition::create");
 
   strmov(t_name, name);
   DBUG_ASSERT(*fn_rext((char*)name) == '\0');
-  if (del_ren_cre_table(t_name, NULL, table_arg, create_info))
+  if ((error= del_ren_cre_table(t_name, NULL, table_arg, create_info)))
   {
     handler::delete_table(t_name);
-    DBUG_RETURN(1);
+    DBUG_RETURN(error);
   }
   DBUG_RETURN(0);
 }

Thread
bzr commit into mysql-6.0-falcon-team branch (svoj:2917) Bug#39702Sergey Vojtovich25 Nov