Fixed typo and casting

This commit is contained in:
Kostiantyn Storozhuk 2021-06-28 15:22:13 +08:00
parent 3c71e067fa
commit ca4783d854
2 changed files with 3 additions and 3 deletions

View File

@ -159,11 +159,11 @@ namespace
read_bytes_size += 8;
break;
case ValueType::vtEnum8:
assert_cast<ColumnInt8 &>(column).insertValue(static_cast<const DataTypeEnum<Int8> &>(data_type).castToValue(value.data()).get<Int64>());
assert_cast<ColumnInt8 &>(column).insertValue(assert_cast<const DataTypeEnum<Int8> &>(data_type).castToValue(value.data()).get<Int8>());
read_bytes_size += assert_cast<ColumnInt8 &>(column).byteSize();
break;
case ValueType::vtEnum16:
assert_cast<ColumnInt16 &>(column).insertValue(static_cast<const DataTypeEnum<Int16> &>(data_type).castToValue(value.data()).get<Int64>());
assert_cast<ColumnInt16 &>(column).insertValue(assert_cast<const DataTypeEnum<Int16> &>(data_type).castToValue(value.data()).get<Int16>());
read_bytes_size += assert_cast<ColumnInt16 &>(column).byteSize();
break;
case ValueType::vtString:

View File

@ -109,7 +109,7 @@ static NamesAndTypesList getColumnsList(const ASTExpressionList * columns_defini
/// Transforms MySQL ENUM's list of strings to ClickHouse string-integer pairs
/// For example ENUM('a', 'b', 'c') -> ENUM('a'=1, 'b'=2, 'c'=3)
/// Elements on a position further than 32767 are assigned negative values, starting with -32768.
/// Note: Enum would be transformed to Enum8 if number of ellements is less then 128, otherwise it would be transformed to Enum16.
/// Note: Enum would be transformed to Enum8 if number of elements is less then 128, otherwise it would be transformed to Enum16.
if (type_name_upper.find("ENUM") != String::npos)
{
UInt16 i = 0;