1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-33739 Check field type of the first field in check_sequence_fields()

This avoids non-integral types breaking the call of
sequence_structure().
This commit is contained in:
Yuchen Pei
2024-03-22 15:29:41 +11:00
parent 593392ba8b
commit aba03eef07
3 changed files with 27 additions and 0 deletions

View File

@ -349,6 +349,12 @@ bool check_sequence_fields(LEX *lex, List<Create_field> *fields,
reason= my_get_err_msg(ER_SEQUENCE_TABLE_HAS_WRONG_NUMBER_OF_COLUMNS);
goto err;
}
if (!sequence_definition::is_allowed_value_type(
fields->head()->type_handler()->field_type()))
{
reason= fields->head()->field_name.str;
goto err;
}
row_structure= sequence_structure(fields->head()->type_handler());
if (field_count != array_elements(row_structure.fields)-1)
{