MySQL 8.0.40
Source Code Documentation
storing_auto_thd.cc File Reference
#include "storing_auto_thd.h"

Functions

THDcreate_internal_thd_ctx (Sctx_ptr< Security_context > &ctx)
 Wrapper of create_internal_thd() function, creating a temporary THD with the following differences compared to original code: More...
 
void destroy_internal_thd_ctx (THD *thd, Sctx_ptr< Security_context > &ctx)
 Wrapper of destroy_internal_thd() function, safely destroying a temporary THD and its associated security context smart pointer. More...
 

Function Documentation

◆ create_internal_thd_ctx()

THD * create_internal_thd_ctx ( Sctx_ptr< Security_context > &  ctx)

Wrapper of create_internal_thd() function, creating a temporary THD with the following differences compared to original code:

  • created THD does not have system_user flag set
  • instead, THD has minimal privileges needed to set system variables
  • a user name assigned, so the variables can be persisted with such THD
Parameters
ctxSecurity context smart pointer to be assigned.
Return values
THDobject created

◆ destroy_internal_thd_ctx()

void destroy_internal_thd_ctx ( THD thd,
Sctx_ptr< Security_context > &  ctx 
)

Wrapper of destroy_internal_thd() function, safely destroying a temporary THD and its associated security context smart pointer.

Parameters
thdPointer to THD object to be destroyed.
ctxSecurity context smart pointer to be cleared.