diff --git a/buf/buf0buf.c b/buf/buf0buf.c index 1826bbfe3f7..d6a5836b302 100644 --- a/buf/buf0buf.c +++ b/buf/buf0buf.c @@ -2604,15 +2604,8 @@ err_exit: mutex_exit(&block->mutex); } -err_exit2: - buf_pool_mutex_exit(); - - if (mode == BUF_READ_IBUF_PAGES_ONLY) { - - mtr_commit(&mtr); - } - - return(NULL); + bpage = NULL; + goto func_exit; } if (fil_tablespace_deleted_or_being_deleted_in_mem( @@ -2692,7 +2685,9 @@ err_exit2: /* The block was added by some other thread. */ buf_buddy_free(bpage, sizeof *bpage); buf_buddy_free(data, zip_size); - goto err_exit2; + + bpage = NULL; + goto func_exit; } page_zip_des_init(&bpage->zip); @@ -2729,6 +2724,7 @@ err_exit2: } buf_pool->n_pend_reads++; +func_exit: buf_pool_mutex_exit(); if (mode == BUF_READ_IBUF_PAGES_ONLY) { @@ -2736,7 +2732,7 @@ err_exit2: mtr_commit(&mtr); } - ut_ad(buf_page_in_file(bpage)); + ut_ad(!bpage || buf_page_in_file(bpage)); return(bpage); }