Commit 51436aa1 authored by marko's avatar marko

branches/zip: Document the minimum size of row_merge_block_t as UNIV_PAGE_SIZE.

row_merge_buf_add(): Add ut_ad(data_size < sizeof(row_merge_block_t))
and document why it may fail if sizeof row_merge_block_t < UNIV_PAGE_SIZE.
parent c6d6f1fa
......@@ -47,7 +47,12 @@ static ibool row_merge_print_read;
static ibool row_merge_print_write;
#endif /* UNIV_DEBUG */
/* Block size for I/O operations in merge sort */
/* Block size for I/O operations in merge sort. The minimum is
UNIV_PAGE_SIZE, or page_get_free_space_of_empty() rounded to a power of 2.
When not creating a PRIMARY KEY that contains column prefixes, this
can be set as small as UNIV_PAGE_SIZE / 2. See the comment above
ut_ad(data_size < sizeof(row_merge_block_t)). */
typedef byte row_merge_block_t[1048576];
......@@ -336,6 +341,14 @@ row_merge_buf_add(
of extra_size. */
data_size += (extra_size + 1) + ((extra_size + 1) >= 0x80);
/* The following assertion may fail if row_merge_block_t is
declared very small and a PRIMARY KEY is being created with
many prefix columns. In that case, the record may exceed the
page_zip_rec_needs_ext() limit. However, no further columns
will be moved to external storage until the record is inserted
to the clustered index B-tree. */
ut_ad(data_size < sizeof(row_merge_block_t));
/* Reserve one byte for the end marker of row_merge_block_t. */
if (buf->total_size + data_size >= sizeof(row_merge_block_t) - 1) {
return(FALSE);
......
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