MySQL 8.0.40
Source Code Documentation
mem.h
Go to the documentation of this file.
1/*****************************************************************************
2
3Copyright (c) 1996, 2024, Oracle and/or its affiliates.
4Copyright (c) 2012, Facebook Inc.
5
6This program is free software; you can redistribute it and/or modify it under
7the terms of the GNU General Public License, version 2.0, as published by the
8Free Software Foundation.
9
10This program is designed to work with certain software (including
11but not limited to OpenSSL) that is licensed under separate terms,
12as designated in a particular file or component or in included license
13documentation. The authors of MySQL hereby grant you an additional
14permission to link the program and your derivative works with the
15separately licensed software that they have either included with
16the program or referenced in the documentation.
17
18This program is distributed in the hope that it will be useful, but WITHOUT
19ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0,
21for more details.
22
23You should have received a copy of the GNU General Public License along with
24this program; if not, write to the Free Software Foundation, Inc.,
2551 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26
27*****************************************************************************/
28
29/** @file dict/mem.h
30 Data dictionary memory object creation
31
32 Created 1/8/1996 Heikki Tuuri
33 *******************************************************/
34
35#ifndef dict_mem_h
36#define dict_mem_h
37/** Creates a table memory object.
38@param[in] name table name
39@param[in] space space where the clustered index of the table is placed
40@param[in] n_cols total number of columns including virtual and
41 non-virtual columns
42@param[in] n_v_cols number of virtual columns
43@param[in] n_m_v_cols number of multi-value virtual columns
44@param[in] flags table flags
45@param[in] flags2 table flags2
46@param[in] n_drop_cols Number of INSTANT drop cols
47@return own: table object */
49 ulint n_cols, ulint n_v_cols,
50 ulint n_m_v_cols, uint32_t flags,
51 uint32_t flags2, uint32_t n_drop_cols = 0);
52
53/** Free a table memory object. */
54void dict_mem_table_free(dict_table_t *table); /*!< in: table */
55
56/** Creates an index memory object.
57 @return own: index object */
59 const char *table_name, /*!< in: table name */
60 const char *index_name, /*!< in: index name */
61 ulint space, /*!< in: space where the index tree is
62 placed, ignored if the index is of
63 the clustered type */
64 ulint type, /*!< in: DICT_UNIQUE,
65 DICT_CLUSTERED, ... ORed */
66 ulint n_fields); /*!< in: number of fields */
67
68/** Adds a column definition to a table.
69@param[in] table table
70@param[in] heap temporary memory heap, or NULL
71@param[in] name column name, or NULL
72@param[in] mtype main datatype
73@param[in] prtype precise type
74@param[in] len length of column
75@param[in] is_visible true if column is visible
76@param[in] phy_pos position of col in physical record
77@param[in] v_added table row version when col was added INSTANTly
78@param[in] v_dropped table_row version when col was dropped INSTANTly */
80 const char *name, ulint mtype, ulint prtype,
81 ulint len, bool is_visible,
82 uint32_t phy_pos = UINT32_UNDEFINED,
83 uint8_t v_added = UINT8_UNDEFINED,
84 uint8_t v_dropped = UINT8_UNDEFINED);
85
86/** This function populates a dict_col_t memory structure with
87supplied information.
88@param[out] column column struct to be filled
89@param[in] col_pos column position
90@param[in] mtype main data type
91@param[in] prtype precise type
92@param[in] col_len column length
93@param[in] is_visible true if column is visible
94@param[in] phy_pos position of col in physical record
95@param[in] v_added table row version when col was added INSTANTly
96@param[in] v_dropped table row version when col was dropped INSTANTly */
97void dict_mem_fill_column_struct(dict_col_t *column, ulint col_pos, ulint mtype,
98 ulint prtype, ulint col_len, bool is_visible,
99 uint32_t phy_pos, uint8_t v_added,
100 uint8_t v_dropped);
101
102/** Append 'name' to 'col_names'. @see dict_table_t::col_names
103 @return new column names array */
104const char *dict_add_col_name(const char *col_names, /*!< in: existing column
105 names, or NULL */
106 ulint cols, /*!< in: number of existing columns */
107 const char *name, /*!< in: new column name */
108 mem_heap_t *heap); /*!< in: heap */
109#endif
uint32_t space_id_t
Tablespace identifier.
Definition: api0api.h:52
static int flags[50]
Definition: hp_test1.cc:40
void dict_mem_fill_column_struct(dict_col_t *column, ulint col_pos, ulint mtype, ulint prtype, ulint col_len, bool is_visible, uint32_t phy_pos, uint8_t v_added, uint8_t v_dropped)
This function populates a dict_col_t memory structure with supplied information.
Definition: mem.cc:356
const char * dict_add_col_name(const char *col_names, ulint cols, const char *name, mem_heap_t *heap)
Append 'name' to 'col_names'.
Definition: mem.cc:50
dict_table_t * dict_mem_table_create(const char *name, space_id_t space, ulint n_cols, ulint n_v_cols, ulint n_m_v_cols, uint32_t flags, uint32_t flags2, uint32_t n_drop_cols=0)
Creates a table memory object.
Definition: mem.cc:182
void dict_mem_table_add_col(dict_table_t *table, mem_heap_t *heap, const char *name, ulint mtype, ulint prtype, ulint len, bool is_visible, uint32_t phy_pos=UINT32_UNDEFINED, uint8_t v_added=UINT8_UNDEFINED, uint8_t v_dropped=UINT8_UNDEFINED)
Adds a column definition to a table.
Definition: mem.cc:319
void dict_mem_table_free(dict_table_t *table)
Free a table memory object.
Definition: mem.cc:92
dict_index_t * dict_mem_index_create(const char *table_name, const char *index_name, ulint space, ulint type, ulint n_fields)
Creates an index memory object.
Definition: mem.cc:276
const char * table_name
Definition: rules_table_service.cc:56
required string type
Definition: replication_group_member_actions.proto:34
case opt name
Definition: sslopt-case.h:33
Data structure for a column in a table.
Definition: dict0mem.h:489
Data structure for an index.
Definition: dict0mem.h:1046
Data structure for a database table.
Definition: dict0mem.h:1909
The info structure stored at the beginning of a heap block.
Definition: mem0mem.h:302
constexpr uint8_t UINT8_UNDEFINED
The 'undefined' value for a 8-bit unsigned integer.
Definition: univ.i:434
constexpr uint32_t UINT32_UNDEFINED
The 'undefined' value for a 32-bit unsigned integer.
Definition: univ.i:428
unsigned long int ulint
Definition: univ.i:406