MySQL 8.0.39
Source Code Documentation
ha_prototypes.h File Reference

Prototypes for global functions in ha_innodb.cc that are called by InnoDB C code. More...

#include "univ.i"
#include <sql/dd/types/column.h>
#include <my_icp.h>
#include <dur_prop.h>

Go to the source code of this file.

Macros

#define innobase_is_v_fld(field)   ((field)->gcol_info && !(field)->stored_in_db)
 Whether this is a computed virtual column. More...
 

Enumerations

enum  ib_log_level_t { IB_LOG_LEVEL_INFO , IB_LOG_LEVEL_WARN , IB_LOG_LEVEL_ERROR , IB_LOG_LEVEL_FATAL }
 Corresponds to Sql_condition:enum_warning_level. More...
 

Functions

ulint innobase_raw_format (const char *data, ulint data_len, ulint charset_coll, char *buf, ulint buf_size)
 Formats the raw data in "data" (in InnoDB on-disk format) that is of type DATA_(CHAR|VARCHAR|MYSQL|VARMYSQL) using "charset_coll" and writes the result to "buf". More...
 
void innobase_quote_identifier (FILE *file, trx_t *trx, const char *id)
 Quote a standard SQL identifier like tablespace, index or column name. More...
 
std::string innobase_quote_identifier (trx_t *trx, const char *id)
 Quote an standard SQL identifier like tablespace, index or column name. More...
 
char * innobase_convert_name (char *buf, ulint buflen, const char *id, ulint idlen, THD *thd)
 Convert a table name to the MySQL system_charset_info (UTF-8). More...
 
bool thd_is_replication_slave_thread (THD *thd)
 Returns true if the thread is the replication thread on the slave server. More...
 
bool thd_has_edited_nontrans_tables (THD *thd)
 Returns true if the transaction this thread is processing has edited non-transactional tables. More...
 
void innobase_mysql_print_thd (FILE *f, THD *thd, uint max_query_len)
 Prints info of a THD object (== user session thread) to the given file. More...
 
ulint get_innobase_type_from_mysql_type (ulint *unsigned_flag, const void *f)
 Converts a MySQL type to an InnoDB type. More...
 
ulint get_innobase_type_from_mysql_dd_type (ulint *unsigned_flag, ulint *binary_type, ulint *charset_no, dd::enum_column_types dd_type, const CHARSET_INFO *field_charset, bool is_unsigned)
 Converts a MySQL data-dictionary type to an InnoDB type. More...
 
void innobase_get_cset_width (ulint cset, ulint *mbminlen, ulint *mbmaxlen)
 Get the variable length bounds of the given character set. More...
 
int innobase_strcasecmp (const char *a, const char *b)
 Compares NUL-terminated UTF-8 strings case insensitively. More...
 
const char * innobase_basename (const char *path_name)
 Strip dir name from a full path name and return only the file name. More...
 
bool thd_is_query_block (const THD *thd)
 Returns true if the thread is executing a SELECT statement. More...
 
void innobase_casedn_str (char *a)
 Makes all characters in a NUL-terminated UTF-8 string lower case. More...
 
void innobase_casedn_path (char *a)
 Makes all characters in a NUL-terminated UTF-8 path string lower case. More...
 
const CHARSET_INFOinnobase_get_charset (THD *thd)
 Determines the connection character set. More...
 
const char * innobase_get_stmt_unsafe (THD *thd, size_t *length)
 Determines the current SQL statement. More...
 
size_t innobase_get_stmt_safe (THD *thd, char *buf, size_t buflen)
 Determines the current SQL statement. More...
 
ulint innobase_get_at_most_n_mbchars (ulint charset_id, ulint prefix_len, ulint data_len, const char *str)
 This function is used to find the storage length in bytes of the first n characters for prefix indexes using a multibyte character set. More...
 
bool innobase_should_madvise_buf_pool ()
 Checks sys_vars and determines if allocator should mark large memory segments with MADV_DONTDUMP. More...
 
void innobase_disable_core_dump ()
 Make sure that core file will not be generated, as generating a core file might violate our promise to not dump buffer pool data, and/or might dump not the expected memory pages due to failure in using madvise. More...
 
std::chrono::seconds thd_lock_wait_timeout (THD *thd)
 Returns the lock wait timeout for the current connection. More...
 
void thd_set_lock_wait_time (THD *thd, std::chrono::steady_clock::duration value)
 Set the time waited for the lock for the current query. More...
 
const char * thd_innodb_tmpdir (THD *thd)
 Get the value of innodb_tmpdir. More...
 
char ** thd_innodb_interpreter_output (THD *thd)
 Obtain the value of the latest output from InnoDB Interpreter/Tester module (ib::Tester). More...
 
char ** thd_innodb_interpreter (THD *thd)
 Obtain the latest command executed by InnoDB Interpreter/Tester module (ib::Tester). More...
 
ulint innobase_get_table_cache_size (void)
 Get the current setting of the table_cache_size global parameter. More...
 
ulint innobase_get_lower_case_table_names (void)
 Get the current setting of the lower_case_table_names global parameter from mysqld.cc. More...
 
int innobase_nocase_compare (const void *cs, const char *s1, const char *s2)
 Compare two character strings case insensitively according to their charset. More...
 
bool thd_trx_is_read_only (THD *thd)
 Returns true if transaction should be flagged as read-only. More...
 
THDthd_trx_arbitrate (THD *requestor, THD *holder)
 Check if the transaction can be rolled back. More...
 
int thd_trx_priority (THD *thd)
 
bool thd_trx_is_auto_commit (THD *thd)
 Check if the transaction is an auto-commit transaction. More...
 
std::chrono::system_clock::time_point thd_start_time (THD *thd)
 Get the thread start time. More...
 
void innobase_format_name (char *buf, ulint buflen, const char *name)
 A wrapper function of innobase_convert_name(), convert a table name to the MySQL system_charset_info (UTF-8) and quote it if needed. More...
 
void ib_errf (THD *thd, ib_log_level_t level, uint32_t code, const char *format,...)
 Use this when the args are first converted to a formatted string and then passed to the format string from messages_to_clients.txt. More...
 
void ib_senderrf (THD *thd, ib_log_level_t level, uint32_t code,...)
 Use this when the args are passed to the format string from messages_to_clients.txt directly as is. More...
 
const char * server_get_hostname ()
 Returns the NUL terminated value of glob_hostname. More...
 
const char * innobase_get_err_msg (int error_code)
 Get the error message format string. More...
 
ulonglong innobase_next_autoinc (ulonglong current, ulonglong need, ulonglong step, ulonglong offset, ulonglong max_value)
 Compute the next autoinc value. More...
 
bool innobase_check_identifier_length (const char *id)
 
uint innobase_convert_to_system_charset (char *to, const char *from, ulint len, uint *errors)
 
uint innobase_convert_to_filename_charset (char *to, const char *from, ulint len)
 
void ib_warn_row_too_big (const dict_table_t *table)
 
ICP_RESULT innobase_index_cond (ha_innobase *h)
 InnoDB index push-down condition check defined in ha_innodb.cc. More...
 
enum durability_properties thd_requested_durability (const THD *thd)
 Gets information on the durability property requested by thread. More...
 
void innodb_set_buf_pool_size (long long buf_pool_size)
 Update the system variable with the given value of the InnoDB buffer pool size. More...
 
trx_tcheck_trx_exists (THD *thd)
 Gets the InnoDB transaction handle for a MySQL handler object, creates an InnoDB transaction struct if the corresponding MySQL thread struct still lacks one. More...
 
void innobase_commit_low (trx_t *trx)
 Commits a transaction in an InnoDB database. More...
 
ulong thd_parallel_read_threads (THD *thd)
 Return the number of read threads for this session. More...
 
ulong thd_ddl_buffer_size (THD *thd)
 Return the maximum buffer size to use for DDL. More...
 
size_t thd_ddl_threads (THD *thd) noexcept
 

Variables

const char * TROUBLESHOOTING_MSG
 
const char * TROUBLESHOOT_DATADICT_MSG
 
const char * BUG_REPORT_MSG
 
const char * FORCE_RECOVERY_MSG
 
const char * ERROR_CREATING_MSG
 
const char * OPERATING_SYSTEM_ERROR_MSG
 
const char * FOREIGN_KEY_CONSTRAINTS_MSG
 
const char * INNODB_PARAMETERS_MSG
 

Detailed Description

Prototypes for global functions in ha_innodb.cc that are called by InnoDB C code.

NOTE: This header is intended to insulate InnoDB from SQL names and functions. Do not include any headers other than univ.i into this unless they are very simple headers.

