mariadb/mysql-test/suite/innodb/t/alter_partitioned.test
Thirunarayanan Balathandayuthapani f38d8c1701 MDEV-16201 CREATE TABLE creates extra transaction
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.
2018-05-17 22:03:53 +05:30

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;