summaryrefslogtreecommitdiff
path: root/innobase/row/row0ins.c
diff options
context:
space:
mode:
Diffstat (limited to 'innobase/row/row0ins.c')
-rw-r--r--innobase/row/row0ins.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/innobase/row/row0ins.c b/innobase/row/row0ins.c
index 5e833372299..32aa0385596 100644
--- a/innobase/row/row0ins.c
+++ b/innobase/row/row0ins.c
@@ -588,20 +588,21 @@ row_ins_set_detailed(
trx_t* trx, /* in: transaction */
dict_foreign_t* foreign) /* in: foreign key constraint */
{
-
- FILE* tf = os_file_create_tmpfile();
-
- if (tf) {
- ut_print_name(tf, trx, foreign->foreign_table_name);
- dict_print_info_on_foreign_key_in_create_format(tf, trx,
- foreign, FALSE);
-
- trx_set_detailed_error_from_file(trx, tf);
-
- fclose(tf);
+ mutex_enter(&srv_misc_tmpfile_mutex);
+ rewind(srv_misc_tmpfile);
+
+ if (os_file_set_eof(srv_misc_tmpfile)) {
+ ut_print_name(srv_misc_tmpfile, trx,
+ foreign->foreign_table_name);
+ dict_print_info_on_foreign_key_in_create_format(
+ srv_misc_tmpfile,
+ trx, foreign, FALSE);
+ trx_set_detailed_error_from_file(trx, srv_misc_tmpfile);
} else {
- trx_set_detailed_error(trx, "temp file creation failed");
+ trx_set_detailed_error(trx, "temp file operation failed");
}
+
+ mutex_exit(&srv_misc_tmpfile_mutex);
}
/*************************************************************************
@@ -709,7 +710,7 @@ row_ins_foreign_report_add_err(
}
if (rec) {
- rec_print(ef, rec, foreign->foreign_index);
+ rec_print(ef, rec, foreign->referenced_index);
}
putc('\n', ef);