Macro Definition Documentation

◆ innobase_is_v_fld

#define innobase_is_v_fld (   field)    ((field)->gcol_info && !(field)->stored_in_db)

Whether this is a computed virtual column.

Enumeration Type Documentation

◆ ib_log_level_t

Corresponds to Sql_condition:enum_warning_level.

Enumerator
IB_LOG_LEVEL_INFO 
IB_LOG_LEVEL_WARN 
IB_LOG_LEVEL_ERROR 
IB_LOG_LEVEL_FATAL 

Function Documentation

◆ check_trx_exists()

trx_t * check_trx_exists ( THD thd)

Gets the InnoDB transaction handle for a MySQL handler object, creates an InnoDB transaction struct if the corresponding MySQL thread struct still lacks one.

Parameters
[in]thdMySQL thd (connection) object
Returns
InnoDB transaction handle
InnoDB transaction handle
Parameters
thdin: user thread handle

◆ get_innobase_type_from_mysql_dd_type()

ulint get_innobase_type_from_mysql_dd_type ( ulint unsigned_flag,
ulint binary_type,
ulint charset_no,
dd::enum_column_types  dd_type,
const CHARSET_INFO field_charset,
bool  is_unsigned 
)

Converts a MySQL data-dictionary type to an InnoDB type.

Also returns a few attributes which are useful for precise type calculation.

Note
This function is version of get_innobase_type_from_mysql_type() with added knowledge about how additional attributes calculated (e.g. in create_table_info_t::create_table_def()) and about behavior of Field class and its descendats.
It allows to get InnoDB generic and precise types directly from MySQL data-dictionary info, bypassing expensive construction of Field objects.
Parameters
[out]unsigned_flagDATA_UNSIGNED if an 'unsigned type'.
[out]binary_typeDATA_BINARY_TYPE if a 'binary type'.
[out]charset_noCollation id for string types.
[in]dd_typeMySQL data-dictionary type.
[in]field_charsetCharset.
[in]is_unsignedMySQL data-dictionary unsigned flag.
Returns
DATA_BINARY, DATA_VARCHAR, ...

◆ get_innobase_type_from_mysql_type()

ulint get_innobase_type_from_mysql_type ( ulint unsigned_flag,
const void *  f 
)

Converts a MySQL type to an InnoDB type.

Note that this function returns the 'mtype' of InnoDB. InnoDB differentiates between MySQL's old <= 4.1 VARCHAR and the new true VARCHAR in >= 5.0.3 by the 'prtype'.

Parameters
[out]unsigned_flagDATA_UNSIGNED if an 'unsigned type'; at least ENUM and SET, and unsigned integer types are 'unsigned types'
[in]fMySQL Field
Returns
DATA_BINARY, DATA_VARCHAR, ...

◆ ib_errf()

void ib_errf ( THD thd,
ib_log_level_t  level,
uint32_t  code,
const char *  format,
  ... 
)

Use this when the args are first converted to a formatted string and then passed to the format string from messages_to_clients.txt.

The error message format must be: "Some string ... %s".

Push a warning message to the client, it is a wrapper around:

void push_warning_printf( THD *thd, Sql_condition::enum_warning_level level, uint code, const char *format, ...);

The error message format must be: "Some string ... %s".

Push a warning message to the client, it is a wrapper around:

void push_warning_printf( THD *thd, Sql_condition::enum_condition_level level, uint code, const char *format, ...);

Parameters
thdin/out: session
levelin: warning level
codeMySQL error code
formatprintf format
...Args

◆ ib_senderrf()

void ib_senderrf ( THD thd,
ib_log_level_t  level,
uint32_t  code,
  ... 
)

Use this when the args are passed to the format string from messages_to_clients.txt directly as is.

Push a warning message to the client, it is a wrapper around:

void push_warning_printf( THD *thd, Sql_condition::enum_warning_level level, uint code, const char *format, ...); Args

Push a warning message to the client, it is a wrapper around:

void push_warning_printf( THD *thd, Sql_condition::enum_condition_level level, uint code, const char *format, ...);

Parameters
thdin/out: session
levelin: warning level
codeMySQL error code
...Args

◆ ib_warn_row_too_big()

void ib_warn_row_too_big ( const dict_table_t table)

◆ innobase_basename()

const char * innobase_basename ( const char *  path_name)

Strip dir name from a full path name and return only the file name.

Parameters
[in]path_namefull path name
Returns
file name or "null" if no file name

◆ innobase_casedn_path()

void innobase_casedn_path ( char *  a)

Makes all characters in a NUL-terminated UTF-8 path string lower case.

in/out: string to put in lower case

Parameters
ain/out: string to put in lower case

◆ innobase_casedn_str()

void innobase_casedn_str ( char *  a)

Makes all characters in a NUL-terminated UTF-8 string lower case.

in/out: string to put in lower case

Parameters
ain/out: string to put in lower case

◆ innobase_check_identifier_length()

bool innobase_check_identifier_length ( const char *  id)

◆ innobase_commit_low()

void innobase_commit_low ( trx_t trx)

Commits a transaction in an InnoDB database.

Parameters
[in]trxTransaction handle.
Parameters
trxin: transaction handle

◆ innobase_convert_name()

char * innobase_convert_name ( char *  buf,
ulint  buflen,
const char *  id,
ulint  idlen,
THD thd 
)

Convert a table name to the MySQL system_charset_info (UTF-8).

Returns
pointer to the end of buf in: MySQL connection thread, or NULL
pointer to the end of buf
Parameters
bufout: buffer for converted identifier
buflenin: length of buf, in bytes
idin: table name to convert
idlenin: length of id, in bytes
thdin: MySQL connection thread, or NULL

◆ innobase_convert_to_filename_charset()

uint innobase_convert_to_filename_charset ( char *  to,
const char *  from,
ulint  len 
)

◆ innobase_convert_to_system_charset()

uint innobase_convert_to_system_charset ( char *  to,
const char *  from,
ulint  len,
uint errors 
)

◆ innobase_disable_core_dump()

void innobase_disable_core_dump ( )

Make sure that core file will not be generated, as generating a core file might violate our promise to not dump buffer pool data, and/or might dump not the expected memory pages due to failure in using madvise.

◆ innobase_format_name()

void innobase_format_name ( char *  buf,
ulint  buflen,
const char *  name 
)

A wrapper function of innobase_convert_name(), convert a table name to the MySQL system_charset_info (UTF-8) and quote it if needed.

Parameters
[out]bufBuffer for converted identifier
[in]buflenLength of buf, in bytes
[in]nameTable name to format

◆ innobase_get_at_most_n_mbchars()

ulint innobase_get_at_most_n_mbchars ( ulint  charset_id,
ulint  prefix_len,
ulint  data_len,
const char *  str 
)

This function is used to find the storage length in bytes of the first n characters for prefix indexes using a multibyte character set.

The function finds charset information and returns length of prefix_len characters in the index field in bytes.

Returns
number of bytes occupied by the first n characters in: character string

The function finds charset information and returns length of prefix_len characters in the index field in bytes.

Returns
number of bytes occupied by the first n characters

< character length in bytes

< number of characters in prefix

< charset used in the field

Parameters
charset_idin: character set id
prefix_lenin: prefix length in bytes of the index (this has to be divided by mbmaxlen to get the number of CHARACTERS n in the prefix)
data_lenin: length of the string in bytes
strin: character string

◆ innobase_get_charset()

const CHARSET_INFO * innobase_get_charset ( THD mysql_thd)

Determines the connection character set.

Returns
connection character set in: MySQL thread handle
connection character set
Parameters
mysql_thdin: MySQL thread handle

◆ innobase_get_cset_width()

void innobase_get_cset_width ( ulint  cset,
ulint mbminlen,
ulint mbmaxlen 
)

Get the variable length bounds of the given character set.

Parameters
[in]csetMysql charset-collation code
[out]mbminlenMinimum length of a char (in bytes)
[out]mbmaxlenMaximum length of a char (in bytes)

◆ innobase_get_err_msg()

const char * innobase_get_err_msg ( int  error_code)

Get the error message format string.

Returns
the format string or 0 if not found. in: MySQL error code
the format string or 0 if not found.
Parameters
error_codein: MySQL error code

◆ innobase_get_lower_case_table_names()

ulint innobase_get_lower_case_table_names ( void  )

Get the current setting of the lower_case_table_names global parameter from mysqld.cc.

We do a dirty read because for one there is no synchronization object and secondly there is little harm in doing so even if we get a torn read.

Returns
value of lower_case_table_names

◆ innobase_get_stmt_safe()

size_t innobase_get_stmt_safe ( THD thd,
char *  buf,
size_t  buflen 
)

Determines the current SQL statement.

Thread safe, can be called from any thread as the string is copied into the provided buffer.

Parameters
[in]thdMySQL thread handle
[out]bufBuffer containing SQL statement
[in]buflenLength of provided buffer
Returns
Length of the SQL statement

◆ innobase_get_stmt_unsafe()

const char * innobase_get_stmt_unsafe ( THD thd,
size_t *  length 
)

Determines the current SQL statement.

Thread unsafe, can only be called from the thread owning the THD.

Parameters
[in]thdMySQL thread handle
[out]lengthLength of the SQL statement
Returns
SQL statement string

◆ innobase_get_table_cache_size()

ulint innobase_get_table_cache_size ( void  )

Get the current setting of the table_cache_size global parameter.

We do a dirty read because for one there is no synchronization object and secondly there is little harm in doing so even if we get a torn read.

Returns
SQL statement string

Get the current setting of the table_cache_size global parameter.

We do a dirty read because for one there is no synchronization object and secondly there is little harm in doing so even if we get a torn read.

Returns
value of table_def_size

◆ innobase_index_cond()

ICP_RESULT innobase_index_cond ( ha_innobase h)

InnoDB index push-down condition check defined in ha_innodb.cc.

Returns
ICP_NO_MATCH, ICP_MATCH, or ICP_OUT_OF_RANGE in/out: pointer to ha_innobase

InnoDB index push-down condition check defined in ha_innodb.cc.

InnoDB index push-down condition check

Returns
ICP_NO_MATCH, ICP_MATCH, or ICP_OUT_OF_RANGE
Parameters
hin/out: pointer to ha_innobase

◆ innobase_mysql_print_thd()

void innobase_mysql_print_thd ( FILE *  f,
THD thd,
uint  max_query_len 
)

Prints info of a THD object (== user session thread) to the given file.

Parameters
[in]fOutput stream
[in]thdPointer to a mysql thd object
[in]max_query_lenMax query length to print, must be positive
Parameters
fin: output stream
thdin: MySQL THD object
max_query_lenin: max query length to print, must be positive

◆ innobase_next_autoinc()

ulonglong innobase_next_autoinc ( ulonglong  current,
ulonglong  need,
ulonglong  step,
ulonglong  offset,
ulonglong  max_value 
)

Compute the next autoinc value.

For MySQL replication the autoincrement values can be partitioned among the nodes. The offset is the start or origin of the autoincrement value for a particular node. For n nodes the increment will be n and the offset will be in the interval [1, n]. The formula tries to allocate the next value for a particular node.

Note: This function is also called with increment set to the number of values we want to reserve for multi-value inserts e.g.,

    INSERT INTO T VALUES(), (), ();

innobase_next_autoinc() will be called with increment set to 3 where autoinc_lock_mode != TRADITIONAL because we want to reserve 3 values for the multi-value INSERT above.

Returns
the next value in: max value for type

For MySQL replication the autoincrement values can be partitioned among the nodes. The offset is the start or origin of the autoincrement value for a particular node. For n nodes the increment will be n and the offset will be in the interval [1, n]. The formula tries to allocate the next value for a particular node.

Note: This function is also called with increment set to the number of values we want to reserve for multi-value inserts e.g.,

    INSERT INTO T VALUES(), (), ();

innobase_next_autoinc() will be called with increment set to 3 where autoinc_lock_mode != TRADITIONAL because we want to reserve 3 values for the multi-value INSERT above.

Returns
the next value
Parameters
currentin: Current value
needin: count of values needed
stepin: AUTOINC increment step
offsetin: AUTOINC offset
max_valuein: max value for type

◆ innobase_nocase_compare()

int innobase_nocase_compare ( const void *  cs,
const char *  s1,
const char *  s2 
)

Compare two character strings case insensitively according to their charset.

Parameters
[in]cscharacter set
[in]s1string 1
[in]s2string 2
Returns
0 if the two strings are equal

◆ innobase_quote_identifier() [1/2]

void innobase_quote_identifier ( FILE *  file,
trx_t trx,
const char *  id 
)

Quote a standard SQL identifier like tablespace, index or column name.

