MySQL 8.0.39
Source Code Documentation
storing_auto_thd.h File Reference
#include <sql/auto_thd.h>
#include <sql/current_thd.h>
#include <sql/sql_lex.h>
#include <sql/sql_thd_internal_api.h>
#include "sql/auth/auth_acls.h"

Go to the source code of this file.

Classes

class  Storing_auto_THD
 A version of Auto_THD that: More...
 

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.