MySQL 8.4.2
Source Code Documentation
utils.cc File Reference
#include "sql/statement/utils.h"
#include "sql/protocol.h"
#include "sql/sp.h"
#include "sql/sp_head.h"
#include "sql/sp_rcontext.h"
#include "sql/sql_class.h"

Functions

bool set_sp_multi_result_state (THD *thd, LEX *lex)
 Sets multi-result state for SP being executed by the Statement_handle family. More...
 
void set_query_for_display (THD *thd)
 Set query to be displayed in performance schema. More...
 
char * convert_and_store (MEM_ROOT *mem_root, const char *str, size_t length, const CHARSET_INFO *src_cs, const CHARSET_INFO *dst_cs)
 Potentially convert a string from src charset to destination charset and store the returned string on the specified memroot. More...
 

Function Documentation

◆ convert_and_store()

char * convert_and_store ( MEM_ROOT mem_root,
const char *  str,
size_t  length,
const CHARSET_INFO src_cs,
const CHARSET_INFO dst_cs 
)

Potentially convert a string from src charset to destination charset and store the returned string on the specified memroot.

Parameters
mem_rootThe mem_root to store the result str
strThe input string to be converted
lengthLength of the input string
src_csSource charset
dst_csDest charset
Returns
char* Pointer to the converted string on the memroot

◆ set_query_for_display()

void set_query_for_display ( THD thd)

Set query to be displayed in performance schema.

Parameters
thdThread Handle.

◆ set_sp_multi_result_state()

bool set_sp_multi_result_state ( THD thd,
LEX lex 
)

Sets multi-result state for SP being executed by the Statement_handle family.

For SQL SP, flags required for multi-result are set while parsing SP statements. SPs for which parsing its statement is deferred to execution phase, multi-result state is set by this function.

The function invoker need not have to reset this state. State is reset in the Sql_cmd_call::execute_inner.

Parameters
thdThread Handle.
lexLex instance of SP statement.
Returns
false on Success and true if multi-result can not be used.