summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormikael@c-870ae253.1238-1-64736c10.cust.bredbandsbolaget.se <>2006-05-24 13:41:04 -0400
committermikael@c-870ae253.1238-1-64736c10.cust.bredbandsbolaget.se <>2006-05-24 13:41:04 -0400
commitd1098a85eb2a1e5b8f1c74cd2b553e7c1f02404a (patch)
tree680280c0e4ac213352352b07c05d0e7107b6e337
parent13ae6420fd63f2c7abea75d0a4745e2d17ea4a53 (diff)
parentcb0a4f74236ded612654935d023586429bf1f82c (diff)
downloadmariadb-git-d1098a85eb2a1e5b8f1c74cd2b553e7c1f02404a.tar.gz
Merge mronstrom@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into c-870ae253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/bug19304
-rw-r--r--mysql-test/r/partition.result4
-rw-r--r--mysql-test/t/partition.test8
-rw-r--r--sql/partition_info.cc15
-rw-r--r--sql/share/errmsg.txt3
4 files changed, 23 insertions, 7 deletions
diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result
index a4dd5f9a64e..dbb3e0fdc52 100644
--- a/mysql-test/r/partition.result
+++ b/mysql-test/r/partition.result
@@ -890,6 +890,10 @@ s1
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
create table t1 (a int) engine=memory
partition by key(a);
insert into t1 values (1);
diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test
index 1a64537b6fc..f7ce146c109 100644
--- a/mysql-test/t/partition.test
+++ b/mysql-test/t/partition.test
@@ -1024,6 +1024,14 @@ create index inx1 on t1(a);
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);
+
+#
# BUG 19062 Partition clause ignored if CREATE TABLE ... AS SELECT ...;
#
create table t1 (a varchar(1))
diff --git a/sql/partition_info.cc b/sql/partition_info.cc
index 6761b28331e..0635c80296f 100644
--- a/sql/partition_info.cc
+++ b/sql/partition_info.cc
@@ -432,18 +432,22 @@ char *partition_info::has_unique_names()
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 (ha_legacy_type(engine_array[0]) == DB_TYPE_MRG_MYISAM)
+ {
+ my_error(ER_PARTITION_MERGE_ERROR, MYF(0));
+ DBUG_RETURN(TRUE);
+ }
+ DBUG_RETURN(FALSE);
}
@@ -757,10 +761,7 @@ bool partition_info::check_partition_info(handlerton **eng_type,
} 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 --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt
index aa9cbaef36d..c5a9fb75eed 100644
--- a/sql/share/errmsg.txt
+++ b/sql/share/errmsg.txt
@@ -5846,3 +5846,6 @@ ER_EVENT_MODIFY_QUEUE_ERROR
eng "Internal scheduler error %d"
ER_EVENT_SET_VAR_ERROR
eng "Error during starting/stopping of the scheduler. Error code %u"
+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"