|
UUIDs are a UDT in MariaDB 10.11. As such, the grammar parsing follows field_type_all then udt_name productions, invoking LEX::set_field_type_udt. That method performs a lookup on the name of the type (in this case, 'UUID') and fetches the type_handler_uuid_dispatcher, retaining the passed length, 24, as part of the Lex_field_type_st. This value is ignored and in fact overwritten later during Type_handler_fbt<UUID<false>, Type_collection_uuid>::Column_definition_fix_attributes when the column's length is changed to 36 (the result of FbtImpl::max_char_length()). This is also the maximum length of a UUID code when represented as ASCII, including the hyphen separators. So in effect, the length specified by the user has no effect. We could emit a warning if we detect that this value is anything other than 0, but unless we change our grammar handling for UDTs, we cannot reject this query outright if we see the UUID field presenting with '(' x ')' because UDTs aren't invited into any aspect of syntax validation during create table.
|