```
:) CREATE TEMPORARY TABLE test (x enum('a', 'b'))

CREATE TEMPORARY TABLE test
(
    `x` enum('a', 'b')
)

Query id: 081d03e8-9945-4b0c-a906-4477f4b45d64


0 rows in set. Elapsed: 0.005 sec. 

Received exception from server (version 22.4.1):
Code: 223. DB::Exception: Received from localhost:9000. DB::Exception: Elements of Enum data type must be of form: 'name' = number, where name is string literal and number is an integer. (UNEXPECTED_AST_STRUCTURE)
```
{
    if (value_or_name.getType() == Field::Types::String)
    {
        return this->getValue(value_or_name.get<String>());
    }
    else if (value_or_name.getType() == Field::Types::Int64
          || value_or_name.getType() == Field::Types::UInt64)
    {
        Int64 value = value_or_name.get<Int64>();
        checkOverflow<Type>(value);
        this->getNameForValue(static_cast<Type>(value)); 
        return value;
    }
    else
        throw Exception(ErrorCodes::BAD_TYPE_OF_FIELD,
            "DataTypeEnum: Unsupported type of field {}", value_or_name.getTypeName());
}
template <typename Type>
bool DataTypeEnum<Type>::contains(const IDataType & rhs) const