diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2021-03-23 14:47:04 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2021-03-23 14:47:04 +0200 |
commit | 8f23aab068b37698b2ea0a2a04cf5e0cb3528c7c (patch) | |
tree | 8e2c283751a9be2455e7befe854a5ac0d05e0eeb | |
parent | df931d888fda67f2d01a0411aa963469befa54f3 (diff) | |
download | mariadb-git-8f23aab068b37698b2ea0a2a04cf5e0cb3528c7c.tar.gz |
MDEV-15528 fixup: Remove dict_table_open_on_index_id()
dict_table_open_on_index_id(): Remove. This function was used by
the background scrubbing, which was removed in
commit a5584b13d1e04f38b843602413669591aa65c359.
-rw-r--r-- | storage/innobase/dict/dict0load.cc | 80 | ||||
-rw-r--r-- | storage/innobase/include/dict0dict.h | 8 |
2 files changed, 2 insertions, 86 deletions
diff --git a/storage/innobase/dict/dict0load.cc b/storage/innobase/dict/dict0load.cc index 753bcf74967..34b04eb36cc 100644 --- a/storage/innobase/dict/dict0load.cc +++ b/storage/innobase/dict/dict0load.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2016, 2020, MariaDB Corporation. +Copyright (c) 2016, 2021, 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 @@ -3685,81 +3685,3 @@ load_next_index: DBUG_RETURN(DB_SUCCESS); } - -/***********************************************************************//** -Loads a table id based on the index id. -@return true if found */ -static -bool -dict_load_table_id_on_index_id( -/*===========================*/ - index_id_t index_id, /*!< in: index id */ - table_id_t* table_id) /*!< out: table id */ -{ - /* check hard coded indexes */ - switch(index_id) { - case DICT_TABLES_ID: - case DICT_COLUMNS_ID: - case DICT_INDEXES_ID: - case DICT_FIELDS_ID: - *table_id = index_id; - return true; - case DICT_TABLE_IDS_ID: - /* The following is a secondary index on SYS_TABLES */ - *table_id = DICT_TABLES_ID; - return true; - } - - bool found = false; - mtr_t mtr; - - ut_ad(mutex_own(&dict_sys.mutex)); - - /* NOTE that the operation of this function is protected by - the dictionary mutex, and therefore no deadlocks can occur - with other dictionary operations. */ - - mtr_start(&mtr); - - btr_pcur_t pcur; - const rec_t* rec = dict_startscan_system(&pcur, &mtr, SYS_INDEXES); - - while (rec) { - ulint len; - const byte* field = rec_get_nth_field_old( - rec, DICT_FLD__SYS_INDEXES__ID, &len); - ut_ad(len == 8); - - /* Check if the index id is the one searched for */ - if (index_id == mach_read_from_8(field)) { - found = true; - /* Now we get the table id */ - const byte* field = rec_get_nth_field_old( - rec, - DICT_FLD__SYS_INDEXES__TABLE_ID, - &len); - *table_id = mach_read_from_8(field); - break; - } - mtr_commit(&mtr); - mtr_start(&mtr); - rec = dict_getnext_system(&pcur, &mtr); - } - - btr_pcur_close(&pcur); - mtr_commit(&mtr); - - return(found); -} - -dict_table_t* dict_table_open_on_index_id(index_id_t index_id) -{ - table_id_t table_id; - dict_table_t * table = NULL; - if (dict_load_table_id_on_index_id(index_id, &table_id)) { - table = dict_table_open_on_id(table_id, true, - DICT_TABLE_OP_LOAD_TABLESPACE); - } - - return table; -} diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h index f7c4d5dca29..e17da733351 100644 --- a/storage/innobase/include/dict0dict.h +++ b/storage/innobase/include/dict0dict.h @@ -2,7 +2,7 @@ Copyright (c) 1996, 2018, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. -Copyright (c) 2013, 2020, MariaDB Corporation. +Copyright (c) 2013, 2021, 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 @@ -152,12 +152,6 @@ dict_table_open_on_id(table_id_t table_id, bool dict_locked, MDL_ticket **mdl= nullptr) MY_ATTRIBUTE((warn_unused_result)); -/**********************************************************************//** -Returns a table object based on table id. -@return table, NULL if does not exist */ -dict_table_t* dict_table_open_on_index_id(index_id_t index_id) - __attribute__((warn_unused_result)); - /** Decrements the count of open handles of a table. @param[in,out] table table @param[in] dict_locked data dictionary locked |