Fix MSan report; add a test

This commit is contained in:
Alexey Milovidov 2021-03-29 04:01:51 +03:00
parent c08289517a
commit 922265d28d
3 changed files with 16 additions and 1 deletions

View File

@ -169,7 +169,20 @@ public:
DB::writeIntBinary<size_t>(total_values, buf); DB::writeIntBinary<size_t>(total_values, buf);
for (size_t i = 0; i < size; ++i) for (size_t i = 0; i < size; ++i)
DB::writePODBinary(samples[i], buf); {
/// There was a mistake in this function.
/// Instead of correctly serializing the elements,
/// it was writing them with uninitialized padding.
/// Here we ensure that padding is zero without changing the protocol.
/// TODO: After implementation of "versioning aggregate function state",
/// change the serialization format.
Element elem;
memset(&elem, 0, sizeof(elem));
elem = samples[i];
DB::writePODBinary(elem, buf);
}
} }
private: private:

View File

@ -0,0 +1 @@
11447494982455782708

View File

@ -0,0 +1 @@
SELECT cityHash64(toString(quantileDeterministicState(number, sipHash64(number)))) FROM numbers(8193);