Commit b0d1eaab authored by Vasil Dimov's avatar Vasil Dimov

Merge from mysql-5.1-innodb:

  ------------------------------------------------------------
  revno: 3436
  revision-id: marko.makela@oracle.com-20100503122859-k73bl51re93o0mt4
  parent: vasil.dimov@oracle.com-20100430100236-9ncldjxpi14ec7el
  committer: Marko M?kel? <marko.makela@oracle.com>
  branch nick: 5.1-innodb
  timestamp: Mon 2010-05-03 15:28:59 +0300
  message:
    buf_zip_decompress(): Allow BUF_NO_CHECKSUM_MAGIC as the stamped checksum.
    buf_page_get_gen(): Assert that buf_zip_decompress() succeeds.
    Callers are not prepared for a NULL return value. (Bug #53248)
  modified:
    storage/innodb_plugin/ChangeLog 2425@16c675df-0fcb-4bc9-8058-dcc011a37293:branches%2Fzip%2FChangeLog
    storage/innodb_plugin/buf/buf0buf.c 2@16c675df-0fcb-4bc9-8058-dcc011a37293:trunk%2Fbuf%2Fbuf0buf.c
  ------------------------------------------------------------
parent bc3dc7df
......@@ -2457,14 +2457,14 @@ buf_zip_decompress(
buf_block_t* block, /*!< in/out: block */
ibool check) /*!< in: TRUE=verify the page checksum */
{
const byte* frame = block->page.zip.data;
const byte* frame = block->page.zip.data;
ulint stamp_checksum = mach_read_from_4(
frame + FIL_PAGE_SPACE_OR_CHKSUM);
ut_ad(buf_block_get_zip_size(block));
ut_a(buf_block_get_space(block) != 0);
if (UNIV_LIKELY(check)) {
ulint stamp_checksum = mach_read_from_4(
frame + FIL_PAGE_SPACE_OR_CHKSUM);
if (UNIV_LIKELY(check && stamp_checksum != BUF_NO_CHECKSUM_MAGIC)) {
ulint calc_checksum = page_zip_calc_checksum(
frame, page_zip_get_size(&block->page.zip));
......@@ -2970,8 +2970,9 @@ buf_page_get_gen(
/* Decompress the page and apply buffered operations
while not holding buf_pool->mutex or block->mutex. */
success = buf_zip_decompress(block, srv_use_checksums);
ut_a(success);
if (UNIV_LIKELY(success && !recv_no_ibuf_operations)) {
if (UNIV_LIKELY(!recv_no_ibuf_operations)) {
ibuf_merge_or_delete_for_page(block, space, offset,
zip_size, TRUE);
}
......@@ -2985,12 +2986,6 @@ buf_page_get_gen(
buf_pool->n_pend_unzip--;
rw_lock_x_unlock(&block->lock);
if (UNIV_UNLIKELY(!success)) {
buf_pool_mutex_exit(buf_pool);
return(NULL);
}
break;
case BUF_BLOCK_ZIP_FREE:
......
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