mirror of
https://github.com/MariaDB/server.git
synced 2025-09-11 05:52:26 +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 BitKeeper/etc/ignore: added *.d include/my_base.h: Added flag for automaticly generated key mysql-test/r/constraints.result: Update tests after bug fix mysql-test/r/create.result: Update tests after bug fix mysql-test/r/innodb.result: Added test of automatic creation of foreign keys mysql-test/t/innodb.test: Added test of automatic creation of foreign keys mysql-test/t/key_cache.test: Portability fixes (64 BIT os) sql/sql_acl.cc: Indentation fixes sql/sql_class.cc: Fix key comparison to handle prefix and optionally key segments in different order. sql/sql_class.h: Added flag for automaticly generated keys sql/sql_parse.cc: Added flag for automaticly generated keys sql/sql_table.cc: 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 conflicting automatic keys, prefer the longer one. sql/sql_yacc.yy: Added flag for automaticly generated keys strings/strings-x86.s: Portability fix.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user