Fix trivial bug in arrayEnumerateUniq

This commit is contained in:
Alexey Milovidov 2021-01-29 04:41:55 +03:00
parent 10160e5adf
commit b3944006cb
3 changed files with 18 additions and 0 deletions

View File

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