summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorunknown <mattiasj@client-10-129-10-137.upp.off.mysql.com>2008-01-09 13:15:50 +0100
committerunknown <mattiasj@client-10-129-10-137.upp.off.mysql.com>2008-01-09 13:15:50 +0100
commitd84a0e5caa26602b282695b52417cf7d9b667e7e (patch)
tree01efa133afaebe5223ea778383087a1375e03273 /mysql-test/t
parent51cb4ffcc1eb43aad9581c3f846f63b214f179ea (diff)
downloadmariadb-git-d84a0e5caa26602b282695b52417cf7d9b667e7e.tar.gz
Bug#31931 Partitions: unjustified 'mix of handlers' error message
Problem was that the mix of handlers was not consistent between CREATE and ALTER changed so that it works like: - All partitions must use the same engine AND it must be the same as the table. - if one does NOT specify an engine on the table level then one must either NOT specify any engine on any partition/subpartition OR for ALL partitions/subpartitions Note: that after a table have been created, the storage engine is specified for all parts of the table (table/partition/subpartition) and so when using alter, one does not need to specify it (unless one wants to change the storage engine, then one have to specify it on the table level) mysql-test/r/partition.result: Bug#31931 Partitions: unjustified 'mix of handlers' error message test result updated mysql-test/r/partition_innodb.result: Bug#31931 Partitions: unjustified 'mix of handlers' error message test result updated mysql-test/suite/ndb/r/ndb_partition_key.result: Bug#31931 Partitions: unjustified 'mix of handlers' error message test result updated mysql-test/suite/ndb/t/ndb_partition_key.test: Bug#31931 Partitions: unjustified 'mix of handlers' error message test case update mysql-test/suite/parts/inc/partition_engine.inc: Bug#31931 Partitions: unjustified 'mix of handlers' error message test case updated mysql-test/suite/parts/r/ndb_partition_key.result: Bug#31931 Partitions: unjustified 'mix of handlers' error message test result updated mysql-test/suite/parts/r/partition_engine_innodb.result: Bug#31931 Partitions: unjustified 'mix of handlers' error message test result updated mysql-test/suite/parts/r/partition_engine_myisam.result: Bug#31931 Partitions: unjustified 'mix of handlers' error message test result updated mysql-test/suite/parts/t/ndb_partition_key.test: Bug#31931 Partitions: unjustified 'mix of handlers' error message test case updated mysql-test/t/partition.test: Bug#31931 Partitions: unjustified 'mix of handlers' error message test case updated mysql-test/t/partition_innodb.test: Bug#31931 Partitions: unjustified 'mix of handlers' error message test case updated sql/partition_info.cc: Bug#31931 Partitions: unjustified 'mix of handlers' error message moved the check_engine_condition here from sql_partition.cc created a new check_engine_mix from check_native_partitioned in sql_partition.cc sql/partition_info.h: Bug#31931 Partitions: unjustified 'mix of handlers' error message non static function check_engine_mix (now used in sql_partition.cc) sql/sql_partition.cc: Bug#31931 Partitions: unjustified 'mix of handlers' error message moved check_engine_condition to partition_info.cc and moved out some common code in check_native_partitioned to check_engine_mix in partition_info.cc
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/partition.test7
-rw-r--r--mysql-test/t/partition_innodb.test7
2 files changed, 10 insertions, 4 deletions
diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test
index 23d6c5f8865..1ba8402cdf0 100644
--- a/mysql-test/t/partition.test
+++ b/mysql-test/t/partition.test
@@ -49,6 +49,7 @@ create table t1 (id int auto_increment, s1 int, primary key (id));
insert into t1 values (null,1);
insert into t1 values (null,6);
+-- sorted_result
select * from t1;
alter table t1 partition by range (id) (
@@ -618,12 +619,14 @@ partition by key (a)
(partition p0, partition p1);
show create table t1;
---error ER_MIX_HANDLER_ERROR
+# Since alter, it already have ENGINE=HEAP from before on table level
+# -> OK
alter table t1
partition by key(a)
(partition p0, partition p1 engine=heap);
---error ER_MIX_HANDLER_ERROR
+# Since alter, it already have ENGINE=HEAP from before on table level
+# -> OK
alter table t1
partition by key(a)
(partition p0 engine=heap, partition p1);
diff --git a/mysql-test/t/partition_innodb.test b/mysql-test/t/partition_innodb.test
index 58010f85ecf..5445be6019e 100644
--- a/mysql-test/t/partition_innodb.test
+++ b/mysql-test/t/partition_innodb.test
@@ -86,6 +86,7 @@ engine = innodb
partition by list (a)
(partition p0 values in (0));
+-- error ER_MIX_HANDLER_ERROR
alter table t1 engine = x;
show create table t1;
drop table t1;
@@ -164,8 +165,10 @@ DROP TABLE t1;
create table t1 (int_column int, char_column char(5))
PARTITION BY RANGE (int_column) subpartition by key (char_column) subpartitions 2
(PARTITION p1 VALUES LESS THAN (5) ENGINE = InnoDB);
-alter table t1 PARTITION BY RANGE (int_column)
+alter table t1
+ENGINE = MyISAM
+PARTITION BY RANGE (int_column)
subpartition by key (char_column) subpartitions 2
- (PARTITION p1 VALUES LESS THAN (5) ENGINE = myisam);
+ (PARTITION p1 VALUES LESS THAN (5));
show create table t1;
drop table t1;