-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
SQL: Fix column size for IP data type #53056
Conversation
Set size/displaySize to 45 which is the maximum string for an IP (v6), since IPs are returned as strings. Fixes: elastic#52762
Pinging @elastic/es-search (:Search/SQL) |
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.
LGTM
@@ -462,7 +462,7 @@ public static int defaultPrecision(DataType dataType) { | |||
return 3; | |||
} | |||
if (dataType == IP) { | |||
return 39; | |||
return 45; |
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.
DataType.size()
could be potentially returned since it's the same value.
@@ -582,7 +582,7 @@ public static int displaySize(DataType dataType) { | |||
return 29; | |||
} | |||
if (dataType == IP) { |
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.
DataType.size()
could be potentially returned since it's the same value.
In fact, maybe this approach could be used for other DataTypes as well if applicable - that is whenever size == displaySize
No need to backport all the way to 6.x |
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.
LGTM
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.
LGTM
Set size/displaySize to
45
which is the maximum string foran IP (v6), since IPs are returned as strings.
Fixes: #52762