1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

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 conf
This commit is contained in:
monty@mysql.com
2004-05-12 00:29:52 +03:00
parent 6ad9691dc8
commit 116f61c656
14 changed files with 298 additions and 49 deletions

View File

@@ -3958,13 +3958,13 @@ bool add_field_to_list(THD *thd, char *field_name, enum_field_types type,
{
lex->col_list.push_back(new key_part_spec(field_name,0));
lex->key_list.push_back(new Key(Key::PRIMARY, NullS, HA_KEY_ALG_UNDEF,
lex->col_list));
0, lex->col_list));
lex->col_list.empty();
}
if (type_modifier & (UNIQUE_FLAG | UNIQUE_KEY_FLAG))
{
lex->col_list.push_back(new key_part_spec(field_name,0));
lex->key_list.push_back(new Key(Key::UNIQUE, NullS, HA_KEY_ALG_UNDEF,
lex->key_list.push_back(new Key(Key::UNIQUE, NullS, HA_KEY_ALG_UNDEF, 0,
lex->col_list));
lex->col_list.empty();
}