mirror of
https://github.com/MariaDB/server.git
synced 2025-01-30 18:41:56 +01:00
f38d8c1701
InnoDB does not allow FOREIGN KEY constraints to exist for TEMPORARY TABLE. InnoDB introduced a dedicated tablespace for temporary tables, and actually stopped creating persistent metadata and data for temporary tables. row_table_add_foreign_constraints(): Do not create a persistent transaction. dict_create_foreign_constraints_low(): Add the persistent transaction to the update the foreign key relation in dictionary. dict_create_foreign_constraints_low(): Remove a duplicated check for partitioned tables.
15 lines
443 B
Text
15 lines
443 B
Text
--source include/have_innodb.inc
|
|
--source include/have_partition.inc
|
|
|
|
CREATE TABLE t1(a INT, b VARCHAR(10), INDEX(a))ENGINE=InnoDB
|
|
PARTITION BY RANGE(a)
|
|
(PARTITION pa VALUES LESS THAN (3),
|
|
PARTITION pb VALUES LESS THAN (5));
|
|
|
|
--error ER_FOREIGN_KEY_ON_PARTITIONED
|
|
CREATE TABLE t2(a INT, FOREIGN KEY(a) REFERENCES t1(a))ENGINE=INNODB
|
|
PARTITION BY RANGE(a)
|
|
(PARTITION pa VALUES LESS THAN (2),
|
|
PARTITION pb VALUES LESS THAN (4));
|
|
|
|
DROP TABLE t1;
|