ubsan/memsan fix.

This commit is contained in:
Amos Bird 2019-09-13 23:23:15 +08:00
parent 541f85b58a
commit 1cf47da60d
3 changed files with 14 additions and 2 deletions

View File

@ -224,8 +224,18 @@ private:
public: public:
bool hasZero() const { return has_zero; } 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); } Cell * zeroValue() { return reinterpret_cast<Cell*>(&zero_value_storage); }
const Cell * zeroValue() const { return reinterpret_cast<const Cell*>(&zero_value_storage); } const Cell * zeroValue() const { return reinterpret_cast<const Cell*>(&zero_value_storage); }

View File

@ -0,0 +1 @@
[[],[2]]

View File

@ -0,0 +1 @@
select groupUniqArray(v) from values('id int, v Array(int)', (1, [2]), (1, [])) group by id;