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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user