Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardize behaviour of CAST into IPv4, IPv6, toIPv4, toIPv6 functions #35240

Merged

Conversation

kitaisreal
Copy link
Contributor

@kitaisreal kitaisreal commented Mar 12, 2022

Changelog category (leave one):

  • Bug Fix (user-visible misbehaviour in official stable or prestable release)

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Make function cast(value, 'IPv4'), cast(value, 'IPv6') behave same as toIPv4, toIPv6 functions. Changed behavior of incorrect IP address passed into functions toIPv4, toIPv6, now if invalid IP address passes into this functions exception will be raised, before this function return default value. Added functions IPv4StringToNumOrDefault, IPv4StringToNumOrNull, IPv6StringToNumOrDefault, IPv6StringOrNull toIPv4OrDefault, toIPv4OrNull, toIPv6OrDefault, toIPv6OrNull. Functions IPv4StringToNumOrDefault , toIPv4OrDefault , toIPv6OrDefault should be used if previous logic relied on IPv4StringToNum, toIPv4, toIPv6 returning default value for invalid address. Added setting cast_ipv4_ipv6_default_on_conversion_error, if this setting enabled, then IP address conversion functions will behave as before. Closes #22825. Closes #5799. Closes #35156.

@robot-clickhouse robot-clickhouse added the pr-bugfix Pull request with bugfix, not backported by default label Mar 12, 2022
@kitaisreal
Copy link
Contributor Author

@Mergifyio update

@mergify
Copy link
Contributor

mergify bot commented Mar 13, 2022

update

✅ Branch has been successfully updated

@kitaisreal kitaisreal force-pushed the cast-to-ip-address-refactoring branch from 1ca6e20 to 36dc7f0 Compare March 14, 2022 09:15
@Avogar Avogar self-assigned this Mar 14, 2022
@CLAassistant
Copy link

CLAassistant commented Mar 14, 2022

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@Avogar Avogar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kitaisreal kitaisreal merged commit f837f60 into ClickHouse:master Mar 17, 2022
@alexey-milovidov alexey-milovidov added the pr-must-backport Pull request should be backported intentionally. Use this label with great care! label Mar 17, 2022
kitaisreal added a commit that referenced this pull request Mar 17, 2022
…ae6c7bb4fae0b6bcf83107d0f148e

Cherry pick #35240 to 22.2: Standardize behaviour of CAST into IPv4, IPv6, toIPv4, toIPv6 functions
robot-clickhouse pushed a commit that referenced this pull request Mar 18, 2022
@alexey-milovidov alexey-milovidov added pr-backward-incompatible Pull request with backwards incompatible changes and removed backward compatibility labels Apr 5, 2022
@Felixoid Felixoid added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Jul 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-backward-incompatible Pull request with backwards incompatible changes pr-bugfix Pull request with bugfix, not backported by default pr-must-backport Pull request should be backported intentionally. Use this label with great care!
Projects
None yet
6 participants