mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-19 16:20:50 +00:00
Fix keyed hash issue with empty array/map input
This commit is contained in:
parent
1c54c0d239
commit
4d0fc70227
@ -96,9 +96,8 @@ namespace impl
|
||||
{
|
||||
const auto *const begin = offsets->begin();
|
||||
const auto * upper = std::upper_bound(begin, offsets->end(), i);
|
||||
if (upper == offsets->end())
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "offset {} not found in function SipHashKeyColumns::getKey", i);
|
||||
i = upper - begin;
|
||||
if (upper != offsets->end())
|
||||
i = upper - begin;
|
||||
}
|
||||
const auto & key0data = assert_cast<const ColumnUInt64 &>(*key0).getData();
|
||||
const auto & key1data = assert_cast<const ColumnUInt64 &>(*key1).getData();
|
||||
|
@ -239,3 +239,8 @@ Check bug found fuzzing
|
||||
Check bug 2 found fuzzing
|
||||
608E1FF030C9E206185B112C2A25F1A7
|
||||
ABB65AE97711A2E053E324ED88B1D08B
|
||||
Check bug 3 found fuzzing
|
||||
4761183170873013810
|
||||
0AD04BFD000000000000000000000000
|
||||
4761183170873013810
|
||||
0AD04BFD000000000000000000000000
|
||||
|
@ -345,3 +345,9 @@ CREATE TABLE sipHashKeyed_keys (`a` Map(String, String)) ENGINE = Memory;
|
||||
INSERT INTO sipHashKeyed_keys FORMAT VALUES ({'a':'b', 'c':'d'}), ({'e':'f', 'g':'h'});
|
||||
SELECT hex(sipHash128ReferenceKeyed((0::UInt64, materialize(0::UInt64)), a)) FROM sipHashKeyed_keys ORDER BY a;
|
||||
DROP TABLE sipHashKeyed_keys;
|
||||
|
||||
SELECT 'Check bug 3 found fuzzing';
|
||||
SELECT sipHash64Keyed((1::UInt64, 2::UInt64), []::Array(UInt8));
|
||||
SELECT hex(sipHash128Keyed((1::UInt64, 2::UInt64), []::Array(UInt8)));
|
||||
SELECT sipHash64Keyed((1::UInt64, 2::UInt64), mapFromArrays([], []));
|
||||
SELECT hex(sipHash128Keyed((1::UInt64, 2::UInt64), mapFromArrays([], [])));
|
||||
|
Loading…
Reference in New Issue
Block a user