diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2018-09-06 22:45:19 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2018-09-06 22:45:19 +0200 |
commit | 31081593aabb116b6d8f86b6c7e76126edb392b4 (patch) | |
tree | 767a069f255359b5ea37e7c491dfeacf6e519fad /storage/maria/ma_blockrec.c | |
parent | b0026e33af8fc3b25a42099c096a84591fd550e2 (diff) | |
parent | 3a4242fd57b3a2235d2478ed080941b67a82ad1b (diff) | |
download | mariadb-git-31081593aabb116b6d8f86b6c7e76126edb392b4.tar.gz |
Merge branch '11.0' into 10.1
Diffstat (limited to 'storage/maria/ma_blockrec.c')
-rw-r--r-- | storage/maria/ma_blockrec.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/storage/maria/ma_blockrec.c b/storage/maria/ma_blockrec.c index c0a93415379..8ef463d2918 100644 --- a/storage/maria/ma_blockrec.c +++ b/storage/maria/ma_blockrec.c @@ -53,10 +53,10 @@ Page header: LSN 7 bytes Log position for last page change - PAGE_TYPE 1 uchar 1 for head / 2 for tail / 3 for blob + PAGE_TYPE 1 uchar 0 unalloced / 1 for head / 2 for tail / 3 for blob DIR_COUNT 1 uchar Number of row/tail entries on page FREE_DIR_LINK 1 uchar Pointer to first free director entry or 255 if no - empty space 2 bytes Empty space on page + empty space 2 bytes Bytes of empty space on page The most significant bit in PAGE_TYPE is set to 1 if the data on the page can be compacted to get more space. (PAGE_CAN_BE_COMPACTED) @@ -5161,11 +5161,19 @@ int _ma_read_block_record(MARIA_HA *info, uchar *record, info->buff, share->page_type, PAGECACHE_LOCK_LEFT_UNLOCKED, 0))) DBUG_RETURN(my_errno); + + /* + Unallocated page access can happen if this is an access to a page where + all rows where deleted as part of this statement. + */ + DBUG_ASSERT((buff[PAGE_TYPE_OFFSET] & PAGE_TYPE_MASK) == HEAD_PAGE || + (buff[PAGE_TYPE_OFFSET] & PAGE_TYPE_MASK) == UNALLOCATED_PAGE); + DBUG_ASSERT((buff[PAGE_TYPE_OFFSET] & PAGE_TYPE_MASK) == HEAD_PAGE); if (!(data= get_record_position(share, buff, offset, &end_of_data))) { DBUG_ASSERT(!maria_assert_if_crashed_table); - DBUG_PRINT("error", ("Wrong directory entry in data block")); + DBUG_PRINT("warning", ("Wrong directory entry in data block")); my_errno= HA_ERR_RECORD_DELETED; /* File crashed */ DBUG_RETURN(HA_ERR_RECORD_DELETED); } |