| 1 |
/***************************************************************************** |
| 2 |
|
| 3 |
Copyright (c) 2006, 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/ha_prototypes.h |
| 29 |
Prototypes for global functions in ha_innodb.cc that are called by |
| 30 |
InnoDB C code. |
| 31 |
|
| 32 |
NOTE: This header is intended to insulate InnoDB from SQL names and functions. |
| 33 |
Do not include any headers other than univ.i into this unless they are very |
| 34 |
simple headers. |
| 35 |
************************************************************************/ |
| 36 |
|
| 37 |
#ifndef HA_INNODB_PROTOTYPES_H |
| 38 |
#define HA_INNODB_PROTOTYPES_H |
| 39 |
|
| 40 |
#include "univ.i" |
| 41 |
|
| 42 |
/* Forward declarations */ |
| 43 |
class ha_innobase; |
| 44 |
class THD; |
| 45 |
class MDL_ticket; |
| 46 |
struct CHARSET_INFO; |
| 47 |
struct dict_table_t; |
| 48 |
|
| 49 |
/** Formats the raw data in "data" (in InnoDB on-disk format) that is of |
| 50 |
type DATA_(CHAR|VARCHAR|MYSQL|VARMYSQL) using "charset_coll" and writes |
| 51 |
the result to "buf". The result is converted to "system_charset_info". |
| 52 |
Not more than "buf_size" bytes are written to "buf". |
| 53 |
The result is always NUL-terminated (provided buf_size > 0) and the |
| 54 |
number of bytes that were written to "buf" is returned (including the |
| 55 |
terminating NUL). |
| 56 |
@return number of bytes that were written */ |
| 57 |
ulint innobase_raw_format(const char *data, /*!< in: raw data */ |
| 58 |
ulint data_len, /*!< in: raw data length |
| 59 |
in bytes */ |
| 60 |
ulint charset_coll, /*!< in: charset collation */ |
| 61 |
char *buf, /*!< out: output buffer */ |
| 62 |
ulint buf_size); /*!< in: output buffer size |
| 63 |
in bytes */ |
| 64 |
|
| 65 |
/** Quote a standard SQL identifier like tablespace, index or column name. |
| 66 |
@param[in] file output stream |
| 67 |
@param[in] trx InnoDB transaction, or NULL |
| 68 |
@param[in] id identifier to quote */ |
| 69 |
void innobase_quote_identifier(FILE *file, trx_t *trx, const char *id); |
| 70 |
|
| 71 |
/** Quote an standard SQL identifier like tablespace, index or column name. |
| 72 |
Return the string as an std:string object. |
| 73 |
@param[in] trx InnoDB transaction, or NULL |
| 74 |
@param[in] id identifier to quote |
| 75 |
@return a std::string with id properly quoted. */ |
| 76 |
std::string innobase_quote_identifier(trx_t *trx, const char *id); |
| 77 |
|
| 78 |
/** Convert a table name to the MySQL system_charset_info (UTF-8). |
| 79 |
@return pointer to the end of buf */ |
| 80 |
char *innobase_convert_name( |
| 81 |
char *buf, /*!< out: buffer for converted identifier */ |
| 82 |
ulint buflen, /*!< in: length of buf, in bytes */ |
| 83 |
const char *id, /*!< in: table name to convert */ |
| 84 |
ulint idlen, /*!< in: length of id, in bytes */ |
| 85 |
THD *thd); /*!< in: MySQL connection thread, or NULL */ |
| 86 |
|
| 87 |
/** Returns true if the thread is the replication thread on the slave |
| 88 |
server. Used in srv_conc_enter_innodb() to determine if the thread |
| 89 |
should be allowed to enter InnoDB - the replication thread is treated |
| 90 |
differently than other threads. Also used in |
| 91 |
srv_conc_force_exit_innodb(). |
| 92 |
@return true if thd is the replication thread */ |
| 93 |
bool thd_is_replication_slave_thread(THD *thd); /*!< in: thread handle */ |
| 94 |
|
| 95 |
/** Returns true if the transaction this thread is processing has edited |
| 96 |
non-transactional tables. Used by the deadlock detector when deciding |
| 97 |
which transaction to rollback in case of a deadlock - we try to avoid |
| 98 |
rolling back transactions that have edited non-transactional tables. |
| 99 |
@return true if non-transactional tables have been edited */ |
| 100 |
bool thd_has_edited_nontrans_tables(THD *thd); /*!< in: thread handle */ |
| 101 |
|
| 102 |
/** Prints info of a THD object (== user session thread) to the given file. |
| 103 |
@param[in] f Output stream |
| 104 |
@param[in] thd Pointer to a mysql thd object |
| 105 |
@param[in] max_query_len Max query length to print, must be positive */ |
| 106 |
void innobase_mysql_print_thd(FILE *f, THD *thd, uint max_query_len); |
| 107 |
|
| 108 |
/** Converts a MySQL type to an InnoDB type. Note that this function returns |
| 109 |
the 'mtype' of InnoDB. InnoDB differentiates between MySQL's old <= 4.1 |
| 110 |
VARCHAR and the new true VARCHAR in >= 5.0.3 by the 'prtype'. |
| 111 |
@param[out] unsigned_flag DATA_UNSIGNED if an 'unsigned type'; |
| 112 |
at least ENUM and SET, and unsigned integer types are 'unsigned types' |
| 113 |
@param[in] f MySQL Field |
| 114 |
@return DATA_BINARY, DATA_VARCHAR, ... */ |
| 115 |
ulint get_innobase_type_from_mysql_type(ulint *unsigned_flag, const void *f); |
| 116 |
|
| 117 |
#include <sql/dd/types/column.h> |
| 118 |
/** Converts a MySQL data-dictionary type to an InnoDB type. Also returns |
| 119 |
a few attributes which are useful for precise type calculation. |
| 120 |
|
| 121 |
@note This function is version of get_innobase_type_from_mysql_type() with |
| 122 |
added knowledge about how additional attributes calculated (e.g. in |
| 123 |
create_table_info_t::create_table_def()) and about behavior of Field |
| 124 |
class and its descendats. |
| 125 |
|
| 126 |
@note It allows to get InnoDB generic and precise types directly from MySQL |
| 127 |
data-dictionary info, bypassing expensive construction of Field objects. |
| 128 |
|
| 129 |
@param[out] unsigned_flag DATA_UNSIGNED if an 'unsigned type'. |
| 130 |
@param[out] binary_type DATA_BINARY_TYPE if a 'binary type'. |
| 131 |
@param[out] charset_no Collation id for string types. |
| 132 |
@param[in] dd_type MySQL data-dictionary type. |
| 133 |
@param[in] field_charset Charset. |
| 134 |
@param[in] is_unsigned MySQL data-dictionary unsigned flag. |
| 135 |
|
| 136 |
@return DATA_BINARY, DATA_VARCHAR, ... */ |
| 137 |
ulint get_innobase_type_from_mysql_dd_type(ulint *unsigned_flag, |
| 138 |
ulint *binary_type, |
| 139 |
ulint *charset_no, |
| 140 |
dd::enum_column_types dd_type, |
| 141 |
const CHARSET_INFO *field_charset, |
| 142 |
bool is_unsigned); |
| 143 |
|
| 144 |
/** Get the variable length bounds of the given character set. |
| 145 |
@param[in] cset Mysql charset-collation code |
| 146 |
@param[out] mbminlen Minimum length of a char (in bytes) |
| 147 |
@param[out] mbmaxlen Maximum length of a char (in bytes) */ |
| 148 |
void innobase_get_cset_width(ulint cset, ulint *mbminlen, ulint *mbmaxlen); |
| 149 |
|
| 150 |
/** Compares NUL-terminated UTF-8 strings case insensitively. |
| 151 |
@return 0 if a=b, < 0 if a < b, > 1 if a > b */ |
| 152 |
int innobase_strcasecmp(const char *a, /*!< in: first string to compare */ |
| 153 |
const char *b); /*!< in: second string to compare */ |
| 154 |
|
| 155 |
/** Strip dir name from a full path name and return only the file name |
| 156 |
@param[in] path_name full path name |
| 157 |
@return file name or "null" if no file name */ |
| 158 |
const char *innobase_basename(const char *path_name); |
| 159 |
|
| 160 |
/** Returns true if the thread is executing a SELECT statement. |
| 161 |
@return true if thd is executing SELECT */ |
| 162 |
bool thd_is_query_block(const THD *thd); /*!< in: thread handle */ |
| 163 |
|
| 164 |
/** Makes all characters in a NUL-terminated UTF-8 string lower case. */ |
| 165 |
void innobase_casedn_str(char *a); /*!< in/out: string to put in lower case */ |
| 166 |
|
| 167 |
/** Makes all characters in a NUL-terminated UTF-8 path string lower case. */ |
| 168 |
void innobase_casedn_path(char *a); /*!< in/out: string to put in lower case */ |
| 169 |
|
| 170 |
/** Determines the connection character set. |
| 171 |
@return connection character set */ |
| 172 |
const CHARSET_INFO *innobase_get_charset( |
| 173 |
THD *thd); /*!< in: MySQL thread handle */ |
| 174 |
|
| 175 |
/** Determines the current SQL statement. |
| 176 |
Thread unsafe, can only be called from the thread owning the THD. |
| 177 |
@param[in] thd MySQL thread handle |
| 178 |
@param[out] length Length of the SQL statement |
| 179 |
@return SQL statement string */ |
| 180 |
const char *innobase_get_stmt_unsafe(THD *thd, size_t *length); |
| 181 |
|
| 182 |
/** Determines the current SQL statement. |
| 183 |
Thread safe, can be called from any thread as the string is copied |
| 184 |
into the provided buffer. |
| 185 |
@param[in] thd MySQL thread handle |
| 186 |
@param[out] buf Buffer containing SQL statement |
| 187 |
@param[in] buflen Length of provided buffer |
| 188 |
@return Length of the SQL statement */ |
| 189 |
size_t innobase_get_stmt_safe(THD *thd, char *buf, size_t buflen); |
| 190 |
|
| 191 |
/** This function is used to find the storage length in bytes of the first n |
| 192 |
characters for prefix indexes using a multibyte character set. The function |
| 193 |
finds charset information and returns length of prefix_len characters in the |
| 194 |
index field in bytes. |
| 195 |
@return number of bytes occupied by the first n characters */ |
| 196 |
ulint innobase_get_at_most_n_mbchars( |
| 197 |
ulint charset_id, /*!< in: character set id */ |
| 198 |
ulint prefix_len, /*!< in: prefix length in bytes of the index |
| 199 |
(this has to be divided by mbmaxlen to get the |
| 200 |
number of CHARACTERS n in the prefix) */ |
| 201 |
ulint data_len, /*!< in: length of the string in bytes */ |
| 202 |
const char *str); /*!< in: character string */ |
| 203 |
|
| 204 |
/** Checks sys_vars and determines if allocator should mark |
| 205 |
large memory segments with MADV_DONTDUMP |
| 206 |
@return true iff @@global.core_file AND |
| 207 |
NOT @@global.innodb_buffer_pool_in_core_file */ |
| 208 |
bool innobase_should_madvise_buf_pool(); |
| 209 |
|
| 210 |
/** Make sure that core file will not be generated, as generating a core file |
| 211 |
might violate our promise to not dump buffer pool data, and/or might dump not |
| 212 |
the expected memory pages due to failure in using madvise */ |
| 213 |
void innobase_disable_core_dump(); |
| 214 |
|
| 215 |
/** Returns the lock wait timeout for the current connection. |
| 216 |
@return the lock wait timeout */ |
| 217 |
std::chrono::seconds thd_lock_wait_timeout( |
| 218 |
THD *thd); /*!< in: thread handle, or NULL to query |
| 219 |
the global innodb_lock_wait_timeout */ |
| 220 |
|
| 221 |
/** Set the time waited for the lock for the current query. |
| 222 |
@param[in,out] thd Thread handle. |
| 223 |
@param[in] value Time waited for the lock. */ |
| 224 |
void thd_set_lock_wait_time(THD *thd, |
| 225 |
std::chrono::steady_clock::duration value); |
| 226 |
|
| 227 |
/** Get the value of innodb_tmpdir. |
| 228 |
@param[in] thd thread handle, or nullptr to query the global innodb_tmpdir. |
| 229 |
@return nullptr if innodb_tmpdir="" */ |
| 230 |
const char *thd_innodb_tmpdir(THD *thd); |
| 231 |
|
| 232 |
#ifdef UNIV_DEBUG |
| 233 |
/** Obtain the value of the latest output from InnoDB Interpreter/Tester |
| 234 |
module (ib::Tester). |
| 235 |
@param[in] thd thread handle |
| 236 |
@return pointer to the output string. */ |
| 237 |
char **thd_innodb_interpreter_output(THD *thd); |
| 238 |
|
| 239 |
/** Obtain the latest command executed by InnoDB Interpreter/Tester |
| 240 |
module (ib::Tester). |
| 241 |
@param[in] thd thread handle |
| 242 |
@return pointer to the output string. */ |
| 243 |
char **thd_innodb_interpreter(THD *thd); |
| 244 |
#endif /* UNIV_DEBUG */ |
| 245 |
|
| 246 |
/** Get the current setting of the table_cache_size global parameter. We do |
| 247 |
a dirty read because for one there is no synchronization object and |
| 248 |
secondly there is little harm in doing so even if we get a torn read. |
| 249 |
@return SQL statement string */ |
| 250 |
ulint innobase_get_table_cache_size(void); |
| 251 |
|
| 252 |
/** Get the current setting of the lower_case_table_names global parameter from |
| 253 |
mysqld.cc. We do a dirty read because for one there is no synchronization |
| 254 |
object and secondly there is little harm in doing so even if we get a torn |
| 255 |
read. |
| 256 |
@return value of lower_case_table_names */ |
| 257 |
ulint innobase_get_lower_case_table_names(void); |
| 258 |
|
| 259 |
/** Compare two character strings case insensitively according to their |
| 260 |
charset. |
| 261 |
@param[in] cs character set |
| 262 |
@param[in] s1 string 1 |
| 263 |
@param[in] s2 string 2 |
| 264 |
@return 0 if the two strings are equal */ |
| 265 |
int innobase_nocase_compare(const void *cs, const char *s1, const char *s2); |
| 266 |
|
| 267 |
/** Returns true if transaction should be flagged as read-only. |
| 268 |
@return true if the thd is marked as read-only */ |
| 269 |
bool thd_trx_is_read_only(THD *thd); /*!< in/out: thread handle */ |
| 270 |
|
| 271 |
/** |
| 272 |
Check if the transaction can be rolled back |
| 273 |
@param[in] requestor Session requesting the lock |
| 274 |
@param[in] holder Session that holds the lock |
| 275 |
@return the session that will be rolled back, null don't care */ |
| 276 |
|
| 277 |
THD *thd_trx_arbitrate(THD *requestor, THD *holder); |
| 278 |
|
| 279 |
/** |
| 280 |
@param[in] thd Session to check |
| 281 |
@return the priority */ |
| 282 |
|
| 283 |
int thd_trx_priority(THD *thd); |
| 284 |
|
| 285 |
/** Check if the transaction is an auto-commit transaction. true also |
| 286 |
implies that it is a SELECT (read-only) transaction. |
| 287 |
@return true if the transaction is an auto commit read-only transaction. */ |
| 288 |
bool thd_trx_is_auto_commit(THD *thd); /*!< in: thread handle, or NULL */ |
| 289 |
|
| 290 |
/** Get the thread start time. |
| 291 |
@return the thread start time. */ |
| 292 |
std::chrono::system_clock::time_point thd_start_time( |
| 293 |
THD *thd); /*!< in: thread handle, or NULL */ |
| 294 |
|
| 295 |
/** A wrapper function of innobase_convert_name(), convert a table name |
| 296 |
to the MySQL system_charset_info (UTF-8) and quote it if needed. |
| 297 |
@param[out] buf Buffer for converted identifier |
| 298 |
@param[in] buflen Length of buf, in bytes |
| 299 |
@param[in] name Table name to format */ |
| 300 |
void innobase_format_name(char *buf, ulint buflen, const char *name); |
| 301 |
|
| 302 |
/** Corresponds to Sql_condition:enum_warning_level. */ |
| 303 |
enum ib_log_level_t { |
| 304 |
IB_LOG_LEVEL_INFO, |
| 305 |
IB_LOG_LEVEL_WARN, |
| 306 |
IB_LOG_LEVEL_ERROR, |
| 307 |
IB_LOG_LEVEL_FATAL |
| 308 |
}; |
| 309 |
|
| 310 |
/** Use this when the args are first converted to a formatted string and then |
| 311 |
passed to the format string from messages_to_clients.txt. The error message |
| 312 |
format must be: "Some string ... %s". |
| 313 |
|
| 314 |
Push a warning message to the client, it is a wrapper around: |
| 315 |
|
| 316 |
void push_warning_printf( |
| 317 |
THD *thd, Sql_condition::enum_warning_level level, |
| 318 |
uint code, const char *format, ...); |
| 319 |
*/ |
| 320 |
void ib_errf(THD *thd, /*!< in/out: session */ |
| 321 |
ib_log_level_t level, /*!< in: warning level */ |
| 322 |
uint32_t code, /*!< MySQL error code */ |
| 323 |
const char *format, /*!< printf format */ |
| 324 |
...) /*!< Args */ |
| 325 |
MY_ATTRIBUTE((format(printf, 4, 5))); |
| 326 |
|
| 327 |
/** Use this when the args are passed to the format string from |
| 328 |
messages_to_clients.txt directly as is. |
| 329 |
|
| 330 |
Push a warning message to the client, it is a wrapper around: |
| 331 |
|
| 332 |
void push_warning_printf( |
| 333 |
THD *thd, Sql_condition::enum_warning_level level, |
| 334 |
uint code, const char *format, ...); |
| 335 |
*/ |
| 336 |
void ib_senderrf(THD *thd, /*!< in/out: session */ |
| 337 |
ib_log_level_t level, /*!< in: warning level */ |
| 338 |
uint32_t code, /*!< MySQL error code */ |
| 339 |
...); /*!< Args */ |
| 340 |
|
| 341 |
extern const char *TROUBLESHOOTING_MSG; |
| 342 |
extern const char *TROUBLESHOOT_DATADICT_MSG; |
| 343 |
extern const char *BUG_REPORT_MSG; |
| 344 |
extern const char *FORCE_RECOVERY_MSG; |
| 345 |
extern const char *ERROR_CREATING_MSG; |
| 346 |
extern const char *OPERATING_SYSTEM_ERROR_MSG; |
| 347 |
extern const char *FOREIGN_KEY_CONSTRAINTS_MSG; |
| 348 |
extern const char *INNODB_PARAMETERS_MSG; |
| 349 |
|
| 350 |
/** Returns the NUL terminated value of glob_hostname. |
| 351 |
@return pointer to glob_hostname. */ |
| 352 |
const char *server_get_hostname(); |
| 353 |
|
| 354 |
/** Get the error message format string. |
| 355 |
@return the format string or 0 if not found. */ |
| 356 |
const char *innobase_get_err_msg(int error_code); /*!< in: MySQL error code */ |
| 357 |
|
| 358 |
/** Compute the next autoinc value. |
| 359 |
|
| 360 |
For MySQL replication the autoincrement values can be partitioned among |
| 361 |
the nodes. The offset is the start or origin of the autoincrement value |
| 362 |
for a particular node. For n nodes the increment will be n and the offset |
| 363 |
will be in the interval [1, n]. The formula tries to allocate the next |
| 364 |
value for a particular node. |
| 365 |
|
| 366 |
Note: This function is also called with increment set to the number of |
| 367 |
values we want to reserve for multi-value inserts e.g., |
| 368 |
|
| 369 |
INSERT INTO T VALUES(), (), (); |
| 370 |
|
| 371 |
innobase_next_autoinc() will be called with increment set to 3 where |
| 372 |
autoinc_lock_mode != TRADITIONAL because we want to reserve 3 values for |
| 373 |
the multi-value INSERT above. |
| 374 |
@return the next value */ |
| 375 |
[[nodiscard]] ulonglong innobase_next_autoinc( |
| 376 |
ulonglong current, /*!< in: Current value */ |
| 377 |
ulonglong need, /*!< in: count of values needed */ |
| 378 |
ulonglong step, /*!< in: AUTOINC increment step */ |
| 379 |
ulonglong offset, /*!< in: AUTOINC offset */ |
| 380 |
ulonglong max_value); /*!< in: max value for type */ |
| 381 |
|
| 382 |
/********************************************************************** |
| 383 |
Check if the length of the identifier exceeds the maximum allowed. |
| 384 |
The input to this function is an identifier in charset my_charset_filename. |
| 385 |
return true when length of identifier is too long. */ |
| 386 |
bool innobase_check_identifier_length( |
| 387 |
const char *id); /* in: identifier to check. it must belong |
| 388 |
to charset my_charset_filename */ |
| 389 |
|
| 390 |
/********************************************************************** |
| 391 |
Converts an identifier from my_charset_filename to UTF-8 charset. */ |
| 392 |
uint innobase_convert_to_system_charset( |
| 393 |
char *to, /* out: converted identifier */ |
| 394 |
const char *from, /* in: identifier to convert */ |
| 395 |
ulint len, /* in: length of 'to', in bytes */ |
| 396 |
uint *errors); /* out: error return */ |
| 397 |
|
| 398 |
/********************************************************************** |
| 399 |
Converts an identifier from my_charset_filename to UTF-8 charset. */ |
| 400 |
uint innobase_convert_to_filename_charset( |
| 401 |
char *to, /* out: converted identifier */ |
| 402 |
const char *from, /* in: identifier to convert */ |
| 403 |
ulint len); /* in: length of 'to', in bytes */ |
| 404 |
|
| 405 |
/********************************************************************** |
| 406 |
Issue a warning that the row is too big. */ |
| 407 |
void ib_warn_row_too_big(const dict_table_t *table); |
| 408 |
|
| 409 |
/** InnoDB index push-down condition check defined in ha_innodb.cc |
| 410 |
@return ICP_NO_MATCH, ICP_MATCH, or ICP_OUT_OF_RANGE */ |
| 411 |
|
| 412 |
#include <my_icp.h> |
| 413 |
|
| 414 |
[[nodiscard]] ICP_RESULT innobase_index_cond( |
| 415 |
ha_innobase *h); /*!< in/out: pointer to ha_innobase */ |
| 416 |
|
| 417 |
/** Gets information on the durability property requested by thread. |
| 418 |
Used when writing either a prepare or commit record to the log |
| 419 |
buffer. |
| 420 |
@return the durability property. */ |
| 421 |
|
| 422 |
#include <dur_prop.h> |
| 423 |
|
| 424 |
[[nodiscard]] enum durability_properties thd_requested_durability( |
| 425 |
const THD *thd); /*!< in: thread handle */ |
| 426 |
|
| 427 |
/** Update the system variable with the given value of the InnoDB |
| 428 |
buffer pool size. |
| 429 |
@param[in] buf_pool_size given value of buffer pool size.*/ |
| 430 |
void innodb_set_buf_pool_size(long long buf_pool_size); |
| 431 |
|
| 432 |
/** Gets the InnoDB transaction handle for a MySQL handler object, creates |
| 433 |
an InnoDB transaction struct if the corresponding MySQL thread struct still |
| 434 |
lacks one. |
| 435 |
@param[in] thd MySQL thd (connection) object |
| 436 |
@return InnoDB transaction handle */ |
| 437 |
trx_t *check_trx_exists(THD *thd); |
| 438 |
|
| 439 |
/** Commits a transaction in an InnoDB database. |
| 440 |
@param[in] trx Transaction handle. */ |
| 441 |
void innobase_commit_low(trx_t *trx); |
| 442 |
|
| 443 |
/** Return the number of read threads for this session. |
| 444 |
@param[in] thd Session instance, or nullptr to query the global |
| 445 |
innodb_parallel_read_threads value. */ |
| 446 |
ulong thd_parallel_read_threads(THD *thd); |
| 447 |
|
| 448 |
/** Return the maximum buffer size to use for DDL. |
| 449 |
@param[in] thd Session instance, or nullptr to query the global |
| 450 |
innodb_parallel_read_threads value. |
| 451 |
@return memory upper limit in bytes. */ |
| 452 |
[[nodiscard]] ulong thd_ddl_buffer_size(THD *thd); |
| 453 |
|
| 454 |
/** Whether this is a computed virtual column */ |
| 455 |
#define innobase_is_v_fld(field) ((field)->gcol_info && !(field)->stored_in_db) |
| 456 |
|
| 457 |
/** @return the number of DDL threads to use (global/session). */ |
| 458 |
[[nodiscard]] size_t thd_ddl_threads(THD *thd) noexcept; |
| 459 |
|
| 460 |
#endif /* HA_INNODB_PROTOTYPES_H */ |