Commit 8958f062 authored by marko's avatar marko

branches/zip: Introduce the page type code FIL_PAGE_TYPE_ZBLOB2 for

continuation pages containing compressed BLOBs.  The first compressed
BLOB page will be of type FIL_PAGE_TYPE_ZBLOB.
parent b52a30e0
...@@ -3856,7 +3856,9 @@ btr_store_big_rec_extern_fields( ...@@ -3856,7 +3856,9 @@ btr_store_big_rec_extern_fields(
page_zip_des_t* blob_page_zip; page_zip_des_t* blob_page_zip;
mach_write_to_2(page + FIL_PAGE_TYPE, mach_write_to_2(page + FIL_PAGE_TYPE,
FIL_PAGE_TYPE_ZBLOB); prev_page_no == FIL_NULL
? FIL_PAGE_TYPE_ZBLOB
: FIL_PAGE_TYPE_ZBLOB2);
c_stream.next_out = page c_stream.next_out = page
+ FIL_PAGE_DATA; + FIL_PAGE_DATA;
...@@ -4174,7 +4176,13 @@ btr_free_externally_stored_field( ...@@ -4174,7 +4176,13 @@ btr_free_externally_stored_field(
if (ext_zip_size) { if (ext_zip_size) {
/* Note that page_zip will be NULL /* Note that page_zip will be NULL
in row_purge_upd_exist_or_extern(). */ in row_purge_upd_exist_or_extern(). */
ut_a(fil_page_get_type(page) == FIL_PAGE_TYPE_ZBLOB); switch (fil_page_get_type(page)) {
case FIL_PAGE_TYPE_ZBLOB:
case FIL_PAGE_TYPE_ZBLOB2:
break;
default:
ut_error;
}
next_page_no = mach_read_from_4(page + FIL_PAGE_NEXT); next_page_no = mach_read_from_4(page + FIL_PAGE_NEXT);
btr_page_free_low(index, ext_block, 0, &mtr); btr_page_free_low(index, ext_block, 0, &mtr);
...@@ -4405,6 +4413,8 @@ btr_copy_zblob_prefix( ...@@ -4405,6 +4413,8 @@ btr_copy_zblob_prefix(
ut_ad(zip_size <= UNIV_PAGE_SIZE); ut_ad(zip_size <= UNIV_PAGE_SIZE);
ut_ad(space_id); ut_ad(space_id);
ulint page_type = FIL_PAGE_TYPE_ZBLOB;
for (;;) { for (;;) {
buf_page_t* bpage; buf_page_t* bpage;
int err; int err;
...@@ -4426,11 +4436,11 @@ btr_copy_zblob_prefix( ...@@ -4426,11 +4436,11 @@ btr_copy_zblob_prefix(
return; return;
} }
if (UNIV_UNLIKELY(fil_page_get_type(bpage->zip.data) if (UNIV_UNLIKELY
!= FIL_PAGE_TYPE_ZBLOB)) { (fil_page_get_type(bpage->zip.data) != page_type)) {
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
" InnoDB: Unknown type %lu of" " InnoDB: Unexpected type %lu of"
" compressed BLOB" " compressed BLOB"
" page %lu space %lu\n", " page %lu space %lu\n",
(ulong) fil_page_get_type(bpage->zip.data), (ulong) fil_page_get_type(bpage->zip.data),
...@@ -4509,6 +4519,7 @@ btr_copy_zblob_prefix( ...@@ -4509,6 +4519,7 @@ btr_copy_zblob_prefix(
page_no = next_page_no; page_no = next_page_no;
offset = FIL_PAGE_NEXT; offset = FIL_PAGE_NEXT;
page_type = FIL_PAGE_TYPE_ZBLOB2;
} }
} }
......
...@@ -441,6 +441,7 @@ buf_page_print( ...@@ -441,6 +441,7 @@ buf_page_print(
switch (fil_page_get_type(read_buf)) { switch (fil_page_get_type(read_buf)) {
case FIL_PAGE_TYPE_ZBLOB: case FIL_PAGE_TYPE_ZBLOB:
case FIL_PAGE_TYPE_ZBLOB2:
checksum = srv_use_checksums checksum = srv_use_checksums
? page_zip_calc_checksum(read_buf, zip_size) ? page_zip_calc_checksum(read_buf, zip_size)
: BUF_NO_CHECKSUM_MAGIC; : BUF_NO_CHECKSUM_MAGIC;
...@@ -608,6 +609,7 @@ buf_page_print( ...@@ -608,6 +609,7 @@ buf_page_print(
stderr); stderr);
break; break;
case FIL_PAGE_TYPE_ZBLOB: case FIL_PAGE_TYPE_ZBLOB:
case FIL_PAGE_TYPE_ZBLOB2:
fputs("InnoDB: Page may be a compressed BLOB page\n", fputs("InnoDB: Page may be a compressed BLOB page\n",
stderr); stderr);
break; break;
...@@ -1502,7 +1504,8 @@ buf_page_reset_file_page_was_freed( ...@@ -1502,7 +1504,8 @@ buf_page_reset_file_page_was_freed(
#endif /* UNIV_DEBUG_FILE_ACCESSES */ #endif /* UNIV_DEBUG_FILE_ACCESSES */
/************************************************************************ /************************************************************************
Get read access to a compressed page (usually FIL_PAGE_TYPE_ZBLOB). Get read access to a compressed page (usually of type
FIL_PAGE_TYPE_ZBLOB or FIL_PAGE_TYPE_ZBLOB2).
The page must be released with buf_page_release_zip(). The page must be released with buf_page_release_zip().
NOTE: the page is not protected by any latch. Mutual exclusion has to NOTE: the page is not protected by any latch. Mutual exclusion has to
be implemented at a higher level. In other words, all possible be implemented at a higher level. In other words, all possible
...@@ -1695,6 +1698,7 @@ buf_zip_decompress( ...@@ -1695,6 +1698,7 @@ buf_zip_decompress(
case FIL_PAGE_TYPE_FSP_HDR: case FIL_PAGE_TYPE_FSP_HDR:
case FIL_PAGE_TYPE_XDES: case FIL_PAGE_TYPE_XDES:
case FIL_PAGE_TYPE_ZBLOB: case FIL_PAGE_TYPE_ZBLOB:
case FIL_PAGE_TYPE_ZBLOB2:
/* Copy to uncompressed storage. */ /* Copy to uncompressed storage. */
memcpy(block->frame, frame, memcpy(block->frame, frame,
buf_block_get_zip_size(block)); buf_block_get_zip_size(block));
......
...@@ -617,6 +617,7 @@ buf_flush_init_for_writing( ...@@ -617,6 +617,7 @@ buf_flush_init_for_writing(
memcpy(page_zip->data, page, zip_size); memcpy(page_zip->data, page, zip_size);
/* fall through */ /* fall through */
case FIL_PAGE_TYPE_ZBLOB: case FIL_PAGE_TYPE_ZBLOB:
case FIL_PAGE_TYPE_ZBLOB2:
case FIL_PAGE_INDEX: case FIL_PAGE_INDEX:
mach_write_ull(page_zip->data mach_write_ull(page_zip->data
+ FIL_PAGE_LSN, newest_lsn); + FIL_PAGE_LSN, newest_lsn);
......
...@@ -1235,6 +1235,7 @@ buf_LRU_block_remove_hashed_page( ...@@ -1235,6 +1235,7 @@ buf_LRU_block_remove_hashed_page(
} }
break; break;
case FIL_PAGE_TYPE_ZBLOB: case FIL_PAGE_TYPE_ZBLOB:
case FIL_PAGE_TYPE_ZBLOB2:
break; break;
case FIL_PAGE_INDEX: case FIL_PAGE_INDEX:
#ifdef UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
......
...@@ -228,7 +228,8 @@ buf_page_try_get_func( ...@@ -228,7 +228,8 @@ buf_page_try_get_func(
buf_page_try_get_func(space_id, page_no, __FILE__, __LINE__, mtr); buf_page_try_get_func(space_id, page_no, __FILE__, __LINE__, mtr);
/************************************************************************ /************************************************************************
Get read access to a compressed page (usually FIL_PAGE_TYPE_ZBLOB). Get read access to a compressed page (usually of type
FIL_PAGE_TYPE_ZBLOB or FIL_PAGE_TYPE_ZBLOB2).
The page must be released with buf_page_release_zip(). The page must be released with buf_page_release_zip().
NOTE: the page is not protected by any latch. Mutual exclusion has to NOTE: the page is not protected by any latch. Mutual exclusion has to
be implemented at a higher level. In other words, all possible be implemented at a higher level. In other words, all possible
......
...@@ -117,7 +117,8 @@ extern fil_addr_t fil_addr_null; ...@@ -117,7 +117,8 @@ extern fil_addr_t fil_addr_null;
#define FIL_PAGE_TYPE_FSP_HDR 8 /* File space header */ #define FIL_PAGE_TYPE_FSP_HDR 8 /* File space header */
#define FIL_PAGE_TYPE_XDES 9 /* Extent descriptor page */ #define FIL_PAGE_TYPE_XDES 9 /* Extent descriptor page */
#define FIL_PAGE_TYPE_BLOB 10 /* Uncompressed BLOB page */ #define FIL_PAGE_TYPE_BLOB 10 /* Uncompressed BLOB page */
#define FIL_PAGE_TYPE_ZBLOB 11 /* Compressed BLOB page */ #define FIL_PAGE_TYPE_ZBLOB 11 /* First compressed BLOB page */
#define FIL_PAGE_TYPE_ZBLOB2 12 /* Subsequent compressed BLOB page */
/* Space types */ /* Space types */
#define FIL_TABLESPACE 501 #define FIL_TABLESPACE 501
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment