Fix crash when adding empty tuple to query cache

This commit is contained in:
Michael Kolupaev 2024-07-05 22:42:22 +00:00
parent 76119a4567
commit d4a4e4ec2d
3 changed files with 11 additions and 1 deletions

View File

@ -711,7 +711,13 @@ void ColumnTuple::takeDynamicStructureFromSourceColumns(const Columns & source_c
ColumnPtr ColumnTuple::compress() const
{
if (columns.empty())
return Ptr();
{
return ColumnCompressed::create(size(), 0,
[n = column_length]
{
return ColumnTuple::create(n);
});
}
size_t byte_size = 0;
Columns compressed;

View File

@ -0,0 +1,2 @@
() 0
() 0

View File

@ -0,0 +1,2 @@
SELECT tuple(), 0 FROM numbers(1) SETTINGS use_query_cache = true;
SELECT tuple(), 0 FROM numbers(1) SETTINGS use_query_cache = true;