Parameters
[in]fileoutput stream
[in]trxInnoDB transaction, or NULL
[in]ididentifier to quote

◆ innobase_quote_identifier() [2/2]

std::string innobase_quote_identifier ( trx_t trx,
const char *  id 
)

Quote an standard SQL identifier like tablespace, index or column name.

Return the string as an std:string object.

Parameters
[in]trxInnoDB transaction, or NULL
[in]ididentifier to quote
Returns
a std::string with id properly quoted.

◆ innobase_raw_format()

ulint innobase_raw_format ( const char *  data,
ulint  data_len,
ulint  charset_coll,
char *  buf,
ulint  buf_size 
)

Formats the raw data in "data" (in InnoDB on-disk format) that is of type DATA_(CHAR|VARCHAR|MYSQL|VARMYSQL) using "charset_coll" and writes the result to "buf".

The result is converted to "system_charset_info". Not more than "buf_size" bytes are written to "buf". The result is always NUL-terminated (provided buf_size > 0) and the number of bytes that were written to "buf" is returned (including the terminating NUL).

Returns
number of bytes that were written in: output buffer size in bytes

The result is converted to "system_charset_info". Not more than "buf_size" bytes are written to "buf". The result is always NUL-terminated (provided buf_size > 0) and the number of bytes that were written to "buf" is returned (including the terminating NUL).

Returns
number of bytes that were written
Parameters
datain: raw data
data_lenin: raw data length in bytes
charset_collin: charset collation
bufout: output buffer
buf_sizein: output buffer size in bytes

◆ innobase_should_madvise_buf_pool()

bool innobase_should_madvise_buf_pool ( )

Checks sys_vars and determines if allocator should mark large memory segments with MADV_DONTDUMP.

Returns
true iff @global.core_file AND NOT @global.innodb_buffer_pool_in_core_file

◆ innobase_strcasecmp()

int innobase_strcasecmp ( const char *  a,
const char *  b 
)

Compares NUL-terminated UTF-8 strings case insensitively.

Returns
0 if a=b, < 0 if a < b, > 1 if a > b in: second string to compare
0 if a=b, <0 if a<b, >1 if a>b
Parameters
ain: first string to compare
bin: second string to compare

◆ innodb_set_buf_pool_size()

void innodb_set_buf_pool_size ( long long  buf_pool_size)

Update the system variable with the given value of the InnoDB buffer pool size.

Parameters
[in]buf_pool_sizegiven value of buffer pool size.

◆ server_get_hostname()

const char * server_get_hostname ( )

Returns the NUL terminated value of glob_hostname.

Returns
pointer to glob_hostname.

◆ thd_ddl_buffer_size()

ulong thd_ddl_buffer_size ( THD thd)

Return the maximum buffer size to use for DDL.

Parameters
[in]thdSession instance, or nullptr to query the global innodb_parallel_read_threads value.
Returns
memory upper limit in bytes.

◆ thd_ddl_threads()

size_t thd_ddl_threads ( THD thd)
noexcept
Returns
the number of DDL threads to use (global/session).

◆ thd_has_edited_nontrans_tables()

bool thd_has_edited_nontrans_tables ( THD thd)

Returns true if the transaction this thread is processing has edited non-transactional tables.

Used by the deadlock detector when deciding which transaction to rollback in case of a deadlock - we try to avoid rolling back transactions that have edited non-transactional tables.

Returns
true if non-transactional tables have been edited in: thread handle

Used by the deadlock detector when deciding which transaction to rollback in case of a deadlock - we try to avoid rolling back transactions that have edited non-transactional tables.

Returns
true if non-transactional tables have been edited
Parameters
thdin: thread handle

◆ thd_innodb_interpreter()

char ** thd_innodb_interpreter ( THD thd)

Obtain the latest command executed by InnoDB Interpreter/Tester module (ib::Tester).

Parameters
[in]thdthread handle
Returns
pointer to the output string.

◆ thd_innodb_interpreter_output()

char ** thd_innodb_interpreter_output ( THD thd)

Obtain the value of the latest output from InnoDB Interpreter/Tester module (ib::Tester).

Parameters
[in]thdthread handle
Returns
pointer to the output string.

◆ thd_innodb_tmpdir()

const char * thd_innodb_tmpdir ( THD thd)

Get the value of innodb_tmpdir.

Parameters
[in]thdthread handle, or nullptr to query the global innodb_tmpdir.
Returns
nullptr if innodb_tmpdir=""

◆ thd_is_query_block()

bool thd_is_query_block ( const THD thd)

Returns true if the thread is executing a SELECT statement.

Returns
true if thd is executing SELECT in: thread handle
true if thd is executing SELECT
Parameters
thdin: thread handle

◆ thd_is_replication_slave_thread()

bool thd_is_replication_slave_thread ( THD thd)

Returns true if the thread is the replication thread on the slave server.

Used in srv_conc_enter_innodb() to determine if the thread should be allowed to enter InnoDB - the replication thread is treated differently than other threads. Also used in srv_conc_force_exit_innodb().

Returns
true if thd is the replication thread in: thread handle

Used in srv_conc_enter_innodb() to determine if the thread should be allowed to enter InnoDB - the replication thread is treated differently than other threads. Also used in srv_conc_force_exit_innodb().

Returns
true if thd is the replication thread
Parameters
thdin: thread handle

◆ thd_lock_wait_timeout()

std::chrono::seconds thd_lock_wait_timeout ( THD thd)

Returns the lock wait timeout for the current connection.

Returns
the lock wait timeout in: thread handle, or NULL to query the global innodb_lock_wait_timeout

◆ thd_parallel_read_threads()

ulong thd_parallel_read_threads ( THD thd)

Return the number of read threads for this session.

Parameters
[in]thdSession instance, or nullptr to query the global innodb_parallel_read_threads value.

◆ thd_requested_durability()

enum durability_properties thd_requested_durability ( const THD thd)

Gets information on the durability property requested by thread.

Used when writing either a prepare or commit record to the log buffer.

Returns
the durability property. in: thread handle

Used when writing either a prepare or commit record to the log buffer.

Returns
the durability property.
Parameters
thdin: thread handle

◆ thd_set_lock_wait_time()

void thd_set_lock_wait_time ( THD thd,
std::chrono::steady_clock::duration  value 
)

Set the time waited for the lock for the current query.

Parameters
[in,out]thdThread handle.
[in]valueTime waited for the lock.

◆ thd_start_time()

std::chrono::system_clock::time_point thd_start_time ( THD thd)

Get the thread start time.

Returns
the thread start time. in: thread handle, or NULL

◆ thd_trx_arbitrate()

THD * thd_trx_arbitrate ( THD requestor,
THD holder 
)

Check if the transaction can be rolled back.

Parameters
[in]requestorSession requesting the lock
[in]holderSession that holds the lock
Returns
the session that will be rolled back, null don't care

◆ thd_trx_is_auto_commit()

bool thd_trx_is_auto_commit ( THD thd)

Check if the transaction is an auto-commit transaction.

true also implies that it is a SELECT (read-only) transaction.

Returns
true if the transaction is an auto commit read-only transaction. in: thread handle, or NULL

true also implies that it is a SELECT (read-only) transaction.

Returns
true if the transaction is an auto commit read-only transaction.
Parameters
thdin: thread handle, can be NULL

◆ thd_trx_is_read_only()

bool thd_trx_is_read_only ( THD thd)

Returns true if transaction should be flagged as read-only.

Returns
true if the thd is marked as read-only in/out: thread handle
true if the thd is marked as read-only
Parameters
thdin: thread handle

◆ thd_trx_priority()

int thd_trx_priority ( THD thd)
Parameters
[in]thdSession to check
Returns
the priority

Variable Documentation

◆ BUG_REPORT_MSG

const char* BUG_REPORT_MSG
extern

◆ ERROR_CREATING_MSG

const char* ERROR_CREATING_MSG
extern

◆ FORCE_RECOVERY_MSG

const char* FORCE_RECOVERY_MSG
extern

◆ FOREIGN_KEY_CONSTRAINTS_MSG

const char* FOREIGN_KEY_CONSTRAINTS_MSG
extern

◆ INNODB_PARAMETERS_MSG

const char* INNODB_PARAMETERS_MSG
extern

◆ OPERATING_SYSTEM_ERROR_MSG

const char* OPERATING_SYSTEM_ERROR_MSG
extern

◆ TROUBLESHOOT_DATADICT_MSG

const char* TROUBLESHOOT_DATADICT_MSG
extern

◆ TROUBLESHOOTING_MSG

const char* TROUBLESHOOTING_MSG
extern