Merge pull request #66168 from ClickHouse/cachemeifyoucan

Fix crash when adding empty tuple to query cache
This commit is contained in:
Alexey Milovidov 2024-07-06 14:38:36 +00:00 committed by GitHub
commit 1d37952a95
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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;