Fixed error with NULLs [#CLICKHOUSE-2993].

This commit is contained in:
Alexey Milovidov 2017-06-16 21:05:45 +03:00
parent ee49c37fa6
commit 8343cf3578

View File

@ -32,8 +32,10 @@ ColumnPtr ColumnConst<Null>::convertToFullColumn() const
ColumnPtr nested_col;
if (data_type)
nested_col = data_type->createConstColumn(
s, typeid_cast<const DataTypeNullable &>(*data_type).getNestedType()->getDefault())->convertToFullColumnIfConst();
{
const IDataType & nested_data_type = *typeid_cast<const DataTypeNullable &>(*data_type).getNestedType();
nested_col = nested_data_type.createConstColumn(s, nested_data_type.getDefault())->convertToFullColumnIfConst();
}
else
nested_col = std::make_shared<ColumnUInt8>(s, 0);