MySQL 8.4.2
Source Code Documentation
s_mysql_mysql_thd_store Struct Reference

A service to store an opaque pointer in MYSQL_THD. More...

#include <mysql_thd_store_service.h>

Public Attributes

mysql_service_status_t(* register_slot )(const char *name, free_resource_fn free_fn, mysql_thd_store_slot *slot)
 Register a slot to store data specific to a component. More...
 
mysql_service_status_t(* unregister_slot )(mysql_thd_store_slot slot)
 Unregister a slot. More...
 
mysql_service_status_t(* set )(MYSQL_THD thd, mysql_thd_store_slot slot, void *object)
 Set/Reset an opaque pointer in thd store. More...
 
void *(* get )(MYSQL_THD thd, mysql_thd_store_slot slot)
 Get handle to an already stored object. More...
 

Detailed Description

A service to store an opaque pointer in MYSQL_THD.

Member Data Documentation

◆ get

void *(* s_mysql_mysql_thd_store::get) (MYSQL_THD thd, mysql_thd_store_slot slot)

Get handle to an already stored object.

Parameters
[in]thdSession handle. If NULL, current session will be used.
[in]slotKey used to identify the object handle
Returns
handle to the object if found, nullptr otherwise

◆ register_slot

mysql_service_status_t(* s_mysql_mysql_thd_store::register_slot) (const char *name, free_resource_fn free_fn, mysql_thd_store_slot *slot)

Register a slot to store data specific to a component.

The free_resource callback is used to free the stored pointer before thd is destroyed

Parameters
[in]nameImplementation name
[in]free_fnCallback to free resource stored in the slot
[out]slotKey used to identify the object handle
Returns
status of registration
Return values
falseSuccess
trueError. This typically means all slots are full

◆ set

mysql_service_status_t(* s_mysql_mysql_thd_store::set) (MYSQL_THD thd, mysql_thd_store_slot slot, void *object)

Set/Reset an opaque pointer in thd store.

Parameters
[in]thdSession handle. If NULL, current session will be used.
[in]slotKey used to identify the object handle
[in]objectHandle of the object being stored. If NULL, it will be considered removal.
Returns
Status of the operation
Return values
falseSuccess
trueError

◆ unregister_slot

mysql_service_status_t(* s_mysql_mysql_thd_store::unregister_slot) (mysql_thd_store_slot slot)

Unregister a slot.

Parameters
[in,out]slotKey allocated to component
Returns
status of operation
Return values
falseSuccess
trueError

The documentation for this struct was generated from the following file: