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