diff options
Diffstat (limited to 'storage/innobase/dict/dict0boot.cc')
-rw-r--r-- | storage/innobase/dict/dict0boot.cc | 55 |
1 files changed, 6 insertions, 49 deletions
diff --git a/storage/innobase/dict/dict0boot.cc b/storage/innobase/dict/dict0boot.cc index cb60d813..84b8f860 100644 --- a/storage/innobase/dict/dict0boot.cc +++ b/storage/innobase/dict/dict0boot.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2016, 2022, MariaDB Corporation. +Copyright (c) 2016, 2023, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -30,7 +30,6 @@ Created 4/18/1996 Heikki Tuuri #include "dict0load.h" #include "trx0trx.h" #include "srv0srv.h" -#include "ibuf0ibuf.h" #include "buf0flu.h" #include "log0recv.h" #include "os0file.h" @@ -97,18 +96,6 @@ dict_hdr_get_new_id( mtr.commit(); } -/** Update dict_sys.row_id in the dictionary header file page. */ -void dict_hdr_flush_row_id(row_id_t id) -{ - mtr_t mtr; - mtr.start(); - buf_block_t* d= dict_hdr_get(&mtr); - byte *row_id= DICT_HDR + DICT_HDR_ROW_ID + d->page.frame; - if (mach_read_from_8(row_id) < id) - mtr.write<8>(*d, row_id, id); - mtr.commit(); -} - /** Create the DICT_HDR page on database initialization. @return error code */ dberr_t dict_create() @@ -130,10 +117,8 @@ dberr_t dict_create() } ut_a(d->page.id() == hdr_page_id); - /* Start counting row, table, index, and tree ids from + /* Start counting table, index, and tree ids from DICT_HDR_FIRST_ID */ - mtr.write<8>(*d, DICT_HDR + DICT_HDR_ROW_ID + d->page.frame, - DICT_HDR_FIRST_ID); mtr.write<8>(*d, DICT_HDR + DICT_HDR_TABLE_ID + d->page.frame, DICT_HDR_FIRST_ID); mtr.write<8>(*d, DICT_HDR + DICT_HDR_INDEX_ID + d->page.frame, @@ -236,12 +221,11 @@ dberr_t dict_boot() dict_sys.create(); dberr_t err; - const buf_block_t *d = buf_page_get_gen(hdr_page_id, 0, RW_X_LATCH, - nullptr, BUF_GET, &mtr, &err); - if (!d) { + const buf_block_t *d = recv_sys.recover(hdr_page_id, &mtr ,&err); + if (!d) { mtr.commit(); return err; - } + } heap = mem_heap_create(450); @@ -249,17 +233,6 @@ dberr_t dict_boot() const byte* dict_hdr = &d->page.frame[DICT_HDR]; - /* Because we only write new row ids to disk-based data structure - (dictionary header) when it is divisible by - DICT_HDR_ROW_ID_WRITE_MARGIN, in recovery we will not recover - the latest value of the row id counter. Therefore we advance - the counter at the database startup to avoid overlapping values. - Note that when a user after database startup first time asks for - a new row id, then because the counter is now divisible by - ..._MARGIN, it will immediately be updated to the disk-based - header. */ - - dict_sys.recover_row_id(mach_read_from_8(dict_hdr + DICT_HDR_ROW_ID)); if (uint32_t max_space_id = mach_read_from_4(dict_hdr + DICT_HDR_MAX_SPACE_ID)) { max_space_id--; @@ -422,22 +395,6 @@ dberr_t dict_boot() UT_BITS_IN_BYTES(unsigned(table->indexes.start->n_nullable))); mtr.commit(); - - err = ibuf_init_at_db_start(); - - if (err == DB_SUCCESS || srv_force_recovery >= SRV_FORCE_NO_DDL_UNDO) { - err = DB_SUCCESS; - /* Load definitions of other indexes on system tables */ - - dict_load_sys_table(dict_sys.sys_tables); - dict_load_sys_table(dict_sys.sys_columns); - dict_load_sys_table(dict_sys.sys_indexes); - dict_load_sys_table(dict_sys.sys_fields); - dict_sys.unlock(); - dict_sys.load_sys_tables(); - } else { - dict_sys.unlock(); - } - + dict_sys.unlock(); return err; } |