diff options
author | unknown <heikki@hundin.mysql.fi> | 2005-01-21 17:54:50 +0200 |
---|---|---|
committer | unknown <heikki@hundin.mysql.fi> | 2005-01-21 17:54:50 +0200 |
commit | 5e98f462bed44f1f6e0bb541368685f51d63815a (patch) | |
tree | 0478019c29ffed355aa89981e4d651f459e8bfcd /innobase/dict/dict0dict.c | |
parent | 5556f53d097d5fea15f8f3ab99dfe1a58639ecd9 (diff) | |
download | mariadb-git-5e98f462bed44f1f6e0bb541368685f51d63815a.tar.gz |
dict0dict.c:
Fix bug #7831: ALTER TABLE ... ADD CONSTRAINT PRIMARY KEY ... complained about bad foreign key definition
innobase/dict/dict0dict.c:
Fix bug #7831: ALTER TABLE ... ADD CONSTRAINT PRIMARY KEY ... complained about bad foreign key definition
Diffstat (limited to 'innobase/dict/dict0dict.c')
-rw-r--r-- | innobase/dict/dict0dict.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c index 2e6504cac11..186f3be2f31 100644 --- a/innobase/dict/dict0dict.c +++ b/innobase/dict/dict0dict.c @@ -2895,9 +2895,9 @@ loop: constraint_name = NULL; if (ptr1 < ptr2) { - /* The user has specified a constraint name. Pick it so + /* The user may have specified a constraint name. Pick it so that we can store 'databasename/constraintname' as the id of - the id of the constraint to system tables. */ + of the constraint to system tables. */ ptr = ptr1; ptr = dict_accept(ptr, "CONSTRAINT", &success); @@ -2934,6 +2934,10 @@ loop: ptr = dict_accept(ptr, "FOREIGN", &success); + if (!success) { + goto loop; + } + if (!isspace(*ptr)) { goto loop; } |