MySQL 8.4.2
Source Code Documentation
Prepared_stmt_arena_holder Class Reference

A simple holder for the Prepared Statement Query_arena instance in THD. More...

#include <thd_raii.h>

Public Member Functions

 Prepared_stmt_arena_holder (THD *thd, bool activate_now_if_needed=true)
 Constructs a new object, activates the persistent arena if requested and if a prepared statement or a stored procedure statement is being executed. More...
 
 ~Prepared_stmt_arena_holder ()
 Deactivate the persistent arena (restore the previous arena) if it has been activated. More...
 
bool is_activated () const
 

Private Attributes

THD *const m_thd
 The thread context to work with. More...
 
Query_arenam_arena
 The arena set by this holder (by activate()). More...
 
Query_arena m_backup
 The arena state to be restored. More...
 

Detailed Description

A simple holder for the Prepared Statement Query_arena instance in THD.

The class utilizes RAII technique to not forget to restore the THD arena.

Constructor & Destructor Documentation

◆ Prepared_stmt_arena_holder()

Prepared_stmt_arena_holder::Prepared_stmt_arena_holder ( THD thd,
bool  activate_now_if_needed = true 
)
inlineexplicit

Constructs a new object, activates the persistent arena if requested and if a prepared statement or a stored procedure statement is being executed.

Parameters
thdThread context.
activate_now_if_neededAttempt to activate the persistent arena in the constructor or not.

◆ ~Prepared_stmt_arena_holder()

Prepared_stmt_arena_holder::~Prepared_stmt_arena_holder ( )
inline

Deactivate the persistent arena (restore the previous arena) if it has been activated.

Member Function Documentation

◆ is_activated()

bool Prepared_stmt_arena_holder::is_activated ( ) const
inline

Member Data Documentation

◆ m_arena

Query_arena* Prepared_stmt_arena_holder::m_arena
private

The arena set by this holder (by activate()).

◆ m_backup

Query_arena Prepared_stmt_arena_holder::m_backup
private

The arena state to be restored.

◆ m_thd

THD* const Prepared_stmt_arena_holder::m_thd
private

The thread context to work with.


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