mirror of
				https://github.com/MariaDB/server.git
				synced 2025-11-03 14:33:32 +03:00 
			
		
		
		
	
		
			
				
	
	
		
			20 lines
		
	
	
		
			606 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			606 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
-- 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;
 |