8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 04:43:03 +01:00

Fixed bug CORE-2291 : BUGCHECK 284

This commit is contained in:
hvlad 2009-01-25 14:30:28 +00:00
parent d7f13f31c7
commit 9668dc5f49

View File

@ -3355,10 +3355,22 @@ static void restore_record(record_param* rpb)
if (rec_copy)
{
const USHORT size = rec_copy->rec_length;
if (!record || size > record->rec_length)
if (!record)
BUGCHECK(284); // msg 284 cannot restore singleton select data
record->rec_format = rec_copy->rec_format;
const USHORT size = rec_copy->rec_length;
if (size > record->rec_length)
{
// hvlad: saved copy of record have longer format, reallocate
// given record to make enough space for saved data
thread_db *tdbb = JRD_get_thread_data();
record = VIO_record(tdbb, rpb, rec_copy->rec_format, tdbb->getDefaultPool());
}
else
{
record->rec_length = size;
record->rec_format = rec_copy->rec_format;
}
record->rec_number = rec_copy->rec_number;
memcpy(record->rec_data, rec_copy->rec_data, size);