Commit a95711e4 authored by Jan Lindström's avatar Jan Lindström

MDEV-8855: innodb.innodb-fk-warnings fails on Windows

Fixed incorrect access to freed memory.
parent 02a38fd2
...@@ -4225,7 +4225,6 @@ col_loop2: ...@@ -4225,7 +4225,6 @@ col_loop2:
ptr = dict_accept(cs, ptr, ")", &success); ptr = dict_accept(cs, ptr, ")", &success);
if (!success || foreign->n_fields != i) { if (!success || foreign->n_fields != i) {
dict_foreign_free(foreign);
dict_foreign_report_syntax_err( dict_foreign_report_syntax_err(
"%s table %s with foreign key constraint" "%s table %s with foreign key constraint"
...@@ -4238,6 +4237,9 @@ col_loop2: ...@@ -4238,6 +4237,9 @@ col_loop2:
" failed. Foreign key constraint parse error in %s" " failed. Foreign key constraint parse error in %s"
" close to %s. Too few referenced columns, you have %d when you should have %d.", " close to %s. Too few referenced columns, you have %d when you should have %d.",
operation, create_name, start_of_latest_foreign, orig, i, foreign->n_fields); operation, create_name, start_of_latest_foreign, orig, i, foreign->n_fields);
dict_foreign_free(foreign);
return(DB_CANNOT_ADD_CONSTRAINT); return(DB_CANNOT_ADD_CONSTRAINT);
} }
......
...@@ -4357,7 +4357,6 @@ col_loop2: ...@@ -4357,7 +4357,6 @@ col_loop2:
ptr = dict_accept(cs, ptr, ")", &success); ptr = dict_accept(cs, ptr, ")", &success);
if (!success || foreign->n_fields != i) { if (!success || foreign->n_fields != i) {
dict_foreign_free(foreign);
dict_foreign_report_syntax_err( dict_foreign_report_syntax_err(
"%s table %s with foreign key constraint" "%s table %s with foreign key constraint"
...@@ -4370,6 +4369,9 @@ col_loop2: ...@@ -4370,6 +4369,9 @@ col_loop2:
" failed. Foreign key constraint parse error in %s" " failed. Foreign key constraint parse error in %s"
" close to %s. Too few referenced columns, you have %d when you should have %d.", " close to %s. Too few referenced columns, you have %d when you should have %d.",
operation, create_name, start_of_latest_foreign, orig, i, foreign->n_fields); operation, create_name, start_of_latest_foreign, orig, i, foreign->n_fields);
dict_foreign_free(foreign);
return(DB_CANNOT_ADD_CONSTRAINT); return(DB_CANNOT_ADD_CONSTRAINT);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment