MySQL 8.0.39
Source Code Documentation
|
#include <stddef.h>
#include <sys/types.h>
#include "dur_prop.h"
#include "lex_string.h"
#include "m_ctype.h"
#include "mysql/components/services/bits/psi_thread_bits.h"
#include "sql/handler.h"
Go to the source code of this file.
Functions | |
THD * | create_internal_thd () |
void | destroy_internal_thd (THD *thd) |
void | thd_init (THD *thd, char *stack_start) |
Set up various THD data for a new connection. More... | |
void | thd_init (THD *thd, char *stack_start, bool bound, PSI_thread_key psi_key, unsigned int psi_seqnum) |
Set up various THD data for a new connection. More... | |
THD * | create_thd (bool enable_plugins, bool background_thread, bool bound, PSI_thread_key psi_key, unsigned int psi_seqnum) |
Create a THD and do proper initialization of it. More... | |
void | destroy_thd (THD *thd, bool clear_pfs_instr) |
Cleanup the THD object, remove it from the global list of THDs and delete it. More... | |
void | destroy_thd (THD *thd) |
Cleanup the THD object, remove it from the global list of THDs and delete it. More... | |
void | thd_set_thread_stack (THD *thd, const char *stack_start) |
Set thread stack in THD object. More... | |
partition_info * | thd_get_work_part_info (THD *thd) |
Returns the partition_info working copy. More... | |
enum_tx_isolation | thd_get_trx_isolation (const THD *thd) |
const CHARSET_INFO * | thd_charset (THD *thd) |
LEX_CSTRING | thd_query_unsafe (THD *thd) |
Get the current query string for the thread. More... | |
size_t | thd_query_safe (THD *thd, char *buf, size_t buflen) |
Get the current query string for the thread. More... | |
int | thd_slave_thread (const THD *thd) |
Check if a user thread is a replication slave thread. More... | |
int | thd_non_transactional_update (const THD *thd) |
Check if a user thread is running a non-transactional update. More... | |
int | thd_binlog_format (const THD *thd) |
Get the user thread's binary logging format. More... | |
bool | thd_binlog_filter_ok (const THD *thd) |
Check if binary logging is filtered for thread's current db. More... | |
bool | thd_sqlcom_can_generate_row_events (const THD *thd) |
Check if the query may generate row changes which may end up in the binary. More... | |
durability_properties | thd_get_durability_property (const THD *thd) |
Gets information on the durability property requested by a thread. More... | |
void | thd_get_autoinc (const THD *thd, ulong *off, ulong *inc) |
Get the auto_increment_offset auto_increment_increment. More... | |
size_t | thd_get_tmp_table_size (const THD *thd) |
Get the tmp_table_size threshold. More... | |
bool | thd_is_strict_mode (const THD *thd) |
Is strict sql_mode set. More... | |
bool | thd_is_error (const THD *thd) |
Is an error set in the DA. More... | |
bool | is_mysql_datadir_path (const char *path) |
Test a file path whether it is same as mysql data directory path. More... | |
int | mysql_tmpfile_path (const char *path, const char *prefix) |
Create a temporary file. More... | |
bool | thd_is_bootstrap_thread (THD *thd) |
Check if the server is in the process of being initialized. More... | |
bool | thd_is_dd_update_stmt (const THD *thd) |
Is statement updating the data dictionary tables. More... | |
my_thread_id | thd_thread_id (const THD *thd) |
THD * create_internal_thd | ( | ) |
THD * create_thd | ( | bool | enable_plugins, |
bool | background_thread, | ||
bool | bound, | ||
PSI_thread_key | psi_key, | ||
unsigned int | psi_seqnum | ||
) |
Create a THD and do proper initialization of it.
enable_plugins | Should dynamic plugin support be enabled? |
background_thread | Is this a background thread? |
bound | True if bound to a physical thread. |
psi_key | Instrumentation key for the thread. |
psi_seqnum | Instrumentation sequence number for the thread. |
void destroy_internal_thd | ( | THD * | thd | ) |
void destroy_thd | ( | THD * | thd | ) |
Cleanup the THD object, remove it from the global list of THDs and delete it.
thd | Pointer to THD object. |
void destroy_thd | ( | THD * | thd, |
bool | clear_pfs_instr | ||
) |
Cleanup the THD object, remove it from the global list of THDs and delete it.
thd | Pointer to THD object. |
clear_pfs_instr | If true, then clear thread PFS instrumentations. |
bool is_mysql_datadir_path | ( | const char * | path | ) |
Test a file path whether it is same as mysql data directory path.
path | null terminated character string |
true | The path is different from mysql data directory. |
false | The path is same as mysql data directory. |
int mysql_tmpfile_path | ( | const char * | path, |
const char * | prefix | ||
) |
Create a temporary file.
The temporary file is created in a location specified by the parameter path. if path is null, then it will be created on the location given by the mysql server configuration (–tmpdir option). The caller does not need to delete the file, it will be deleted automatically.
path | location for creating temporary file |
prefix | prefix for temporary file name |
-1 | error |
>=0 | a file handle that can be passed to dup or my_close |
bool thd_binlog_filter_ok | ( | const THD * | thd | ) |
Check if binary logging is filtered for thread's current db.
thd | Thread handle |
1 | the query is not filtered, 0 otherwise. |
int thd_binlog_format | ( | const THD * | thd | ) |
Get the user thread's binary logging format.
thd | user thread |
const CHARSET_INFO * thd_charset | ( | THD * | thd | ) |
void thd_get_autoinc | ( | const THD * | thd, |
ulong * | off, | ||
ulong * | inc | ||
) |
Get the auto_increment_offset auto_increment_increment.
thd | Thread object |
off | auto_increment_offset |
inc | auto_increment_increment |
durability_properties thd_get_durability_property | ( | const THD * | thd | ) |
Gets information on the durability property requested by a thread.
thd | Thread handle |
size_t thd_get_tmp_table_size | ( | const THD * | thd | ) |
Get the tmp_table_size threshold.
thd | Thread object |
enum_tx_isolation thd_get_trx_isolation | ( | const THD * | thd | ) |
partition_info * thd_get_work_part_info | ( | THD * | thd | ) |
Returns the partition_info working copy.
Used to see if a table should be created with partitioning.
thd | thread context |
void thd_init | ( | THD * | thd, |
char * | stack_start | ||
) |
Set up various THD data for a new connection.
thd | THD object |
stack_start | Start of stack for connection |
void thd_init | ( | THD * | thd, |
char * | stack_start, | ||
bool | bound, | ||
PSI_thread_key | psi_key, | ||
unsigned int | psi_seqnum | ||
) |
Set up various THD data for a new connection.
thd | THD object |
stack_start | Start of stack for connection |
bound | True if bound to a physical thread. |
psi_key | Instrumentation key for the thread. |
psi_seqnum | Instrumentation sequence number for the thread. |
bool thd_is_bootstrap_thread | ( | THD * | thd | ) |
Check if the server is in the process of being initialized.
Check the thread type of the THD. If this is a thread type being used for initializing the DD or the server, return true.
thd | Needed since this is an opaque type in the SE. |
true | The thread is a bootstrap thread. |
false | The thread is not a bootstrap thread. |
bool thd_is_dd_update_stmt | ( | const THD * | thd | ) |
Is statement updating the data dictionary tables.
The thread switches to the data dictionary tables update context using the dd::Update_dictionary_tables_ctx while updating dictionary tables. If thread is in this context then the method returns true otherwise false. This method is used by the InnoDB while updating the tables to mark transaction as DDL if this method returns true.
thd | Thread handle. |
true | Updates data dictionary tables. |
false | Otherwise. |
bool thd_is_error | ( | const THD * | thd | ) |
Is an error set in the DA.
Needed by InnoDB to catch behavior modified by an error handler.
thd | Thread object |
true | An error has been raised. |
false | No error has been raised. |
bool thd_is_strict_mode | ( | const THD * | thd | ) |
Is strict sql_mode set.
Needed by InnoDB.
thd | Thread object |
true | sql_mode has strict mode (all or trans). |
false | sql_mode has not strict mode (all or trans). |
int thd_non_transactional_update | ( | const THD * | thd | ) |
Check if a user thread is running a non-transactional update.
thd | user thread |
0 | the user thread is not running a non-transactional update |
1 | the user thread is running a non-transactional update |
size_t thd_query_safe | ( | THD * | thd, |
char * | buf, | ||
size_t | buflen | ||
) |
Get the current query string for the thread.
thd | The MySQL internal thread pointer |
buf | Buffer where the query string will be copied |
buflen | Length of the buffer |
LEX_CSTRING thd_query_unsafe | ( | THD * | thd | ) |
Get the current query string for the thread.
thd | The MySQL internal thread pointer |
void thd_set_thread_stack | ( | THD * | thd, |
const char * | stack_start | ||
) |
Set thread stack in THD object.
thd | Thread object |
stack_start | Start of stack to set in THD object |
int thd_slave_thread | ( | const THD * | thd | ) |
Check if a user thread is a replication slave thread.
thd | user thread |
0 | the user thread is not a replication slave thread |
1 | the user thread is a replication slave thread |
bool thd_sqlcom_can_generate_row_events | ( | const THD * | thd | ) |
Check if the query may generate row changes which may end up in the binary.
thd | Thread handle |
1 | the query may generate row changes, 0 otherwise. |
my_thread_id thd_thread_id | ( | const THD * | thd | ) |