| 1 |
/***************************************************************************** |
| 2 |
|
| 3 |
Copyright (c) 2005, 2026, Oracle and/or its affiliates. |
| 4 |
|
| 5 |
This program is free software; you can redistribute it and/or modify it under |
| 6 |
the terms of the GNU General Public License, version 2.0, as published by the |
| 7 |
Free Software Foundation. |
| 8 |
|
| 9 |
This program is designed to work with certain software (including |
| 10 |
but not limited to OpenSSL) that is licensed under separate terms, |
| 11 |
as designated in a particular file or component or in included license |
| 12 |
documentation. The authors of MySQL hereby grant you an additional |
| 13 |
permission to link the program and your derivative works with the |
| 14 |
separately licensed software that they have either included with |
| 15 |
the program or referenced in the documentation. |
| 16 |
|
| 17 |
This program is distributed in the hope that it will be useful, but WITHOUT |
| 18 |
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 19 |
FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, |
| 20 |
for more details. |
| 21 |
|
| 22 |
You should have received a copy of the GNU General Public License along with |
| 23 |
this program; if not, write to the Free Software Foundation, Inc., |
| 24 |
51 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 |
|
| 35 |
constexpr uint32_t ERROR_STR_LENGTH = 1024; |
| 36 |
|
| 37 |
/** Adjust the persistent statistics after rebuilding ALTER TABLE. |
| 38 |
Remove statistics for dropped indexes, add statistics for created indexes |
| 39 |
and 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 |
*/ |
| 44 |
void 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, ...) */ |
| 51 |
void 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 */ |
| 58 |
void 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 */ |
| 65 |
void innobase_row_to_mysql(struct TABLE *table, const dict_table_t *itab, |
| 66 |
const dtuple_t *row); |
| 67 |
|
| 68 |
/** Resets table->record[0]. */ |
| 69 |
void innobase_rec_reset(struct TABLE *table); /*!< in/out: MySQL table */ |
| 70 |
|
| 71 |
#endif /* handler0alter_h */ |