1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Fix for #1189 (Mess with names about CONSTRAINT)

Second edition: error message was deleted as Segey suggested
Now name of the constraint will be used as the name of the key
if the last not specified
This commit is contained in:
hf@deer.(none)
2003-12-02 19:06:24 +04:00
parent 05e4d9031b
commit 02f382ecaa
3 changed files with 37 additions and 9 deletions

View File

@ -14,3 +14,16 @@ 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`)
) TYPE=MyISAM DEFAULT CHARSET=latin1
drop table t1;

View File

@ -21,3 +21,9 @@ 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;
drop table t1;