MySQL 8.4.0
Source Code Documentation
Regular_statement_handle Class Reference

Regular_statement_handle enables execution of all SQL statements except for prepared statements. More...

#include <statement.h>

Inheritance diagram for Regular_statement_handle:
[legend]

Public Member Functions

 Regular_statement_handle (THD *thd, const char *query, uint length)
 
bool execute () override
 Execute a regular statement. More...
 
bool is_prepared_statement () override
 Convey that this is regular statement. More...
 
bool is_executed_or_prepared () override
 Check if the statement has been executed. More...
 
- Public Member Functions inherited from Statement_handle
 Statement_handle (THD *thd, const char *query, size_t length)
 
bool is_error () const
 Check if error is reported. More...
 
const char * get_last_error ()
 Check if error is reported. More...
 
unsigned int get_last_errno () const
 Get the last mysql errno. More...
 
const char * get_mysql_state ()
 Get the mysql error state. More...
 
ulonglong warning_count () const
 Get number of warnings generated. More...
 
Warningget_warnings ()
 Get list of all warnings. More...
 
Result_setget_result_sets ()
 Get the next result sets generated while executing the statement. More...
 
Result_setget_current_result_set ()
 Get the current result set object. More...
 
void next_result_set ()
 Make the next result set the current result set. More...
 
void free_old_result ()
 Feel all the result collected so far, from query execution. More...
 
std::string_view get_query ()
 Get the query string being executed. More...
 
void set_capacity (size_t capacity)
 Set the capacity in bytes allowed for caching results. More...
 
size_t get_capacity ()
 Get the capacity in bytes allowed for caching results. More...
 
void set_use_thd_protocol (bool use_thd_protocol)
 Set thd protocol to enable result pass through. More...
 
bool is_using_thd_protocol () const
 Check if thd protocol is used. More...
 
void set_thd_protocol ()
 Set either Protocol_local_v2 when m_use_thd_protocol is not set or or classical protocol when m_use_thd_protocol is set to THD. More...
 
void reset_thd_protocol ()
 Reset THD protocol. More...
 
void set_expected_charset (const char *charset_name)
 Set the expected charset. More...
 
const char * get_expected_charset ()
 Get the expected charset. More...
 
size_t get_num_rows_per_fetch ()
 Get the num rows per fetch. More...
 
void set_num_rows_per_fetch (size_t num_rows_per_fetch)
 Set the num of rows to be retrieved per fetch. More...
 
virtual ~Statement_handle ()
 Destroy the Statement_handle object. More...
 

Private Member Functions

bool execute (Server_runnable *server_runnable)
 

Private Attributes

bool m_is_executed = false
 

Additional Inherited Members

- Protected Member Functions inherited from Statement_handle
void send_statement_status ()
 Send statement execution status after execute(). More...
 
void add_result_set (Result_set *result_set)
 
void set_result_set (Result_set *result_set)
 
void copy_warnings ()
 Copy the warnings generated for the query from the diagnostics area. More...
 
 Statement_handle (const Statement_handle &)=delete
 
 Statement_handle (Statement_handle &&)=delete
 
Statement_handleoperator= (const Statement_handle &)=delete
 
Statement_handleoperator= (Statement_handle &&)=delete
 
- Protected Attributes inherited from Statement_handle
std::string m_query
 
MEM_ROOT m_warning_mem_root
 
Warningm_warnings
 
ulonglong m_warnings_count = 0
 
Diagnostics_aream_diagnostics_area
 
THDm_thd
 
Result_setm_result_sets
 
Result_setm_current_rset
 
bool m_use_thd_protocol = false
 
size_t m_num_rows_per_fetch = 1
 
CHARSET_INFOm_expected_charset
 
Protocol_local_v2 m_protocol
 
Protocolm_saved_protocol {nullptr}
 

Detailed Description

Regular_statement_handle enables execution of all SQL statements except for prepared statements.

Constructor & Destructor Documentation

◆ Regular_statement_handle()

Regular_statement_handle::Regular_statement_handle ( THD thd,
const char *  query,
uint  length 
)
inline

Member Function Documentation

◆ execute() [1/2]

bool Regular_statement_handle::execute ( )
overridevirtual

Execute a regular statement.

Returns
true if statement fails.
false if statement succeeds.

Implements Statement_handle.

◆ execute() [2/2]

bool Regular_statement_handle::execute ( Server_runnable server_runnable)
private

◆ is_executed_or_prepared()

bool Regular_statement_handle::is_executed_or_prepared ( )
inlineoverridevirtual

Check if the statement has been executed.

Returns
true if executed
false otherwise

Implements Statement_handle.

◆ is_prepared_statement()

bool Regular_statement_handle::is_prepared_statement ( )
inlineoverridevirtual

Convey that this is regular statement.

Returns
Always returns 'false'

Implements Statement_handle.

Member Data Documentation

◆ m_is_executed

bool Regular_statement_handle::m_is_executed = false
private

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