summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 8d5ec56add9..e017bc7e6b5 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -684,12 +684,13 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
while ((key2 = key_iterator2++) != key)
{
/*
- foreign_key_prefix(key, key2) returns 0 if key or key2, or both, is
- 'generated', and a generated key is a prefix of the other key. Then we
- do not need the generated shorter key.
+ foreign_key_prefix(key, key2) returns 0 if key or key2, or both, is
+ 'generated', and a generated key is a prefix of the other key.
+ Then we do not need the generated shorter key.
*/
- if (key2->name != ignore_key && key2->type != Key::FOREIGN_KEY &&
- !foreign_key_prefix(key, key2))
+ if ((key2->type != Key::FOREIGN_KEY &&
+ key2->name != ignore_key &&
+ !foreign_key_prefix(key, key2)))
{
/* TODO: issue warning message */
/* mark that the generated key should be ignored */