List:Internals« Previous MessageNext Message »
From:Mikael Ronström Date:May 23 2006 6:09am
Subject:bk commit - 5.1 tree (mikael:1.2388) BUG#19304
View as plain text  
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2006/05/23 07:37:03-04:00 
mikael@stripped
#   BUG#19304: Merge handler allowed in partitioned tables
#
# sql/share/errmsg.txt
#   2006/05/23 07:36:58-04:00 
mikael@stripped +3 -0
#   New error message
#
# sql/partition_info.cc
#   2006/05/23 07:36:58-04:00 
mikael@stripped +8 -7
#   Check for not merge handler in partitioned table
#
# mysql-test/t/partition.test
#   2006/05/23 07:36:58-04:00 
mikael@stripped +8 -0
#   New test case
#
# mysql-test/r/partition.result
#   2006/05/23 07:36:57-04:00 
mikael@stripped +4 -0
#   New test case
#
diff -Nru a/mysql-test/r/partition.result 
b/mysql-test/r/partition.result
--- a/mysql-test/r/partition.result	2006-05-23 07:42:33 -04:00
+++ b/mysql-test/r/partition.result	2006-05-23 07:42:33 -04:00
@@ -886,4 +886,8 @@
  2
  3
  drop table t1;
+create table t1 (a int)
+partition by key (a)
+(partition p0 engine = MERGE);
+ERROR HY000: MyISAM Merge handler cannot be used in partitioned tables
  End of 5.1 tests
diff -Nru a/mysql-test/t/partition.test b/mysql-test/t/partition.test
--- a/mysql-test/t/partition.test	2006-05-23 07:42:33 -04:00
+++ b/mysql-test/t/partition.test	2006-05-23 07:42:33 -04:00
@@ -1009,4 +1009,12 @@
  select * from t1;
  drop table t1;

+#
+# BUG 19304 Partitions: MERGE handler not allowed in partitioned tables
+#
+--error ER_PARTITION_MERGE_ERROR
+create table t1 (a int)
+partition by key (a)
+(partition p0 engine = MERGE);
+
  --echo End of 5.1 tests
diff -Nru a/sql/partition_info.cc b/sql/partition_info.cc
--- a/sql/partition_info.cc	2006-05-23 07:42:33 -04:00
+++ b/sql/partition_info.cc	2006-05-23 07:42:33 -04:00
@@ -431,18 +431,22 @@
  bool partition_info::check_engine_mix(handlerton **engine_array, uint 
no_parts)
  {
    uint i= 0;
-  bool result= FALSE;
    DBUG_ENTER("partition_info::check_engine_mix");

    do
    {
      if (engine_array[i] != engine_array[0])
      {
-      result= TRUE;
-      break;
+      my_error(ER_MIX_HANDLER_ERROR, MYF(0));
+      DBUG_RETURN(TRUE);
      }
    } while (++i < no_parts);
-  DBUG_RETURN(result);
+  if (!strcmp(engine_array[0]->name,"MRG_MYISAM"))
+  {
+    my_error(ER_PARTITION_MERGE_ERROR, MYF(0));
+    DBUG_RETURN(TRUE);
+  }
+  DBUG_RETURN(FALSE);
  }


@@ -756,10 +760,7 @@
      } while (++i < no_parts);
    }
    if (unlikely(partition_info::check_engine_mix(engine_array, 
part_count)))
-  {
-    my_error(ER_MIX_HANDLER_ERROR, MYF(0));
      goto end;
-  }

    if (eng_type)
      *eng_type= (handlerton*)engine_array[0];
diff -Nru a/sql/share/errmsg.txt b/sql/share/errmsg.txt
--- a/sql/share/errmsg.txt	2006-05-23 07:42:33 -04:00
+++ b/sql/share/errmsg.txt	2006-05-23 07:42:33 -04:00
@@ -5840,3 +5840,6 @@
  ER_WRONG_PARTITION_NAME
          eng "Incorrect partition name"
          swe "Felaktigt partitionsnamn"
+ER_PARTITION_MERGE_ERROR
+        eng "MyISAM Merge handler cannot be used in partitioned tables"
+        swe "MyISAM Merge kan inte an‰ndas i en partitionerad tabell"

Mikael Ronstrom, Senior Software Architect
MySQL AB, www.mysql.com

Jumpstart your cluster:
http://www.mysql.com/consulting/packaged/cluster.html
My blog:
http://mikaelronstrom.blogspot.com

Thread
bk commit - 5.1 tree (mikael:1.2388) BUG#19304Mikael Ronström23 May