Fix assert in arrayElement

This commit is contained in:
Alexey Milovidov 2020-08-02 04:07:08 +03:00
parent 0adf8c723e
commit a4e8c47702
3 changed files with 12 additions and 2 deletions

View File

@ -780,8 +780,10 @@ void FunctionArrayElement::executeImpl(Block & block, const ColumnNumbers & argu
ArrayImpl::NullMapBuilder builder;
Block source_block;
const auto & input_type = typeid_cast<const DataTypeNullable &>(*typeid_cast<const DataTypeArray &>(*block.getByPosition(arguments[0]).type).getNestedType()).getNestedType();
const auto & tmp_ret_type = typeid_cast<const DataTypeNullable &>(*block.getByPosition(result).type).getNestedType();
const DataTypePtr & input_type = typeid_cast<const DataTypeNullable &>(
*typeid_cast<const DataTypeArray &>(*block.getByPosition(arguments[0]).type).getNestedType()).getNestedType();
DataTypePtr tmp_ret_type = removeNullable(block.getByPosition(result).type);
if (col_array)
{

View File

@ -0,0 +1,4 @@
[1] 1
[1] 1
[1] 1
[1] 1

View File

@ -0,0 +1,4 @@
SELECT [toNullable(1)] AS x, x[toNullable(1)] AS y;
SELECT materialize([toNullable(1)]) AS x, x[toNullable(1)] AS y;
SELECT [toNullable(1)] AS x, x[materialize(toNullable(1))] AS y;
SELECT materialize([toNullable(1)]) AS x, x[materialize(toNullable(1))] AS y;