From eb4e17a4a6e225dacc2d021917db1cabe3a53e95 Mon Sep 17 00:00:00 2001 From: marko <> Date: Tue, 5 Sep 2006 19:41:05 +0000 Subject: [PATCH] branches/zip: btr_copy_externally_stored_field(): Correct the reporting and handling of inflate() errors. --- btr/btr0cur.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/btr/btr0cur.c b/btr/btr0cur.c index f0ed75f7c0f..171bcc79902 100644 --- a/btr/btr0cur.c +++ b/btr/btr0cur.c @@ -4229,6 +4229,7 @@ btr_copy_externally_stored_field( #endif /* UNIV_SYNC_DEBUG */ if (UNIV_UNLIKELY(zip_size)) { int err; + ulint next_page_no; if (UNIV_UNLIKELY(fil_page_get_type(page) != FIL_PAGE_TYPE_ZBLOB)) { @@ -4241,7 +4242,7 @@ btr_copy_externally_stored_field( (ulong) page_no, (ulong) space_id); } - page_no = mach_read_from_4(page + offset); + next_page_no = mach_read_from_4(page + offset); if (UNIV_LIKELY(offset == FIL_PAGE_NEXT)) { /* When the BLOB begins at page header, @@ -4260,14 +4261,14 @@ btr_copy_externally_stored_field( case Z_OK: break; case Z_STREAM_END: - if (page_no == FIL_NULL) { + if (next_page_no == FIL_NULL) { goto end_of_blob; } /* fall through */ default: +inflate_error: mtr_commit(&mtr); inflateEnd(&d_stream); -inflate_error: ut_print_timestamp(stderr); fprintf(stderr, " InnoDB: inflate() of" @@ -4279,7 +4280,7 @@ inflate_error: return(buf); } - if (page_no == FIL_NULL) { + if (next_page_no == FIL_NULL) { err = inflate(&d_stream, Z_FINISH); if (UNIV_UNLIKELY(err != Z_STREAM_END)) { @@ -4301,6 +4302,7 @@ end_of_blob: /* On other BLOB pages except the first the BLOB header always is at the page header: */ + page_no = next_page_no; offset = FIL_PAGE_NEXT; } else { byte* blob_header = page + offset;