[STBox] Do not set SRID for boxes without coordinates#17
Merged
estebanzimanyi merged 2 commits intoMobilityDB:developfrom Jul 7, 2020
Merged
[STBox] Do not set SRID for boxes without coordinates#17estebanzimanyi merged 2 commits intoMobilityDB:developfrom
estebanzimanyi merged 2 commits intoMobilityDB:developfrom
Conversation
a16987d to
8aeb5bd
Compare
8aeb5bd to
f3d91d9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
I noticed this while working on MobilityDB/MobilityDB-python#3
The following query is not allowed by MobilityDB:
Which is fair, and a perfectly valid behavior - having an SRID where there are no coordinates does not make sense.
However, when you run the following, MobilityDB returns back with the SRID set to default value, even though it is not a valid representation according to itself:
I feel MobilityDB should not output invalid representations. This results in failures when doing some kind of passthrough tests, and may result in unintended bugs with no direct reason for the underlying issue.
New behavior
After this change, this would be the resulting behavior:
The fix is a one-line change (we add the condition to only append SRID prefix when coordinates present). Most other changes are in this PR are for tests.
Please let me know your thoughts on this.