diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 0b0c9ee3dc7..fe82440c0c6 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -126,7 +126,7 @@ static int show_create_db(THD *thd, LEX *lex); static bool alter_routine(THD *thd, LEX *lex); static bool drop_routine(THD *thd, LEX *lex); -const LEX_CSTRING any_db= {STRING_WITH_LEN("*any*")}; +const Lex_ident_db any_db(STRING_WITH_LEN("*any*")); const LEX_CSTRING command_name[257]={ { STRING_WITH_LEN("Sleep") }, //0 diff --git a/sql/sql_parse.h b/sql/sql_parse.h index 872c67c2d1b..ecd4c36b39a 100644 --- a/sql/sql_parse.h +++ b/sql/sql_parse.h @@ -129,7 +129,7 @@ bool check_stack_overrun(THD *thd, long margin, uchar *dummy); /* Variables */ -extern const LEX_CSTRING any_db; +extern const Lex_ident_db any_db; extern uint sql_command_flags[]; extern uint server_command_flags[]; extern const LEX_CSTRING command_name[]; diff --git a/sql/table.cc b/sql/table.cc index 0b419b62899..f66203d31ce 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -5258,27 +5258,17 @@ bool Lex_ident_fs::check_body(const char *name, size_t length, size_t char_length= 0; const char *end= name + length; -#if defined(USE_MB) && defined(USE_MB_IDENT) - bool last_char_is_space= FALSE; -#else if (name[length-1]==' ') return 1; -#endif for ( ; name != end ; char_length++) { -#if defined(USE_MB) && defined(USE_MB_IDENT) - last_char_is_space= my_isspace(system_charset_info, *name); - if (system_charset_info->use_mb()) + int len= my_ismbchar(&my_charset_utf8mb3_general_ci, name, end); + if (len) { - int len=my_ismbchar(system_charset_info, name, end); - if (len) - { - name+= len; - continue; - } + name+= len; + continue; } -#endif if (disallow_path_chars && (*name == '/' || *name == '\\' || *name == '~' || *name == FN_EXTCHAR)) return 1; @@ -5299,11 +5289,7 @@ bool Lex_ident_fs::check_body(const char *name, size_t length, return 1; name++; } -#if defined(USE_MB) && defined(USE_MB_IDENT) - return last_char_is_space || (char_length > NAME_CHAR_LEN); -#else - return FALSE; -#endif + return char_length > NAME_CHAR_LEN; }