mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
Fix size() and empty() for AggregationDataWithNullKey. #4223
This commit is contained in:
parent
0bf4f4334b
commit
cf40a1538b
@ -98,6 +98,18 @@ struct AggregationDataWithNullKey : public Base
|
||||
AggregateDataPtr & getNullKeyData() { return null_key_data; }
|
||||
bool hasNullKeyData() const { return has_null_key_data; }
|
||||
const AggregateDataPtr & getNullKeyData() const { return null_key_data; }
|
||||
size_t size() const { return Base::size() + (has_null_key_data ? 1 : 0); }
|
||||
bool empty() const { return Base::empty() && !has_null_key_data; }
|
||||
void clear()
|
||||
{
|
||||
Base::clear();
|
||||
has_null_key_data = false;
|
||||
}
|
||||
void clearAndShrink()
|
||||
{
|
||||
Base::clearAndShrink();
|
||||
has_null_key_data = false;
|
||||
}
|
||||
|
||||
private:
|
||||
bool has_null_key_data = false;
|
||||
|
Loading…
Reference in New Issue
Block a user