mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
Merge pull request #6937 from amosbird/ubmemfix
In hash tables, properly initialize zero key cell.
This commit is contained in:
commit
75dc7d331e
@ -224,8 +224,18 @@ private:
|
||||
|
||||
public:
|
||||
bool hasZero() const { return has_zero; }
|
||||
void setHasZero() { has_zero = true; }
|
||||
void clearHasZero() { has_zero = false; }
|
||||
|
||||
void setHasZero()
|
||||
{
|
||||
has_zero = true;
|
||||
new (zeroValue()) Cell();
|
||||
}
|
||||
|
||||
void clearHasZero()
|
||||
{
|
||||
has_zero = false;
|
||||
zeroValue()->~Cell();
|
||||
}
|
||||
|
||||
Cell * zeroValue() { return reinterpret_cast<Cell*>(&zero_value_storage); }
|
||||
const Cell * zeroValue() const { return reinterpret_cast<const Cell*>(&zero_value_storage); }
|
||||
|
@ -0,0 +1 @@
|
||||
[[],[2]]
|
@ -0,0 +1 @@
|
||||
select groupUniqArray(v) from values('id int, v Array(int)', (1, [2]), (1, [])) group by id;
|
Loading…
Reference in New Issue
Block a user