Skip to content

Commit 55a2bab

Browse files
committed
Bug#24400628: DEBUG ASSETION KICKS IN WHEN LONG SUBPARTITION NAME
IS USED IN CREATE TABLE The problem was that using a very long subpartition name could lead to the server exiting abnormally. This patch fixes the problem by reporting ER_TOO_LONG_IDENT if a name with more than 64 characters are used as partition and subpartition name.
1 parent 8dc6421 commit 55a2bab

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

sql/sql_yacc.yy

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4655,6 +4655,12 @@ part_name:
46554655
{
46564656
partition_info *part_info= Lex->part_info;
46574657
partition_element *p_elem= part_info->curr_part_elem;
4658+
if (check_string_char_length(&$1, "", NAME_CHAR_LEN,
4659+
system_charset_info, true))
4660+
{
4661+
my_error(ER_TOO_LONG_IDENT, MYF(0), $1.str);
4662+
MYSQL_YYABORT;
4663+
}
46584664
p_elem->partition_name= $1.str;
46594665
}
46604666
;
@@ -4949,7 +4955,15 @@ sub_part_definition:
49494955

49504956
sub_name:
49514957
ident_or_text
4952-
{ Lex->part_info->curr_part_elem->partition_name= $1.str; }
4958+
{
4959+
if (check_string_char_length(&$1, "", NAME_CHAR_LEN,
4960+
system_charset_info, true))
4961+
{
4962+
my_error(ER_TOO_LONG_IDENT, MYF(0), $1.str);
4963+
MYSQL_YYABORT;
4964+
}
4965+
Lex->part_info->curr_part_elem->partition_name= $1.str;
4966+
}
49534967
;
49544968

49554969
opt_part_options:

0 commit comments

Comments
 (0)