1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-10421 duplicate CHECK CONSTRAINTs.

mysql_prepare_create_table fixed so it doesn't let duplicating
        constraint names. Syntax for CONSTRAINT IF NOT EXISTS added
        and handled in mysql_alter_table.
This commit is contained in:
Alexey Botchkov
2016-09-06 14:42:33 +04:00
parent 00dfe27f7c
commit 225440047d
10 changed files with 107 additions and 8 deletions

View File

@@ -3003,9 +3003,12 @@ public:
return false;
}
// Add a constraint as a part of CREATE TABLE or ALTER TABLE
bool add_constraint(LEX_STRING *name, Virtual_column_info *constr)
bool add_constraint(LEX_STRING *name, Virtual_column_info *constr,
bool if_not_exists)
{
constr->name= *name;
constr->flags= if_not_exists ?
Alter_info::CHECK_CONSTRAINT_IF_NOT_EXISTS : 0;
alter_info.check_constraint_list.push_back(constr);
return false;
}