mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 08:40:50 +00:00
Merge pull request #51807 from ClickHouse/check_not_empty_header_for_remote
Make sure that we don't attempt to serialize/deserialize block with 0 columns and non-zero rows
This commit is contained in:
commit
57c3941fa6
@ -149,6 +149,9 @@ Block NativeReader::read()
|
||||
rows = index_block_it->num_rows;
|
||||
}
|
||||
|
||||
if (columns == 0 && !header && rows != 0)
|
||||
throw Exception(ErrorCodes::INCORRECT_DATA, "Zero columns but {} rows in Native format.", rows);
|
||||
|
||||
for (size_t i = 0; i < columns; ++i)
|
||||
{
|
||||
if (use_index)
|
||||
@ -290,6 +293,9 @@ Block NativeReader::read()
|
||||
res.swap(tmp_res);
|
||||
}
|
||||
|
||||
if (res.rows() != rows)
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "Row count mismatch after desirialization, got: {}, expected: {}", res.rows(), rows);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user