MySQL 8.0.29
Source Code Documentation
dd_tablespace.h
Go to the documentation of this file.
1/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is also distributed with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have included with MySQL.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License, version 2.0, for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23#ifndef DD_TABLESPACE_INCLUDED
24#define DD_TABLESPACE_INCLUDED
25
26#include "sql/lock.h" // Tablespace_hash_set
27#include "sql/thr_malloc.h"
28
29struct MEM_ROOT;
30class THD;
32struct handlerton;
33
34namespace dd {
35
36/**
37 Fill Tablespace_hash_set with tablespace names used by the
38 given db_name.table_name.
39
40 @param thd - Thread invoking the function.
41 @param db_name - Database name.
42 @param table_name - Table name.
43 @param tablespace_set - (OUT) hash set where tablespace names
44 are filled.
45
46 @return true - On failure.
47 @return false - On success.
48*/
50 const char *table_name,
51 Tablespace_hash_set *tablespace_set);
52
53/**
54 Read tablespace name of a tablespace_id.
55
56 @param thd - Thread invoking this call.
57 @param obj - Table/Partition object whose
58 tablespace name is being read.
59 @param tablespace_name (OUT) - Tablespace name of table.
60 @param mem_root - Memroot where tablespace name
61 should be stored.
62
63 @return true - On failure.
64 @return false - On success.
65*/
66template <typename T>
67bool get_tablespace_name(THD *thd, const T *obj, const char **tablespace_name,
69
70} // namespace dd
71#endif // DD_TABLESPACE_INCLUDED
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_class.h:945
std::unordered_set, but with my_malloc, so that you can track the memory used using PSI memory keys.
Definition: map_helpers.h:167
Legacy struct for passing tablespace information to SEs.
Definition: handler.h:859
static MEM_ROOT mem_root
Definition: client_plugin.cc:109
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:42
bool get_tablespace_name(THD *thd, const T *obj, String_type *name)
Read tablespace name of a tablespace_id from Table or similar object.
Definition: dd_tablespace.cc:152
bool fill_table_and_parts_tablespace_names(THD *thd, const char *db_name, const char *table_name, Tablespace_hash_set *tablespace_set)
Fill Tablespace_hash_set with tablespace names used by the given db_name.table_name.
Definition: dd_tablespace.cc:77
const char * table_name
Definition: rules_table_service.cc:55
const char * db_name
Definition: rules_table_service.cc:54
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:82
handlerton is a singleton structure - one instance per storage engine - to provide access to storage ...
Definition: handler.h:2416