-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Allow to cast IPv6 to IPv4 for address in proper mapping block #49759
Changes from 5 commits
58bdcc2
108e256
24067ea
fc857aa
9443457
0d4ed32
3af7e0a
09806bc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,10 @@ IPv4 functions | |
127.0.0.1 | ||
127.0.0.1 | ||
-- | ||
1.2.3.4 | ||
1.2.3.4 | ||
0.0.0.0 | ||
-- | ||
127.0.0.1 | ||
-- | ||
0 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,13 @@ SELECT toIPv4OrNull('127.0.0.1'); | |
|
||
SELECT '--'; | ||
|
||
SELECT toIPv4(toIPv6('::ffff:1.2.3.4')); | ||
SELECT toIPv4(toIPv6('::afff:1.2.3.4')); --{serverError CANNOT_CONVERT_TYPE} | ||
SELECT toIPv4OrDefault(toIPv6('::ffff:1.2.3.4')); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. + test also with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for historical reason |
||
SELECT toIPv4OrDefault(toIPv6('::afff:1.2.3.4')); | ||
|
||
SELECT '--'; | ||
|
||
SELECT cast('test' , 'IPv4'); --{serverError CANNOT_PARSE_IPV4} | ||
SELECT cast('127.0.0.1' , 'IPv4'); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe include
vec_src[i]
in the error message?