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.
This commit is contained in:
marko 2005-12-09 07:46:45 +00:00
parent 389c33b746
commit 5d0b073d46

View file

@ -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);
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);
}