List:Commits« Previous MessageNext Message »
From:vasil.dimov Date:May 4 2010 10:59am
Subject:bzr commit into mysql-trunk-innodb branch (vasil.dimov:3056)
View as plain text  
#At file:///usr/local/devel/bzrroot/server/mysql-trunk-innodb/ based on revid:vasil.dimov@stripped

 3056 Vasil Dimov	2010-05-04
      Merge from mysql-5.1-innodb:
      
        ------------------------------------------------------------
        revno: 3436
        revision-id: marko.makela@stripped
        parent: vasil.dimov@stripped
        committer: Marko M?kel? <marko.makela@stripped>
        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
        ------------------------------------------------------------

    modified:
      storage/innobase/buf/buf0buf.c
=== modified file 'storage/innobase/buf/buf0buf.c'
--- a/storage/innobase/buf/buf0buf.c	2010-04-19 15:44:15 +0000
+++ b/storage/innobase/buf/buf0buf.c	2010-05-04 10:58:43 +0000
@@ -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 @@ wait_until_unfixed:
 		/* 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 @@ wait_until_unfixed:
 		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:


Attachment: [text/bzr-bundle] bzr/vasil.dimov@oracle.com-20100504105843-2z9fw3x17id69vb8.bundle
Thread
bzr commit into mysql-trunk-innodb branch (vasil.dimov:3056) vasil.dimov4 May