mirror of
				https://github.com/MariaDB/server.git
				synced 2025-11-03 14:33:32 +03:00 
			
		
		
		
	Cleaned up test; Removed wrong DROP TABLE commands and use standard table and database names. changed store_warning() -> push_warning_print()
		
			
				
	
	
		
			24 lines
		
	
	
		
			631 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			631 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
#
 | 
						|
# Test syntax of foreign keys
 | 
						|
#
 | 
						|
 | 
						|
--disable_warnings
 | 
						|
drop table if exists t1;
 | 
						|
--enable_warnings
 | 
						|
 | 
						|
create table t1 (
 | 
						|
	a int not null references t2,
 | 
						|
	b int not null references t2 (c),
 | 
						|
	primary key (a,b),
 | 
						|
	foreign key (a) references t3 match full,
 | 
						|
	foreign key (a) references t3 match partial,
 | 
						|
	foreign key (a,b) references t3 (c,d) on delete no action
 | 
						|
	  on update no action,
 | 
						|
	foreign key (a,b) references t3 (c,d) on update cascade,
 | 
						|
	foreign key (a,b) references t3 (c,d) on delete set default,
 | 
						|
	foreign key (a,b) references t3 (c,d) on update set null);
 | 
						|
 | 
						|
create index a on t1 (a);
 | 
						|
create unique index b on t1 (a,b);
 | 
						|
drop table t1;
 |