branches/zip: row_merge_read_clustered_index(): After writing out the

merge buffer, write the next record to the beginning of the emptied buffer.
This fixes one of the bugs mentioned in r1872.
This commit is contained in:
marko 2007-09-21 14:33:49 +00:00
parent fabcf6389b
commit e4ed7666b4

View file

@ -1119,6 +1119,8 @@ row_merge_read_clustered_index(
continue;
}
/* The buffer must be sufficiently large
to hold at least one record. */
ut_ad(buf->n_tuples || !has_next);
/* We have enough data tuples to form a block.
@ -1143,6 +1145,16 @@ row_merge_read_clustered_index(
UNIV_MEM_INVALID(block[0], sizeof block[0]);
merge_buf[i] = row_merge_buf_empty(buf);
/* Try writing the record again, now that
the buffer has been written out and emptied. */
if (UNIV_UNLIKELY
(row && !row_merge_buf_add(buf, row, ext))) {
/* An empty buffer should have enough
room for at least one record. */
ut_error;
}
}
mem_heap_empty(row_heap);