MySQL  8.0.18
Source Code Documentation
dd_tablespace.h
Go to the documentation of this file.
1 /* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
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 
29 struct MEM_ROOT;
30 class THD;
32 struct handlerton;
33 
34 namespace 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 */
66 template <typename T>
67 bool get_tablespace_name(THD *thd, const T *obj, const char **tablespace_name,
69 
70 } // namespace dd
71 #endif // DD_TABLESPACE_INCLUDED
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 * db_name
Definition: rules_table_service.cc:54
handlerton is a singleton structure - one instance per storage engine - to provide access to storage ...
Definition: handler.h:2272
Legacy struct for passing tablespace information to SEs.
Definition: handler.h:827
bool get_tablespace_name(THD *thd, const T *obj, const char **tablespace_name, MEM_ROOT *mem_root)
Read tablespace name of a tablespace_id.
Definition: dd_tablespace.cc:141
static MEM_ROOT mem_root
Definition: client_plugin.cc:107
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:39
std::unordered_set, but with my_malloc, so that you can track the memory used using PSI memory keys...
Definition: map_helpers.h:196
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:77
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_class.h:778
const char * table_name
Definition: rules_table_service.cc:55