suharev7 / clickhouse-rs

Asynchronous ClickHouse client library for Rust programming language.
MIT License
324 stars 121 forks source link

Compare IP adresses properly #172

Closed scrabsha closed 2 years ago

scrabsha commented 2 years ago

Compare IP adresses and UUID properly

The implementation of PartialEq for Value is handcrafted. It is composed of a huge match expression, which aims to properly compare each variant of the left-hand and the right-hand Values. The last arm is a catchall arm, supposed to catch every case where both variant does not match.

The problem is that no match arm in the said expression handles the Ipv4, Ipv6 and Uuid variants. As such, two IP addresses are always considered as not equal. Similarly, two UUIDs are always considered as not equal.

This commit adds three missing arms, which adds proper IP address comparison as well as proper UUID comparison.

suharev7 commented 2 years ago

Thank you