mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
Merge pull request #60359 from Avogar/fix-ipv6-hashing
Fix use-of-uninitialized-value and invalid result in hashing functions with IPv6
This commit is contained in:
commit
6473023ad5
@ -279,7 +279,7 @@ public:
|
||||
for (size_t i = 0; i < size; ++i)
|
||||
{
|
||||
Impl::apply(
|
||||
reinterpret_cast<const char *>(&data[i * length]), length, reinterpret_cast<uint8_t *>(&chars_to[i * Impl::length]));
|
||||
reinterpret_cast<const char *>(&data[i]), length, reinterpret_cast<uint8_t *>(&chars_to[i * Impl::length]));
|
||||
}
|
||||
return col_to;
|
||||
}
|
||||
|
20
tests/queries/0_stateless/02998_ipv6_hashing.reference
Normal file
20
tests/queries/0_stateless/02998_ipv6_hashing.reference
Normal file
@ -0,0 +1,20 @@
|
||||
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö›¢ÞãTñ£K{êaƒ—;xdP
|
||||
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö›¢ÞãTñ£K{êaƒ—;xdP
|
||||
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö›¢ÞãTñ£K{êaƒ—;xdP
|
||||
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö›¢ÞãTñ£K{êaƒ—;xdP
|
||||
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö›¢ÞãTñ£K{êaƒ—;xdP
|
||||
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö›¢ÞãTñ£K{êaƒ—;xdP
|
||||
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö›¢ÞãTñ£K{êaƒ—;xdP
|
||||
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö›¢ÞãTñ£K{êaƒ—;xdP
|
||||
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö›¢ÞãTñ£K{êaƒ—;xdP
|
||||
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö›¢ÞãTñ£K{êaƒ—;xdP
|
||||
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö›¢ÞãTñ£K{êaƒ—;xdP
|
||||
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö›¢ÞãTñ£K{êaƒ—;xdP
|
||||
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö›¢ÞãTñ£K{êaƒ—;xdP
|
||||
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö›¢ÞãTñ£K{êaƒ—;xdP
|
||||
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö›¢ÞãTñ£K{êaƒ—;xdP
|
||||
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö›¢ÞãTñ£K{êaƒ—;xdP
|
||||
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö›¢ÞãTñ£K{êaƒ—;xdP
|
||||
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö›¢ÞãTñ£K{êaƒ—;xdP
|
||||
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö›¢ÞãTñ£K{êaƒ—;xdP
|
||||
fe80::62:5aff:fed1:daf0 ÷T—ºÖ÷t{Ö±P¶ö›¢ÞãTñ£K{êaƒ—;xdP
|
5
tests/queries/0_stateless/02998_ipv6_hashing.sql
Normal file
5
tests/queries/0_stateless/02998_ipv6_hashing.sql
Normal file
@ -0,0 +1,5 @@
|
||||
-- Tags: no-fasttest
|
||||
|
||||
SELECT toIPv6(materialize(toLowCardinality('fe80::62:5aff:fed1:daf0'))) AS ipv6, SHA256(ipv6) from numbers(10);
|
||||
SELECT toIPv6(materialize('fe80::62:5aff:fed1:daf0')) AS ipv6, SHA256(ipv6) from numbers(10);
|
||||
|
Loading…
Reference in New Issue
Block a user