summaryrefslogtreecommitdiff
path: root/sql/table.h
diff options
context:
space:
mode:
authortmokmss <tomookam@live.jp>2022-06-05 08:04:18 +0000
committerNikita Malyavin <nikitamalyavin@gmail.com>2022-08-26 12:40:58 +0300
commit827b049e1e7df204feb744a270b4dca619a61de1 (patch)
tree607c8f72697c91d696c7a931af1698d545e57f00 /sql/table.h
parent851058a3e6f40cd2714762916235ebe93fc594b5 (diff)
downloadmariadb-git-827b049e1e7df204feb744a270b4dca619a61de1.tar.gz
MDEV-18873 Server crashes in Compare_identifiers::operator or in my_strcasecmp_utf8 upon ADD PERIOD IF NOT EXISTS with empty name
empty identifier specified as `` ends up with a NULL LEX_CSTRING::str in lexer. This is not considered correct in upper layers, for example in Compare_identifiers::operator(). Empty column name is usually avoided by a check_column_name() call while parsing, and period name matches the column name completely. Hence, this fix uses the mentioned call for verification, too.
Diffstat (limited to 'sql/table.h')
-rw-r--r--sql/table.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/table.h b/sql/table.h
index c9503b54934..3f750e7b221 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -3231,6 +3231,7 @@ void open_table_error(TABLE_SHARE *share, enum open_frm_error error,
void update_create_info_from_table(HA_CREATE_INFO *info, TABLE *form);
bool check_db_name(LEX_STRING *db);
bool check_column_name(const char *name);
+bool check_period_name(const char *name);
bool check_table_name(const char *name, size_t length, bool check_for_path_chars);
int rename_file_ext(const char * from,const char * to,const char * ext);
char *get_field(MEM_ROOT *mem, Field *field);