1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

Moving a part of sql_lex.h into other *.h files

- Lex_ident_cli* into a new file sql/lex_ident_cli.h
- Lex_ident_sys* into a new file sql/lex_ident_sys.h
- Well_formed_prefix into include/m_ctype.h

This change is needed to the optimizer hint parser coming soon.
This commit is contained in:
Alexander Barkov
2024-07-16 08:52:39 +04:00
parent 4e805aed85
commit 2f4b0ba328
5 changed files with 244 additions and 189 deletions

View File

@@ -55,48 +55,6 @@ inline uint32 copy_and_convert(char *to, size_t to_length, CHARSET_INFO *to_cs,
}
class String_copy_status: protected MY_STRCOPY_STATUS
{
public:
const char *source_end_pos() const
{ return m_source_end_pos; }
const char *well_formed_error_pos() const
{ return m_well_formed_error_pos; }
};
class Well_formed_prefix_status: public String_copy_status
{
public:
Well_formed_prefix_status(CHARSET_INFO *cs,
const char *str, const char *end, size_t nchars)
{ cs->well_formed_char_length(str, end, nchars, this); }
};
class Well_formed_prefix: public Well_formed_prefix_status
{
const char *m_str; // The beginning of the string
public:
Well_formed_prefix(CHARSET_INFO *cs, const char *str, const char *end,
size_t nchars)
:Well_formed_prefix_status(cs, str, end, nchars), m_str(str)
{ }
Well_formed_prefix(CHARSET_INFO *cs, const char *str, size_t length,
size_t nchars)
:Well_formed_prefix_status(cs, str, str + length, nchars), m_str(str)
{ }
Well_formed_prefix(CHARSET_INFO *cs, const char *str, size_t length)
:Well_formed_prefix_status(cs, str, str + length, length), m_str(str)
{ }
Well_formed_prefix(CHARSET_INFO *cs, LEX_CSTRING str, size_t nchars)
:Well_formed_prefix_status(cs, str.str, str.str + str.length, nchars),
m_str(str.str)
{ }
size_t length() const { return m_source_end_pos - m_str; }
};
class String_copier: public String_copy_status,
protected MY_STRCONV_STATUS
{