branches/zip: page_zip_rec_needs_ext(): Fix a bug that was introduced

in the fix of Mantis issue #73.  With key_block_size=16, we will also
have to check the available space on the uncompressed page.
Otherwise, the clustered index record can be almost 16 kilobytes in
size, and the undo log record will not fit.
This commit is contained in:
marko 2008-10-22 06:07:37 +00:00
parent 3df06e715c
commit 84bac79e51

View file

@ -168,9 +168,11 @@ page_zip_rec_needs_ext(
the dense page directory for every record. But there
is no record header. There should be enough room for
one record on an empty leaf page. Subtract 1 byte for
the encoded heap number. */
the encoded heap number. Check also the available space
on the uncompressed page. */
return(rec_size - (REC_N_NEW_EXTRA_BYTES - 2)
>= (page_zip_empty_size(n_fields, zip_size) - 1));
>= (page_zip_empty_size(n_fields, zip_size) - 1)
|| rec_size >= page_get_free_space_of_empty(TRUE) / 2);
}
return(rec_size >= page_get_free_space_of_empty(comp) / 2);