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

SQL: Fix column size for IP data type #53056

Merged
merged 3 commits into from
Mar 4, 2020
Merged

Conversation

matriv
Copy link
Contributor

@matriv matriv commented Mar 3, 2020

Set size/displaySize to 45 which is the maximum string for
an IP (v6), since IPs are returned as strings.

Fixes: #52762

Set size/displaySize to 45 which is the maximum string for
an IP (v6), since IPs are returned as strings.

Fixes: elastic#52762
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (:Search/SQL)

Copy link
Member

@costin costin left a 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;
Copy link
Member

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) {
Copy link
Member

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

@costin
Copy link
Member

costin commented Mar 3, 2020

No need to backport all the way to 6.x

@matriv matriv removed the v6.8.8 label Mar 3, 2020
Copy link
Contributor

@bpintea bpintea left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@astefan astefan left a comment

Choose a reason for hiding this comment

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

LGTM

@matriv matriv merged commit 815f017 into elastic:master Mar 4, 2020
@matriv matriv deleted the fix-52762 branch March 4, 2020 09:09
matriv added a commit that referenced this pull request Mar 4, 2020
Set size/displaySize to 45 which is the maximum string for
an IP (v6), since IPs are returned as strings.

Fixes: #52762

(cherry picked from commit 815f017)
matriv added a commit that referenced this pull request Mar 4, 2020
Set size/displaySize to 45 which is the maximum string for
an IP (v6), since IPs are returned as strings.

Fixes: #52762

(cherry picked from commit 815f017)
matriv added a commit that referenced this pull request Mar 4, 2020
Set size/displaySize to 45 which is the maximum string for
an IP (v6), since IPs are returned as strings.

Fixes: #52762

(cherry picked from commit 815f017)
@matriv matriv added the v6.8.8 label Mar 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SQL: IP type reported to have column size of 0
6 participants