Skip to content

Commit

Permalink
Fix tupleConcat of two empty tuples
Browse files Browse the repository at this point in the history
  • Loading branch information
amosbird committed Jun 6, 2024
1 parent 6b07873 commit dd9b15d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Functions/tupleConcat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class FunctionTupleConcat : public IFunction
return std::make_shared<DataTypeTuple>(tuple_arg_types);
}

ColumnPtr executeImpl(const ColumnsWithTypeAndName & arguments, const DataTypePtr &, size_t) const override
ColumnPtr executeImpl(const ColumnsWithTypeAndName & arguments, const DataTypePtr &, size_t input_rows_count) const override
{
const size_t num_arguments = arguments.size();
Columns columns;
Expand Down Expand Up @@ -92,6 +92,9 @@ class FunctionTupleConcat : public IFunction
columns.push_back(inner_col);
}

if (columns.empty())
return ColumnTuple::create(input_rows_count);

return ColumnTuple::create(columns);
}
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
()
1 change: 1 addition & 0 deletions tests/queries/0_stateless/03167_empty_tuple_concat.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SELECT ()||();

0 comments on commit dd9b15d

Please sign in to comment.