diff options
author | Mattias Jonsson <mattias.jonsson@sun.com> | 2010-03-04 12:29:22 +0100 |
---|---|---|
committer | Mattias Jonsson <mattias.jonsson@sun.com> | 2010-03-04 12:29:22 +0100 |
commit | 48d986f5110c3eb3d0211c437ee87d965263c674 (patch) | |
tree | 1b49c655aae5fd5a6139935c87c87fdbe7c031dc /mysql-test/r/partition_innodb.result | |
parent | ee4a3099b3ebf0c9b448e4404665bb0a8638dc3f (diff) | |
download | mariadb-git-48d986f5110c3eb3d0211c437ee87d965263c674.tar.gz |
Bug#50104: Partitioned table with just 1 partion works with fk
There was no check for foreign keys when altering partitioned
tables.
Added check for FK when altering partitioned tables.
mysql-test/r/partition_innodb.result:
Bug#50104: Partitioned table with just 1 partion works with fk
Updated test result
mysql-test/t/partition_innodb.test:
Bug#50104: Partitioned table with just 1 partion works with fk
Added test for adding FK on partitioned tables (both 1 and 2
partitions)
sql/sql_partition.cc:
Bug#50104: Partitioned table with just 1 partion works with fk
Disabled adding foreign key when altering a partitioned table.
Diffstat (limited to 'mysql-test/r/partition_innodb.result')
-rw-r--r-- | mysql-test/r/partition_innodb.result | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/mysql-test/r/partition_innodb.result b/mysql-test/r/partition_innodb.result index f2f6ef138ff..6167b4cef95 100644 --- a/mysql-test/r/partition_innodb.result +++ b/mysql-test/r/partition_innodb.result @@ -1,4 +1,24 @@ -drop table if exists t1; +drop table if exists t1, t2; +# +# Bug#50104: Partitioned table with just 1 partion works with fk +# +CREATE TABLE t2 ( +id INT, +PRIMARY KEY (id) +) ENGINE=InnoDB ; +CREATE TABLE t1 ( +id INT NOT NULL AUTO_INCREMENT, +parent_id INT DEFAULT NULL, +PRIMARY KEY (id), +KEY parent_id (parent_id) +) ENGINE=InnoDB; +ALTER TABLE t1 PARTITION BY HASH (id) PARTITIONS 1; +ALTER TABLE t1 ADD CONSTRAINT test_ibfk_1 FOREIGN KEY (parent_id) REFERENCES t2 (id); +ERROR HY000: Foreign key clause is not yet supported in conjunction with partitioning +ALTER TABLE t1 PARTITION BY HASH (id) PARTITIONS 2; +ALTER TABLE t1 ADD CONSTRAINT test_ibfk_1 FOREIGN KEY (parent_id) REFERENCES t2 (id); +ERROR HY000: Foreign key clause is not yet supported in conjunction with partitioning +DROP TABLE t1, t2; create table t1 (a int not null, b datetime not null, primary key (a,b)) |