1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Bug#32948: FKs allowed to reference partitioned table

Problem: when alter to partitioned table,
it does not see it as change of engine.

Solution: If alter includes partitioning, check if it is possible
to change engines (eg. is the table referenced by a FK)
This commit is contained in:
mattiasj@witty.ndb.mysql.com
2007-12-06 14:43:06 +01:00
parent 5452a154d6
commit c27d93c83a
3 changed files with 29 additions and 1 deletions

View File

@ -1,6 +1,21 @@
--source include/have_partition.inc
--source include/have_innodb.inc
# Bug#32948 - FKs allowed to reference partitioned table
#
-- echo # Bug#32948
CREATE TABLE t1 (c1 INT, PRIMARY KEY (c1)) ENGINE=INNODB;
CREATE TABLE t2 (c1 INT, PRIMARY KEY (c1),
FOREIGN KEY (c1) REFERENCES t1 (c1)
ON DELETE CASCADE)
ENGINE=INNODB;
--error ER_ROW_IS_REFERENCED
ALTER TABLE t1 PARTITION BY HASH(c1) PARTITIONS 5;
--error ER_ROW_IS_REFERENCED
ALTER TABLE t1 ENGINE=MyISAM;
DROP TABLE t2;
DROP TABLE t1;
#
# Bug #14673: Wrong InnoDB default row format
#