MySQL 9.1.0
Source Code Documentation
strfunc.cc File Reference
#include "sql/strfunc.h"
#include <string.h>
#include "my_alloc.h"
#include "my_dbug.h"
#include "my_sys.h"
#include "mysql/strings/m_ctype.h"
#include "sql/sql_class.h"
#include "sql/sql_const.h"
#include "sql_string.h"
#include "typelib.h"

Functions

ulonglong find_set (const TYPELIB *lib, const char *str, size_t length, const CHARSET_INFO *cs, const char **err_pos, uint *err_len, bool *set_warning)
 
uint find_type (const TYPELIB *lib, const char *find, size_t length, bool part_match)
 
uint find_type2 (const TYPELIB *typelib, const char *x, size_t length, const CHARSET_INFO *cs)
 
uint check_word (TYPELIB *lib, const char *val, const char *end, const char **end_of_word)
 
size_t strconvert (const CHARSET_INFO *from_cs, const char *from, CHARSET_INFO *to_cs, char *to, size_t to_length, uint *errors)
 
char * set_to_string (THD *thd, LEX_STRING *result, ulonglong set, const char *lib[], bool quoted)
 
char * set_to_string (THD *thd, LEX_STRING *result, ulonglong set, const char *lib[])
 
char * flagset_to_string (THD *thd, LEX_STRING *result, ulonglong set, const char *lib[])
 
LEX_STRINGmake_lex_string_root (MEM_ROOT *mem_root, const char *str, size_t length)
 Create a LEX_STRING in a MEM_ROOT and copy the given string into it. More...
 
bool lex_string_strmake (MEM_ROOT *mem_root, LEX_STRING *lex_str, const char *str, size_t length)
 Copy the given string into a LEX_STRING, allocating it in the given MEM_ROOT. More...
 
bool lex_string_strmake (MEM_ROOT *mem_root, LEX_CSTRING *lex_str, const char *str, size_t length)
 Copy the given string into a LEX_CSTRING, allocating it in the given MEM_ROOT. More...
 
bool copy_string (MEM_ROOT *mem_root, String *dst, const String *src)
 

Variables

static const char field_separator = ','
 

Function Documentation

◆ check_word()

uint check_word ( TYPELIB lib,
const char *  val,
const char *  end,
const char **  end_of_word 
)

◆ copy_string()

bool copy_string ( MEM_ROOT mem_root,
String dst,
const String src 
)

◆ find_set()

ulonglong find_set ( const TYPELIB lib,
const char *  str,
size_t  length,
const CHARSET_INFO cs,
const char **  err_pos,
uint *  err_len,
bool *  set_warning 
)

◆ find_type()

uint find_type ( const TYPELIB lib,
const char *  find,
size_t  length,
bool  part_match 
)

◆ find_type2()

uint find_type2 ( const TYPELIB typelib,
const char *  x,
size_t  length,
const CHARSET_INFO cs 
)

◆ flagset_to_string()

char * flagset_to_string ( THD thd,
LEX_STRING result,
ulonglong  set,
const char *  lib[] 
)

◆ lex_string_strmake() [1/2]

bool lex_string_strmake ( MEM_ROOT mem_root,
LEX_CSTRING lex_str,
const char *  str,
size_t  length 
)

Copy the given string into a LEX_CSTRING, allocating it in the given MEM_ROOT.

Parameters
mem_rootMEM_ROOT where to allocate the string.
lex_strLEX_CSTRING to fill with the copied string.
strstring to be copied into the LEX_CSTRING.
lengthlength of str, in bytes
Returns
true on failure (OOM), false otherwise.

◆ lex_string_strmake() [2/2]

bool lex_string_strmake ( MEM_ROOT mem_root,
LEX_STRING lex_str,
const char *  str,
size_t  length 
)

Copy the given string into a LEX_STRING, allocating it in the given MEM_ROOT.

Parameters
mem_rootMEM_ROOT where to allocate the string.
lex_strLEX_STRING to fill with the copied string.
strstring to be copied into the LEX_STRING.
lengthlength of str, in bytes
Returns
true on failure (OOM), false otherwise.

◆ make_lex_string_root()

LEX_STRING * make_lex_string_root ( MEM_ROOT mem_root,
const char *  str,
size_t  length 
)

Create a LEX_STRING in a MEM_ROOT and copy the given string into it.

Parameters
mem_rootMEM_ROOT where to allocate the LEX_STRING.
strstring to be copied into the LEX_STRING.
lengthlength of str, in bytes
Returns
nullptr on failure, or pointer to the LEX_STRING object

◆ set_to_string() [1/2]

char * set_to_string ( THD thd,
LEX_STRING result,
ulonglong  set,
const char *  lib[] 
)

◆ set_to_string() [2/2]

char * set_to_string ( THD thd,
LEX_STRING result,
ulonglong  set,
const char *  lib[],
bool  quoted 
)

◆ strconvert()

size_t strconvert ( const CHARSET_INFO from_cs,
const char *  from,
CHARSET_INFO to_cs,
char *  to,
size_t  to_length,
uint *  errors 
)

Variable Documentation

◆ field_separator

const char field_separator = ','
static