Merge pull request #19788 from ClickHouse/array-enumerate-extended-bug

Fix trivial bug in arrayEnumerateUniq
This commit is contained in:
alexey-milovidov 2021-01-29 14:58:38 +03:00 committed by GitHub
commit 0679d81c0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 0 deletions

View File

@ -353,6 +353,9 @@ bool FunctionArrayEnumerateExtended<Derived>::execute128bit(
keys_bytes += key_sizes[j];
}
if (keys_bytes > 16)
return false;
executeMethod<MethodFixed>(offsets, columns, key_sizes, nullptr, res_values);
return true;
}

View File

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

View File

@ -0,0 +1,13 @@
-- there was a bug - missing check of the total size of keys for the case with hash table with 128bit key.
SELECT arrayEnumerateUniq(arrayEnumerateUniq([toInt256(10), toInt256(100), toInt256(2)]), [toInt256(123), toInt256(1023), toInt256(123)]);
SELECT arrayEnumerateUniq(
[111111, 222222, 333333],
[444444, 555555, 666666],
[111111, 222222, 333333],
[444444, 555555, 666666],
[111111, 222222, 333333],
[444444, 555555, 666666],
[111111, 222222, 333333],
[444444, 555555, 666666]);