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(
page_zip_des_t* blob_page_zip;
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
+ FIL_PAGE_DATA;
......@@ -4174,7 +4176,13 @@ btr_free_externally_stored_field(
if (ext_zip_size) {
/* Note that page_zip will be NULL
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);
btr_page_free_low(index, ext_block, 0, &mtr);
......@@ -4405,6 +4413,8 @@ btr_copy_zblob_prefix(
ut_ad(zip_size <= UNIV_PAGE_SIZE);
ut_ad(space_id);
ulint page_type = FIL_PAGE_TYPE_ZBLOB;
for (;;) {
buf_page_t* bpage;
int err;
......@@ -4426,11 +4436,11 @@ btr_copy_zblob_prefix(
return;
}
if (UNIV_UNLIKELY(fil_page_get_type(bpage->zip.data)
!= FIL_PAGE_TYPE_ZBLOB)) {
if (UNIV_UNLIKELY
(fil_page_get_type(bpage->zip.data) != page_type)) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Unknown type %lu of"
" InnoDB: Unexpected type %lu of"
" compressed BLOB"
" page %lu space %lu\n",
(ulong) fil_page_get_type(bpage->zip.data),
......@@ -4509,6 +4519,7 @@ btr_copy_zblob_prefix(
page_no = next_page_no;
offset = FIL_PAGE_NEXT;
page_type = FIL_PAGE_TYPE_ZBLOB2;
}
}
......
......@@ -441,6 +441,7 @@ buf_page_print(
switch (fil_page_get_type(read_buf)) {
case FIL_PAGE_TYPE_ZBLOB:
case FIL_PAGE_TYPE_ZBLOB2:
checksum = srv_use_checksums
? page_zip_calc_checksum(read_buf, zip_size)
: BUF_NO_CHECKSUM_MAGIC;
......@@ -608,6 +609,7 @@ buf_page_print(
stderr);
break;
case FIL_PAGE_TYPE_ZBLOB:
case FIL_PAGE_TYPE_ZBLOB2:
fputs("InnoDB: Page may be a compressed BLOB page\n",
stderr);
break;
......@@ -1502,7 +1504,8 @@ buf_page_reset_file_page_was_freed(
#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().
NOTE: the page is not protected by any latch. Mutual exclusion has to
be implemented at a higher level. In other words, all possible
......@@ -1695,6 +1698,7 @@ buf_zip_decompress(
case FIL_PAGE_TYPE_FSP_HDR:
case FIL_PAGE_TYPE_XDES:
case FIL_PAGE_TYPE_ZBLOB:
case FIL_PAGE_TYPE_ZBLOB2:
/* Copy to uncompressed storage. */
memcpy(block->frame, frame,
buf_block_get_zip_size(block));
......
......@@ -617,6 +617,7 @@ buf_flush_init_for_writing(
memcpy(page_zip->data, page, zip_size);
/* fall through */
case FIL_PAGE_TYPE_ZBLOB:
case FIL_PAGE_TYPE_ZBLOB2:
case FIL_PAGE_INDEX:
mach_write_ull(page_zip->data
+ FIL_PAGE_LSN, newest_lsn);
......
......@@ -1235,6 +1235,7 @@ buf_LRU_block_remove_hashed_page(
}
break;
case FIL_PAGE_TYPE_ZBLOB:
case FIL_PAGE_TYPE_ZBLOB2:
break;
case FIL_PAGE_INDEX:
#ifdef UNIV_ZIP_DEBUG
......
......@@ -228,7 +228,8 @@ buf_page_try_get_func(
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().
NOTE: the page is not protected by any latch. Mutual exclusion has to
be implemented at a higher level. In other words, all possible
......
......@@ -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_XDES 9 /* Extent descriptor 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 */
#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