MySQL 8.0.31
Source Code Documentation
regular_expressions.cc File Reference

Functions

void die (const char *fmt,...)
 
std::regex ps_re (ps_re_str, std::regex_constants::nosubs|std::regex_constants::icase)
 
std::regex sp_re (sp_re_str, std::regex_constants::nosubs|std::regex_constants::icase)
 
std::regex view_re (view_re_str, std::regex_constants::nosubs|std::regex_constants::icase)
 
std::regex opt_trace_re (opt_trace_re_str, std::regex_constants::nosubs|std::regex_constants::icase)
 
std::regex explain_re (explain_re_str, std::regex_constants::nosubs|std::regex_constants::icase)
 
int multi_reg_replace (struct st_replace_regex *r, char *val, size_t *len)
 Execute all substitutions on val. More...
 
int search_protocol_re (std::regex *re, const char *str)
 Function to check if a protocol's regular expression matches the query string. More...
 

Variables

static const char *const ps_re_str
 
static const char *const sp_re_str = ps_re_str
 
static const char *const view_re_str
 
const char *const opt_trace_re_str
 
static const char *const explain_re_str
 
CHARSET_INFOcharset_info
 

Function Documentation

◆ die()

void die ( const char *  fmt,
  ... 
)

◆ explain_re()

std::regex explain_re ( explain_re_str  ,
std::regex_constants::nosubs|std::regex_constants::icase   
)

◆ multi_reg_replace()

int multi_reg_replace ( struct st_replace_regex r,
char *  val,
size_t *  len 
)

Execute all substitutions on val.

Parameters
[in]valPointer to the character string to be used as input for the regex replace operation.
[in,out]rPointer to the st_replace_regex structure which holds arguments and information for the command.
[in,out]lenPointer to variable holding length of input string.
Return values
TrueIf substituition was made.
FalseIf no substituition was made.
Note
r->buf points at the resulting buffer with all substitutions done. len points at length of resulting buffer. r->even_buf and r->odd_buf might have been reallocated. r->even_buf_len and r->odd_buf_len might have been changed.

◆ opt_trace_re()

std::regex opt_trace_re ( opt_trace_re_str  ,
std::regex_constants::nosubs|std::regex_constants::icase   
)

◆ ps_re()

std::regex ps_re ( ps_re_str  ,
std::regex_constants::nosubs|std::regex_constants::icase   
)

◆ search_protocol_re()

int search_protocol_re ( std::regex *  re,
const char *  str 
)

Function to check if a protocol's regular expression matches the query string.

Parameters
rePointer to a precompiled regular expression.
strPointer to character string in which the pattern needs to be searched.
Return values
1If the pattern is found.
0If the pattern is not found.

◆ sp_re()

std::regex sp_re ( sp_re_str  ,
std::regex_constants::nosubs|std::regex_constants::icase   
)

◆ view_re()

std::regex view_re ( view_re_str  ,
std::regex_constants::nosubs|std::regex_constants::icase   
)

Variable Documentation

◆ charset_info

CHARSET_INFO* charset_info
extern

◆ explain_re_str

const char* const explain_re_str
static
Initial value:
=
"^("
"[[:space:]]*(SELECT|DELETE|UPDATE|INSERT|REPLACE)[[:space:]])"

◆ opt_trace_re_str

const char* const opt_trace_re_str
Initial value:
=
"^("
"[[:space:]]*INSERT[[:space:]]|"
"[[:space:]]*UPDATE[[:space:]]|"
"[[:space:]]*DELETE[[:space:]]|"
"[[:space:]]*EXPLAIN[[:space:]]|"
"[[:space:]]*SELECT[[:space:]])"

◆ ps_re_str

const char* const ps_re_str
static

◆ sp_re_str

const char* const sp_re_str = ps_re_str
static

◆ view_re_str

const char* const view_re_str
static
Initial value:
=
"^("
"[[:space:]]*SELECT[[:space:]])"