Standardize behaviour of CAST into IPv4, IPv6, toIPv4, toIPv6 functions#35240
Merged
kitaisreal merged 6 commits intoClickHouse:masterfrom Mar 17, 2022
Merged
Conversation
Contributor
Author
|
@Mergifyio update |
Contributor
✅ Branch has been successfully updated |
1ca6e20 to
36dc7f0
Compare
This was referenced 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
…6, toIPv4, toIPv6 functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog category (leave one):
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 astoIPv4,toIPv6functions. Changed behavior of incorrect IP address passed into functionstoIPv4,toIPv6, now if invalid IP address passes into this functions exception will be raised, before this function return default value. Added functionsIPv4StringToNumOrDefault,IPv4StringToNumOrNull,IPv6StringToNumOrDefault,IPv6StringOrNulltoIPv4OrDefault,toIPv4OrNull,toIPv6OrDefault,toIPv6OrNull. FunctionsIPv4StringToNumOrDefault,toIPv4OrDefault,toIPv6OrDefaultshould be used if previous logic relied onIPv4StringToNum,toIPv4,toIPv6returning default value for invalid address. Added settingcast_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.