From 3f619478f796eddbba6e39502fe941b285dd97b1 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 4 May 2024 20:00:34 +0200 Subject: Adding upstream version 1:10.11.6. Signed-off-by: Daniel Baumann --- mysql-test/suite/innodb/t/innodb_bug57904.test | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 mysql-test/suite/innodb/t/innodb_bug57904.test (limited to 'mysql-test/suite/innodb/t/innodb_bug57904.test') diff --git a/mysql-test/suite/innodb/t/innodb_bug57904.test b/mysql-test/suite/innodb/t/innodb_bug57904.test new file mode 100644 index 00000000..97e7ec93 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug57904.test @@ -0,0 +1,27 @@ +--source include/have_innodb.inc +# +# Bug #57904 Missing constraint from information schema REFERENTIAL_CONSTRAINTS table +# +CREATE TABLE product (category INT NOT NULL, id INT NOT NULL, + price DECIMAL, PRIMARY KEY(category, id)) ENGINE=INNODB; +CREATE TABLE customer (id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB; +CREATE TABLE product_order (no INT NOT NULL AUTO_INCREMENT, + product_category INT NOT NULL, + product_id INT NOT NULL, + customer_id INT NOT NULL, + PRIMARY KEY(no), + INDEX (product_category, product_id), + FOREIGN KEY (product_category, product_id) + REFERENCES product(category, id) ON UPDATE CASCADE ON DELETE RESTRICT, + INDEX (customer_id), + FOREIGN KEY (customer_id) + REFERENCES customer(id) + ) ENGINE=INNODB; + +query_vertical SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS +WHERE table_name = 'product_order'; + +DROP TABLE product_order; +DROP TABLE product; +DROP TABLE customer; + -- cgit v1.2.3