mirror of
				https://github.com/MariaDB/server.git
				synced 2025-10-31 15:50:51 +03:00 
			
		
		
		
	Prefer not automatic keys before automatic keys. If there is two conf BitKeeper/etc/ignore: added *.d include/my_base.h: Added flag for automaticly generated key mysql-test/r/constraints.result: Update tests after bug fix mysql-test/r/create.result: Update tests after bug fix mysql-test/r/innodb.result: Added test of automatic creation of foreign keys mysql-test/t/innodb.test: Added test of automatic creation of foreign keys mysql-test/t/key_cache.test: Portability fixes (64 BIT os) sql/sql_acl.cc: Indentation fixes sql/sql_class.cc: Fix key comparison to handle prefix and optionally key segments in different order. sql/sql_class.h: Added flag for automaticly generated keys sql/sql_parse.cc: Added flag for automaticly generated keys sql/sql_table.cc: Don't automaticly generate a new key for a foreign key constraint if there is already a usable key. Prefer not automatic keys before automatic keys. If there is two conflicting automatic keys, prefer the longer one. sql/sql_yacc.yy: Added flag for automaticly generated keys strings/strings-x86.s: Portability fix.
		
			
				
	
	
		
			30 lines
		
	
	
		
			887 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			887 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| drop table if exists t1;
 | |
| create table t1 (a int check (a>0));
 | |
| insert into t1 values (1);
 | |
| insert into t1 values (0);
 | |
| drop table t1;
 | |
| create table t1 (a int ,b int, check a>b);
 | |
| insert into t1 values (1,0);
 | |
| insert into t1 values (0,1);
 | |
| drop table t1;
 | |
| create table t1 (a int ,b int, constraint abc check (a>b));
 | |
| insert into t1 values (1,0);
 | |
| insert into t1 values (0,1);
 | |
| drop table t1;
 | |
| create table t1 (a int null);
 | |
| insert into t1 values (1),(NULL);
 | |
| drop table t1;
 | |
| create table t1 (a int null);
 | |
| alter table t1 add constraint constraint_1 unique (a);
 | |
| alter table t1 add constraint unique key_1(a);
 | |
| alter table t1 add constraint constraint_2 unique key_2(a);
 | |
| show create table t1;
 | |
| Table	Create Table
 | |
| t1	CREATE TABLE `t1` (
 | |
|   `a` int(11) default NULL,
 | |
|   UNIQUE KEY `constraint_1` (`a`),
 | |
|   UNIQUE KEY `key_1` (`a`),
 | |
|   UNIQUE KEY `key_2` (`a`)
 | |
| ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 | |
| drop table t1;
 |