-
Notifications
You must be signed in to change notification settings - Fork 8.3k
toIPv6(x) doesn't work the same way as CAST(x AS IPv6) #5799
Copy link
Copy link
Closed
Labels
Description
:) select toIPv6(IPv6StringToNum('::1bc0')) format JSON
SELECT toIPv6(IPv6StringToNum('::1bc0'))
FORMAT JSON
Received exception from server (version 19.11.0):
Code: 43. DB::Exception: Received from localhost:9000, ::1. DB::Exception: Illegal type FixedString(16) of argument of function toIPv6.
0 rows in set. Elapsed: 0.088 sec.
:) select toIPv6('::1bc0') format JSON
SELECT toIPv6('::1bc0')
FORMAT JSON
{
"meta":
[
{
"name": "toIPv6('::1bc0')",
"type": "IPv6"
}
],
"data":
[
{
"toIPv6('::1bc0')": "::1bc0"
}
],
"rows": 1,
"statistics":
{
"elapsed": 0.000128767,
"rows_read": 1,
"bytes_read": 1
}
}
1 rows in set. Elapsed: 0.001 sec.
:) select CAST(IPv6StringToNum('::1bc0') AS IPv6) format JSON
SELECT CAST(IPv6StringToNum('::1bc0'), 'IPv6')
FORMAT JSON
{
"meta":
[
{
"name": "CAST(IPv6StringToNum('::1bc0'), 'IPv6')",
"type": "IPv6"
}
],
"data":
[
{
"CAST(IPv6StringToNum('::1bc0'), 'IPv6')": "::1bc0"
}
],
"rows": 1,
"statistics":
{
"elapsed": 0.000189836,
"rows_read": 1,
"bytes_read": 1
}
}
1 rows in set. Elapsed: 0.001 sec.
Reactions are currently unavailable