summaryrefslogtreecommitdiff
path: root/storage/innobase/dict/dict0dict.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-11-12 11:18:04 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2020-11-12 11:18:04 +0200
commit972dc6ee98b6447363ccbc5dcb921d3542d7d238 (patch)
tree2b2317a9e8a61a6ac385e7c1592eb921a4be36c8 /storage/innobase/dict/dict0dict.cc
parent2fbcddbeafb558720f4b74b0a8f68c18b48d9f2e (diff)
parent150f447af1d9ffff168372505e5c9b4297bdd9d4 (diff)
downloadmariadb-git-972dc6ee98b6447363ccbc5dcb921d3542d7d238.tar.gz
Merge 10.3 into 10.4
Diffstat (limited to 'storage/innobase/dict/dict0dict.cc')
-rw-r--r--storage/innobase/dict/dict0dict.cc85
1 files changed, 0 insertions, 85 deletions
diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc
index 2697afc2802..980f4c12e66 100644
--- a/storage/innobase/dict/dict0dict.cc
+++ b/storage/innobase/dict/dict0dict.cc
@@ -6307,88 +6307,3 @@ dict_sys_get_size()
return size;
}
-
-/** Look for any dictionary objects that are found in the given tablespace.
-@param[in] space_id Tablespace ID to search for.
-@return true if tablespace is empty. */
-bool
-dict_space_is_empty(
- ulint space_id)
-{
- btr_pcur_t pcur;
- const rec_t* rec;
- mtr_t mtr;
- bool found = false;
-
- dict_sys_lock();
- mtr_start(&mtr);
-
- for (rec = dict_startscan_system(&pcur, &mtr, SYS_TABLES);
- rec != NULL;
- rec = dict_getnext_system(&pcur, &mtr)) {
- const byte* field;
- ulint len;
- ulint space_id_for_table;
-
- field = rec_get_nth_field_old(
- rec, DICT_FLD__SYS_TABLES__SPACE, &len);
- ut_ad(len == 4);
- space_id_for_table = mach_read_from_4(field);
-
- if (space_id_for_table == space_id) {
- found = true;
- }
- }
-
- mtr_commit(&mtr);
- dict_sys_unlock();
-
- return(!found);
-}
-
-/** Find the space_id for the given name in sys_tablespaces.
-@param[in] name Tablespace name to search for.
-@return the tablespace ID. */
-ulint
-dict_space_get_id(
- const char* name)
-{
- btr_pcur_t pcur;
- const rec_t* rec;
- mtr_t mtr;
- ulint name_len = strlen(name);
- ulint id = ULINT_UNDEFINED;
-
- dict_sys_lock();
- mtr_start(&mtr);
-
- for (rec = dict_startscan_system(&pcur, &mtr, SYS_TABLESPACES);
- rec != NULL;
- rec = dict_getnext_system(&pcur, &mtr)) {
- const byte* field;
- ulint len;
-
- field = rec_get_nth_field_old(
- rec, DICT_FLD__SYS_TABLESPACES__NAME, &len);
- ut_ad(len > 0);
- ut_ad(len < OS_FILE_MAX_PATH);
-
- if (len == name_len && ut_memcmp(name, field, len) == 0) {
-
- field = rec_get_nth_field_old(
- rec, DICT_FLD__SYS_TABLESPACES__SPACE, &len);
- ut_ad(len == 4);
- id = mach_read_from_4(field);
-
- /* This is normally called by dict_getnext_system()
- at the end of the index. */
- btr_pcur_close(&pcur);
- break;
- }
- }
-
- mtr_commit(&mtr);
- dict_sys_unlock();
-
- return(id);
-}