diff options
Diffstat (limited to 'storage/innobase/ibuf/ibuf0ibuf.cc')
-rw-r--r-- | storage/innobase/ibuf/ibuf0ibuf.cc | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/storage/innobase/ibuf/ibuf0ibuf.cc b/storage/innobase/ibuf/ibuf0ibuf.cc index dff0ad57057..fc97aabfa13 100644 --- a/storage/innobase/ibuf/ibuf0ibuf.cc +++ b/storage/innobase/ibuf/ibuf0ibuf.cc @@ -422,8 +422,13 @@ ibuf_init_at_db_start(void) if (!header_page) { err_exit: - sql_print_error("InnoDB: The change buffer is corrupted"); + sql_print_error("InnoDB: The change buffer is corrupted" + " or has been removed on upgrade" + " to MariaDB 11.0 or later"); mtr.commit(); + if (innodb_change_buffering == IBUF_USE_NONE) { + err = DB_SUCCESS; + } return err; } @@ -2002,6 +2007,7 @@ void ibuf_free_excess_pages(void) /*========================*/ { + if (UNIV_UNLIKELY(!ibuf.index)) return; /* Free at most a few pages at a time, so that we do not delay the requested service too much */ @@ -2439,6 +2445,7 @@ will be merged from ibuf trees to the pages read @retval 0 if ibuf.empty */ ulint ibuf_contract() { + if (UNIV_UNLIKELY(!ibuf.index)) return 0; mtr_t mtr; btr_pcur_t pcur; ulint sum_sizes; @@ -2494,6 +2501,7 @@ ibuf_merge_space( /*=============*/ ulint space) /*!< in: tablespace id to merge */ { + if (UNIV_UNLIKELY(!ibuf.index)) return 0; mtr_t mtr; btr_pcur_t pcur; @@ -2952,6 +2960,7 @@ void ibuf_update_max_tablespace_id(void) /*===============================*/ { + if (UNIV_UNLIKELY(!ibuf.index)) return; ulint max_space_id; const rec_t* rec; const byte* field; @@ -2959,7 +2968,7 @@ ibuf_update_max_tablespace_id(void) btr_pcur_t pcur; mtr_t mtr; - ut_a(!dict_table_is_comp(ibuf.index->table)); + ut_ad(!ibuf.index->table->not_redundant()); ibuf_mtr_start(&mtr); @@ -4499,6 +4508,8 @@ in DISCARD TABLESPACE, IMPORT TABLESPACE, or read-ahead. @param[in] space missing or to-be-discarded tablespace */ void ibuf_delete_for_discarded_space(ulint space) { + if (UNIV_UNLIKELY(!ibuf.index)) return; + btr_pcur_t pcur; const rec_t* ibuf_rec; mtr_t mtr; @@ -4608,6 +4619,7 @@ ibuf_print( /*=======*/ FILE* file) /*!< in: file where to print */ { + if (UNIV_UNLIKELY(!ibuf.index)) return; mutex_enter(&ibuf_mutex); fprintf(file, @@ -4647,8 +4659,6 @@ dberr_t ibuf_check_bitmap_on_import(const trx_t* trx, fil_space_t* space) mtr_t mtr; - mutex_enter(&ibuf_mutex); - /* The two bitmap pages (allocation bitmap and ibuf bitmap) repeat every page_size pages. For example if page_size is 16 KiB, then the two bitmap pages repeat every 16 KiB * 16384 = 256 MiB. In the loop @@ -4657,17 +4667,14 @@ dberr_t ibuf_check_bitmap_on_import(const trx_t* trx, fil_space_t* space) for (uint32_t page_no = 0; page_no < size; page_no += physical_size) { if (trx_is_interrupted(trx)) { - mutex_exit(&ibuf_mutex); return(DB_INTERRUPTED); } mtr_start(&mtr); - ibuf_enter(&mtr); buf_block_t* bitmap_page = ibuf_bitmap_get_map_page( page_id_t(space->id, page_no), zip_size, &mtr); if (!bitmap_page) { - mutex_exit(&ibuf_mutex); mtr.commit(); return DB_CORRUPTION; } @@ -4690,7 +4697,6 @@ dberr_t ibuf_check_bitmap_on_import(const trx_t* trx, fil_space_t* space) physical_size))); } #endif /* UNIV_DEBUG */ - ibuf_exit(&mtr); mtr_commit(&mtr); continue; } @@ -4704,8 +4710,6 @@ dberr_t ibuf_check_bitmap_on_import(const trx_t* trx, fil_space_t* space) bitmap_page->frame, cur_page_id, zip_size, IBUF_BITMAP_IBUF, &mtr)) { - mutex_exit(&ibuf_mutex); - ibuf_exit(&mtr); mtr_commit(&mtr); ib_errf(trx->mysql_thd, @@ -4738,11 +4742,9 @@ dberr_t ibuf_check_bitmap_on_import(const trx_t* trx, fil_space_t* space) } } - ibuf_exit(&mtr); mtr_commit(&mtr); } - mutex_exit(&ibuf_mutex); return(DB_SUCCESS); } |