[Commits] Rev 3004: Fixed overwrite of directory information on the row page. in lp:maria/5.1

Michael Widenius monty at askmonty.org
Wed Jan 5 15:46:45 EET 2011


At lp:maria/5.1

------------------------------------------------------------
revno: 3004
revision-id: monty at askmonty.org-20110105134644-smm0yb1xacf5w12u
parent: monty at askmonty.org-20110105130906-1keqat4xx3rnfq9o
committer: Michael Widenius <monty at askmonty.org>
branch nick: maria-5.1
timestamp: Wed 2011-01-05 15:46:44 +0200
message:
  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.
-------------- next part --------------
=== modified file 'storage/maria/ma_blockrec.c'
--- a/storage/maria/ma_blockrec.c	2011-01-04 22:09:05 +0000
+++ b/storage/maria/ma_blockrec.c	2011-01-05 13:46:44 +0000
@@ -2816,7 +2816,6 @@ static my_bool write_block_record(MARIA_
   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_
     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_
 
   /* 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);



More information about the commits mailing list