Commit 5d0b073d authored by marko's avatar marko

trunk: Remove error introduced in r87 of branches/5.0, ported in r88:

In row_ins_set_detailed(), truncate the tmpfile by os_file_set_eof(), because
trx_set_detailed_error_from_file() does not call ftell() to determine
the actual length of the file.  This bug resulted in trash being appended
to foreign key error messages.
parent 389c33b7
......@@ -591,10 +591,16 @@ row_ins_set_detailed(
mutex_enter(&srv_misc_tmpfile_mutex);
rewind(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,
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 operation failed");
}
mutex_exit(&srv_misc_tmpfile_mutex);
}
......
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