-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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, geo: Fix upper case geohash parsing and allow NULL arguments #76990
Conversation
pkg/geo/parse.go
Outdated
@@ -239,6 +239,9 @@ func parseGeoHash(g string, precision int) (geohash.Box, error) { | |||
return geohash.Box{}, pgerror.Newf(pgcode.InvalidParameterValue, "length of GeoHash must be greater than 0") | |||
} | |||
|
|||
// In PostGis, upper case letters are parsed as lower case letters. |
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.
(here and the test below)
nit: capitalise PostGIS as PostGIS
maybe use the term "case insensitive"
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.
Done.
39fd966
to
8c610ca
Compare
pkg/geo/parse_test.go
Outdated
@@ -642,6 +642,17 @@ func TestParseHash(t *testing.T) { | |||
Max: -120.9375, | |||
}, | |||
}}, | |||
// In PostGIS, upper case characters are parsed as lower case characters. |
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.
nit: use term "case sensitive"
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.
case-insensitive right? updated.
Release note (sql change): ST_Box2DFromGeoHash now accepts NULL arguments, the precision being NULL is the same as no precision being passed in at all. Upper case characters are now parsed as lower case characters for geohash, this matches Postgis behaviour.
8c610ca
to
537f89d
Compare
Thanks! |
Build succeeded: |
Release note (sql change): ST_Box2DFromGeoHash now accepts NULL arguments,
the precision being NULL is the same as no precision being passed in at all.
Upper case characters are now parsed as lower case characters for geohash,
this matches Postgis behaviour.
Resolves #75537