diff options
author | Michael Widenius <monty@askmonty.org> | 2011-01-05 15:46:44 +0200 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2011-01-05 15:46:44 +0200 |
commit | 6b03fbf9fcacc74cb2999ba7715d22d754f356c7 (patch) | |
tree | b1d77e0b0fb53ba387182e7acaf581241f77b56c | |
parent | ab32ce9aa7fb09b2fb578e5bb44f004092bf1d89 (diff) | |
download | mariadb-git-6b03fbf9fcacc74cb2999ba7715d22d754f356c7.tar.gz |
Fixed overwrite of directory information on the row page.
This could only happen with very small rows on very full pages with old deleted information in middle of page.
-rw-r--r-- | storage/maria/ma_blockrec.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/storage/maria/ma_blockrec.c b/storage/maria/ma_blockrec.c index abad594ad18..dab88287f86 100644 --- a/storage/maria/ma_blockrec.c +++ b/storage/maria/ma_blockrec.c @@ -2816,7 +2816,6 @@ static my_bool write_block_record(MARIA_HA *info, DBUG_PRINT("info", ("Used head length on page: %u header_length: %u", head_length, (uint) (flag & ROW_FLAG_TRANSID ? TRANSID_SIZE : 0))); - DBUG_ASSERT(data <= end_of_data); if (head_length < share->base.min_block_length) { /* Extend row to be of size min_block_length */ @@ -2825,6 +2824,7 @@ static my_bool write_block_record(MARIA_HA *info, data+= diff_length; head_length= share->base.min_block_length; } + DBUG_ASSERT(data <= end_of_data); /* If this is a redo entry (ie, undo_lsn != LSN_ERROR) then we should have written exactly head_length bytes (same as original record). @@ -3492,7 +3492,9 @@ static my_bool allocate_and_write_block_record(MARIA_HA *info, /* page will be pinned & locked by get_head_or_tail_page */ if (get_head_or_tail_page(info, blocks->block, info->buff, - row->space_on_head_page, HEAD_PAGE, + max(row->space_on_head_page, + info->s->base.min_block_length), + HEAD_PAGE, PAGECACHE_LOCK_WRITE, &row_pos)) goto err; row->lastpos= ma_recordpos(blocks->block->page, row_pos.rownr); |