summaryrefslogtreecommitdiff
path: root/mysql-test/t/information_schema_inno.test
blob: af8bd9f98b8c15a1ed447e8a1f9e2d60c8fbc446 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
-- source include/have_innodb.inc
--disable_warnings
DROP TABLE IF EXISTS t1,t2;
--enable_warnings

#
# Test for KEY_COLUMN_USAGE & TABLE_CONSTRAINTS tables
#

CREATE TABLE t1 (id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB;
CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id),
FOREIGN KEY (t1_id) REFERENCES t1(id)  ON DELETE CASCADE,
FOREIGN KEY (t1_id) REFERENCES t1(id)  ON UPDATE CASCADE) ENGINE=INNODB;
select * from information_schema.TABLE_CONSTRAINTS where
TABLE_SCHEMA= "test";
select * from information_schema.KEY_COLUMN_USAGE where
TABLE_SCHEMA= "test";

drop table t2, t1;