From 8343cf3578c7818a5123f35d3ed3580cae3a99c8 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Fri, 16 Jun 2017 21:05:45 +0300 Subject: [PATCH] Fixed error with NULLs [#CLICKHOUSE-2993]. --- dbms/src/Columns/ColumnConst.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dbms/src/Columns/ColumnConst.cpp b/dbms/src/Columns/ColumnConst.cpp index 341140be115..c4bb27057bd 100644 --- a/dbms/src/Columns/ColumnConst.cpp +++ b/dbms/src/Columns/ColumnConst.cpp @@ -32,8 +32,10 @@ ColumnPtr ColumnConst::convertToFullColumn() const ColumnPtr nested_col; if (data_type) - nested_col = data_type->createConstColumn( - s, typeid_cast(*data_type).getNestedType()->getDefault())->convertToFullColumnIfConst(); + { + const IDataType & nested_data_type = *typeid_cast(*data_type).getNestedType(); + nested_col = nested_data_type.createConstColumn(s, nested_data_type.getDefault())->convertToFullColumnIfConst(); + } else nested_col = std::make_shared(s, 0);