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

spatial: difference in st_box2dfromgeohash result #75537

Closed
rafiss opened this issue Jan 26, 2022 · 1 comment · Fixed by #76990
Closed

spatial: difference in st_box2dfromgeohash result #75537

rafiss opened this issue Jan 26, 2022 · 1 comment · Fixed by #76990
Assignees
Labels
A-spatial Spatial work that is *not* related to builtins. C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)

Comments

@rafiss
Copy link
Collaborator

rafiss commented Jan 26, 2022

Running on Postgis:

postgres=# select st_box2dfromgeohash('F'::TEXT::TEXT::TEXT, NULL::INT4::INT4)::BOX2D ;
 st_box2dfromgeohash
---------------------
 BOX(-90 45,-45 90)

But on CockroachDB:

root@:26257/defaultdb> select st_box2dfromgeohash('F'::TEXT::TEXT::TEXT, NULL::INT4::INT4)::BOX2D ;
  st_box2dfromgeohash
-----------------------
  NULL
@rafiss rafiss added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. A-spatial Spatial work that is *not* related to builtins. labels Jan 26, 2022
@blathers-crl blathers-crl bot added the T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) label Jan 26, 2022
@mgartner
Copy link
Collaborator

Setting NullableArgs: true for this builtin will prevent it from being folded to NULL in the presence of null arguments. We'll need to make sure the function can actually handle either argument being NULL.

Also, it looks like the single-argument overload of this function errors with the same input, when it succeeds in Postgis:

Postgis:

marcus=# select st_box2dfromgeohash('F'::TEXT::TEXT::TEXT)::BOX2D;
 st_box2dfromgeohash
---------------------
 BOX(-90 45,-45 90)

CockroachDB:

defaultdb> select st_box2dfromgeohash('F'::TEXT::TEXT::TEXT)::BOX2D;
ERROR: st_box2dfromgeohash(): geohash decode 'F': invalid character at index 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-spatial Spatial work that is *not* related to builtins. C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants