MySQL 9.0.0
Source Code Documentation
handler0alter.h
Go to the documentation of this file.
1/*****************************************************************************
2
3Copyright (c) 2005, 2024, Oracle and/or its affiliates.
4
5This program is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public License, version 2.0, as published by the
7Free Software Foundation.
8
9This program is designed to work with certain software (including
10but not limited to OpenSSL) that is licensed under separate terms,
11as designated in a particular file or component or in included license
12documentation. The authors of MySQL hereby grant you an additional
13permission to link the program and your derivative works with the
14separately licensed software that they have either included with
15the program or referenced in the documentation.
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 include/handler0alter.h
29 Smart ALTER TABLE
30 *******************************************************/
31
32#ifndef handler0alter_h
33#define handler0alter_h
34
35constexpr uint32_t ERROR_STR_LENGTH = 1024;
36
37/** Adjust the persistent statistics after rebuilding ALTER TABLE.
38Remove statistics for dropped indexes, add statistics for created indexes
39and rename statistics for renamed indexes.
40@param table InnoDB table that was rebuilt by ALTER TABLE
41@param table_name Table name in MySQL
42@param thd MySQL connection
43*/
44void alter_stats_rebuild(dict_table_t *table, const char *table_name, THD *thd);
45
46/** Copies an InnoDB record to table->record[0].
47@param[in,out] table Mysql table
48@param[in] rec Record
49@param[in] index Index
50@param[in] offsets rec_get_offsets( rec, index, ...) */
51void innobase_rec_to_mysql(struct TABLE *table, const rec_t *rec,
52 const dict_index_t *index, const ulint *offsets);
53
54/** Copies an InnoDB index entry to table->record[0].
55@param[in,out] table Mysql table
56@param[in] index Innodb index
57@param[in] fields Innodb index fields */
58void innobase_fields_to_mysql(struct TABLE *table, const dict_index_t *index,
59 const dfield_t *fields);
60
61/** Copies an InnoDB row to table->record[0].
62@param[in,out] table Mysql table
63@param[in] itab Innodb table
64@param[in] row Innodb row */
65void innobase_row_to_mysql(struct TABLE *table, const dict_table_t *itab,
66 const dtuple_t *row);
67
68/** Resets table->record[0]. */
69void innobase_rec_reset(struct TABLE *table); /*!< in/out: MySQL table */
70
71#endif /* handler0alter_h */
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
void innobase_row_to_mysql(struct TABLE *table, const dict_table_t *itab, const dtuple_t *row)
Copies an InnoDB row to table->record[0].
Definition: handler0alter.cc:2366
void innobase_fields_to_mysql(struct TABLE *table, const dict_index_t *index, const dfield_t *fields)
Copies an InnoDB index entry to table->record[0].
Definition: handler0alter.cc:2321
constexpr uint32_t ERROR_STR_LENGTH
Definition: handler0alter.h:35
void innobase_rec_reset(struct TABLE *table)
Resets table->record[0].
Definition: handler0alter.cc:2404
void innobase_rec_to_mysql(struct TABLE *table, const rec_t *rec, const dict_index_t *index, const ulint *offsets)
Copies an InnoDB record to table->record[0].
Definition: handler0alter.cc:2279
void alter_stats_rebuild(dict_table_t *table, const char *table_name, THD *thd)
Adjust the persistent statistics after rebuilding ALTER TABLE.
Definition: handler0alter.cc:7356
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
const char * table_name
Definition: rules_table_service.cc:56
byte rec_t
Definition: rem0types.h:41
Definition: table.h:1407
Structure for an SQL data field.
Definition: data0data.h:605
Data structure for an index.
Definition: dict0mem.h:1046
Data structure for a database table.
Definition: dict0mem.h:1909
Structure for an SQL data tuple of fields (logical record)
Definition: data0data.h:684
unsigned long int ulint
Definition: univ.i:406