24#ifndef STRFUNC_INCLUDED
25#define STRFUNC_INCLUDED
57 const char *lib[],
bool quoted);
76template <
class STDSTRINGLIKE_TYPE>
78 return {s.c_str(), s.
length()};
89template <
class STRLIKE_TYPE>
93 return std::forward<STRLIKE_TYPE>(s);
105template <
class STRLIKE_TYPE>
107 return casedn(ci, STRLIKE_TYPE{src});
160template <
class LEX_STRING_TYPE>
177template <
class LEX_STRING_TYPE>
187template <
class LEX_STRING_TYPE>
189 LEX_STRING_TYPE &&b) {
190 return cs.coll->strnncoll(
191 &
cs, pointer_cast<const unsigned char *>(a.str), a.length,
192 pointer_cast<const unsigned char *>(b.str), b.length,
false);
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:167
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
static MEM_ROOT mem_root
Definition: client_plugin.cc:114
char * strmake_root(MEM_ROOT *root, const char *str, size_t len)
Definition: my_alloc.cc:287
#define quoted
Definition: lexyy.cc:960
A better implementation of the UNIX ctype(3) library.
size_t my_casedn_str(const CHARSET_INFO *cs, char *str)
Definition: m_ctype.h:732
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
uint end_of_word(const char *pos)
Definition: mysqltest.cc:11332
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1105
Definition: commit_order_queue.h:34
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:76
Container::const_iterator find(const Container &c, Value &&value)
Definition: generic.h:39
Cursor end()
A past-the-end Cursor.
Definition: rules_table_service.cc:192
std::set< Key, Compare, ut::allocator< Key > > set
Specialization of set which uses ut_allocator.
Definition: ut0new.h:2884
Our own string classes, used pervasively throughout the executor.
int strnncmp_nopads(const CHARSET_INFO &cs, LEX_STRING_TYPE &&a, LEX_STRING_TYPE &&b)
Utility function for collating (using strnncoll) two LEX_STRING_TYPEs.
Definition: strfunc.h:188
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.
Definition: strfunc.cc:334
char * set_to_string(THD *thd, LEX_STRING *result, ulonglong set, const char *lib[])
Definition: strfunc.cc:298
MYSQL_LEX_CSTRING lex_cstring_handle(const STDSTRINGLIKE_TYPE &s)
Return a LEX_CSTRING handle to a std::string like (meaning something which has the c_str() and length...
Definition: strfunc.h:77
LEX_STRING_TYPE LexStringDupRoot(MEM_ROOT *mem_root, LEX_STRING_TYPE s)
Utility function for copying a LEX_STRING_TYPE (either LEX_STRING or LEX_CSTRING) onto a mem_root.
Definition: strfunc.h:161
ulonglong find_set(const TYPELIB *lib, const char *x, size_t length, const CHARSET_INFO *cs, const char **err_pos, uint *err_len, bool *set_warning)
Definition: strfunc.cc:60
STRLIKE_TYPE casedn(const CHARSET_INFO *ci, STRLIKE_TYPE &&s)
Lowercase a string according to charset.
Definition: strfunc.h:90
bool copy_string(MEM_ROOT *mem_root, String *dst, const String *src)
Definition: strfunc.cc:356
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.
Definition: strfunc.cc:325
LEX_STRING_TYPE LexStringDupRootUnlessEmpty(MEM_ROOT *mem_root, LEX_STRING_TYPE s)
Utility function for copying a LEX_STRING_TYPE (either LEX_STRING or LEX_CSTRING) onto a mem_root,...
Definition: strfunc.h:178
char * flagset_to_string(THD *thd, LEX_STRING *result, ulonglong set, const char *lib[])
Definition: strfunc.cc:303
uint check_word(TYPELIB *lib, const char *val, const char *end, const char **end_of_word)
Definition: strfunc.cc:195
size_t strconvert(const CHARSET_INFO *from_cs, const char *from, CHARSET_INFO *to_cs, char *to, size_t to_length, uint *errors)
Definition: strfunc.cc:227
uint find_type2(const TYPELIB *lib, const char *find, size_t length, const CHARSET_INFO *cs)
Definition: strfunc.cc:157
uint find_type(const TYPELIB *lib, const char *find, size_t length, bool part_match)
Definition: strfunc.cc:120
Definition: m_ctype.h:421
uint8_t casedn_multiply
Definition: m_ctype.h:443
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:83
Definition: mysql_lex_string.h:40
size_t length
Definition: mysql_lex_string.h:42
Definition: mysql_lex_string.h:35