|
53 | 53 | Page header: |
54 | 54 |
|
55 | 55 | LSN 7 bytes Log position for last page change |
56 | | - PAGE_TYPE 1 uchar 1 for head / 2 for tail / 3 for blob |
| 56 | + PAGE_TYPE 1 uchar 0 unalloced / 1 for head / 2 for tail / 3 for blob |
57 | 57 | DIR_COUNT 1 uchar Number of row/tail entries on page |
58 | 58 | FREE_DIR_LINK 1 uchar Pointer to first free director entry or 255 if no |
59 | | - empty space 2 bytes Empty space on page |
| 59 | + empty space 2 bytes Bytes of empty space on page |
60 | 60 |
|
61 | 61 | The most significant bit in PAGE_TYPE is set to 1 if the data on the page |
62 | 62 | can be compacted to get more space. (PAGE_CAN_BE_COMPACTED) |
@@ -5122,11 +5122,19 @@ int _ma_read_block_record(MARIA_HA *info, uchar *record, |
5122 | 5122 | info->buff, share->page_type, |
5123 | 5123 | PAGECACHE_LOCK_LEFT_UNLOCKED, 0))) |
5124 | 5124 | DBUG_RETURN(my_errno); |
5125 | | - DBUG_ASSERT((buff[PAGE_TYPE_OFFSET] & PAGE_TYPE_MASK) == HEAD_PAGE); |
5126 | | - if (!(data= get_record_position(buff, block_size, offset, &end_of_data))) |
| 5125 | + |
| 5126 | + /* |
| 5127 | + Unallocated page access can happen if this is an access to a page where |
| 5128 | + all rows where deleted as part of this statement. |
| 5129 | + */ |
| 5130 | + DBUG_ASSERT((buff[PAGE_TYPE_OFFSET] & PAGE_TYPE_MASK) == HEAD_PAGE || |
| 5131 | + (buff[PAGE_TYPE_OFFSET] & PAGE_TYPE_MASK) == UNALLOCATED_PAGE); |
| 5132 | + |
| 5133 | + if (((buff[PAGE_TYPE_OFFSET] & PAGE_TYPE_MASK) == UNALLOCATED_PAGE) || |
| 5134 | + !(data= get_record_position(buff, block_size, offset, &end_of_data))) |
5127 | 5135 | { |
5128 | 5136 | DBUG_ASSERT(!maria_assert_if_crashed_table); |
5129 | | - DBUG_PRINT("error", ("Wrong directory entry in data block")); |
| 5137 | + DBUG_PRINT("warning", ("Wrong directory entry in data block")); |
5130 | 5138 | my_errno= HA_ERR_RECORD_DELETED; /* File crashed */ |
5131 | 5139 | DBUG_RETURN(HA_ERR_RECORD_DELETED); |
5132 | 5140 | } |
|
0 commit comments