MySQL 9.1.0
Source Code Documentation
|
All accesses to THD variables and functions are defined in this header file. More...
#include <mysqld_error.h>
#include "sql/conn_handler/channel_info.h"
#include "sql/conn_handler/connection_handler_manager.h"
Go to the source code of this file.
Classes | |
struct | Connection_handler_functions |
This structure must be populated by plugins which implement connection handlers and passed as an argument to my_connection_handler_set() in order to activate the connection handler. More... | |
Typedefs | |
typedef bool(* | add_connection_t) (Channel_info *channel_info) |
Called by the server when a new client connects. More... | |
typedef void(* | end_t) (void) |
Called by the server when the connection handler is destroyed. More... | |
typedef void() | do_thd_impl_uint64(THD *, uint64) |
Functions | |
THD * | create_thd (Channel_info *channel_info) |
void | destroy_channel_info (Channel_info *channel_info) |
bool | connection_events_loop_aborted () |
void | dec_connection_count () |
void | inc_thread_created () |
void | thd_lock_thread_count () |
void | thd_unlock_thread_count () |
void | do_for_all_thd (do_thd_impl_uint64, uint64) |
void * | thd_get_scheduler_data (THD *thd) |
Get reference to scheduler data object. More... | |
void | thd_set_scheduler_data (THD *thd, void *data) |
Set reference to Scheduler data object for THD object. More... | |
PSI_thread * | thd_get_psi (THD *thd) |
Get reference to Performance Schema object for THD object. More... | |
void | thd_set_psi (THD *thd, PSI_thread *psi) |
Set reference to Performance Schema object for THD object. More... | |
void | thd_set_killed (THD *thd) |
Set the state on connection to killed. More... | |
void | thd_clear_errors (THD *thd) |
Clear errors from the previous THD. More... | |
void | thd_close_connection (THD *thd) |
Close the socket used by this connection. More... | |
THD * | thd_get_current_thd () |
Get current THD object from thread local data. More... | |
void | thd_lock_data (THD *thd) |
Lock data that needs protection in THD object. More... | |
void | thd_unlock_data (THD *thd) |
Unlock data that needs protection in THD object. More... | |
bool | thd_is_transaction_active (THD *thd) |
Support method to check if connection has already started transaction. More... | |
bool | thd_in_active_multi_stmt_transaction (const THD *) |
Predicate for determining if connection is in active multi-statement transaction. More... | |
int | thd_connection_has_data (THD *thd) |
Check if there is buffered data on the socket representing the connection. More... | |
void | thd_set_net_read_write (THD *thd, uint val) |
Set reading/writing on socket, used by SHOW PROCESSLIST. More... | |
uint | thd_get_net_read_write (THD *thd) |
Get reading/writing on socket from THD object. More... | |
void | thd_set_not_killable (THD *thd) |
Mark the THD as not killable as it is not currently used by a thread. More... | |
ulong | thd_get_net_wait_timeout (THD *thd) |
Get net_wait_timeout for THD object. More... | |
my_socket | thd_get_fd (THD *thd) |
Get socket file descriptor for this connection. More... | |
MYSQL_SOCKET | thd_get_mysql_socket (THD *) |
Get MYSQL_SOCKET struct for this connection. More... | |
void | thd_store_globals (THD *thd) |
Set thread specific environment required for thd cleanup in thread pool. More... | |
bool | thd_check_connection_admin_privilege (THD *thd) |
bool | do_command (THD *thd) |
Read one command from connection and execute it (query or simple command). More... | |
bool | thd_prepare_connection (THD *thd) |
void | mysql_audit_release (THD *thd) |
Release any resources associated with the current thd. More... | |
bool | thd_connection_alive (THD *thd) |
void | close_connection (THD *thd, uint sql_errno, bool server_shutdown, bool generate_event) |
Close a connection. More... | |
void | end_connection (THD *thd) |
void | reset_thread_globals (THD *thd) |
Reset thread globals associated. More... | |
ulong | get_max_connections (void) |
Get max number of connections. More... | |
my_thread_attr_t * | get_connection_attrib (void) |
Get thread attributes for connection threads. More... | |
void | increment_aborted_connects () |
longlong | get_incoming_connects () |
longlong | get_aborted_connects () |
All accesses to THD variables and functions are defined in this header file.
typedef bool(* add_connection_t) (Channel_info *channel_info) |
Called by the server when a new client connects.
channel_info | Pointer to object containing information about the new connection. |
true | failure |
false | success |
typedef void(* end_t) (void) |
Called by the server when the connection handler is destroyed.
void close_connection | ( | THD * | thd, |
uint | sql_errno, | ||
bool | server_shutdown, | ||
bool | generate_event | ||
) |
Close a connection.
thd | Thread handle. |
sql_errno | The error code to send before disconnect. |
server_shutdown | True for a server shutdown |
generate_event | Generate Audit API disconnect event. |
|
inline |
THD * create_thd | ( | Channel_info * | channel_info | ) |
void dec_connection_count | ( | ) |
void destroy_channel_info | ( | Channel_info * | channel_info | ) |
void do_for_all_thd | ( | do_thd_impl_uint64 | f, |
uint64 | v | ||
) |
void end_connection | ( | THD * | thd | ) |
longlong get_aborted_connects | ( | ) |
my_thread_attr_t * get_connection_attrib | ( | void | ) |
Get thread attributes for connection threads.
Returns the server connection attribute.
Reference | to thread attribute for connection threads |
longlong get_incoming_connects | ( | ) |
ulong get_max_connections | ( | void | ) |
Get max number of connections.
Max | number of connections for MySQL Server |
void inc_thread_created | ( | ) |
void increment_aborted_connects | ( | ) |
void mysql_audit_release | ( | THD * | thd | ) |
Release any resources associated with the current thd.
[in] | thd | Current thread |
void reset_thread_globals | ( | THD * | thd | ) |
Reset thread globals associated.
thd | THD object |
bool thd_check_connection_admin_privilege | ( | THD * | thd | ) |
void thd_clear_errors | ( | THD * | thd | ) |
Clear errors from the previous THD.
thd | THD object |
void thd_close_connection | ( | THD * | thd | ) |
Close the socket used by this connection.
thd | THD object |
bool thd_connection_alive | ( | THD * | thd | ) |
int thd_connection_has_data | ( | THD * | thd | ) |
Check if there is buffered data on the socket representing the connection.
thd | THD object |
THD * thd_get_current_thd | ( | ) |
Get current THD object from thread local data.
The | THD object for the thread, NULL if not connection thread |
Get socket file descriptor for this connection.
thd | THD object |
Socket | of the connection |
MYSQL_SOCKET thd_get_mysql_socket | ( | THD * | thd | ) |
Get MYSQL_SOCKET struct for this connection.
thd | THD object |
MYSQL_SOCKET | struct of the connection |
uint thd_get_net_read_write | ( | THD * | thd | ) |
Get reading/writing on socket from THD object.
thd | THD object |
net.reading_or_writing | value for thread on THD. |
ulong thd_get_net_wait_timeout | ( | THD * | thd | ) |
Get net_wait_timeout for THD object.
thd | THD object |
net_wait_timeout | value for thread on THD |
PSI_thread * thd_get_psi | ( | THD * | thd | ) |
Get reference to Performance Schema object for THD object.
thd | THD object |
Performance | schema object for thread on THD |
void * thd_get_scheduler_data | ( | THD * | thd | ) |
Get reference to scheduler data object.
thd | THD object |
Scheduler | data object on THD |
bool thd_in_active_multi_stmt_transaction | ( | const THD * | thd | ) |
Predicate for determining if connection is in active multi-statement transaction.
bool thd_is_transaction_active | ( | THD * | thd | ) |
Support method to check if connection has already started transaction.
thd | Current thread |
true | if connection already started transaction |
void thd_lock_data | ( | THD * | thd | ) |
Lock data that needs protection in THD object.
thd | THD object |
void thd_lock_thread_count | ( | ) |
bool thd_prepare_connection | ( | THD * | thd | ) |
void thd_set_killed | ( | THD * | thd | ) |
Set the state on connection to killed.
thd | THD object |
void thd_set_net_read_write | ( | THD * | thd, |
uint | val | ||
) |
Set reading/writing on socket, used by SHOW PROCESSLIST.
thd | THD object |
val | Value to set it to (0 or 1) |
void thd_set_not_killable | ( | THD * | thd | ) |
Mark the THD as not killable as it is not currently used by a thread.
thd | THD object |
void thd_set_psi | ( | THD * | thd, |
PSI_thread * | psi | ||
) |
Set reference to Performance Schema object for THD object.
thd | THD object |
psi | Performance schema object for thread |
void thd_set_scheduler_data | ( | THD * | thd, |
void * | data | ||
) |
Set reference to Scheduler data object for THD object.
thd | THD object |
data | Scheduler data object to set on THD |
void thd_store_globals | ( | THD * | thd | ) |
Set thread specific environment required for thd cleanup in thread pool.
thd | THD object |
void thd_unlock_data | ( | THD * | thd | ) |
Unlock data that needs protection in THD object.
thd | THD object |
void thd_unlock_thread_count | ( | ) |