mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 05:22:25 +01:00
c9e1538298
Remove redundant keys in CREATE TABLE and ALTER TABLE mysql-test/r/constraints.result: Remove redundant keys mysql-test/r/create.result: Remove redundant keys mysql-test/r/innodb.result: Remove redundant keys mysql-test/r/range.result: Remove redundant keys mysql-test/t/range.test: Remove redundant keys sql/sql_class.cc: Equality comparison of keys (ignoring name) sql/sql_class.h: Equality comparison of keys (ignoring name) sql/sql_table.cc: Remove redundant keys sql/sql_yacc.yy: Introduce keys in child tables corresponding to FOREIGN KEYs
27 lines
831 B
Text
27 lines
831 B
Text
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`)
|
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
|
drop table t1;
|