Fix STAsBinary to return WKB format instead of CLR#1364
Merged
ulvii merged 12 commits intomicrosoft:devfrom Jul 3, 2020
Merged
Fix STAsBinary to return WKB format instead of CLR#1364ulvii merged 12 commits intomicrosoft:devfrom
ulvii merged 12 commits intomicrosoft:devfrom
Conversation
lilgreenbird
reviewed
Jul 2, 2020
ulvii
reviewed
Jul 2, 2020
ulvii
reviewed
Jul 2, 2020
ulvii
reviewed
Jul 2, 2020
ulvii
reviewed
Jul 2, 2020
ulvii
reviewed
Jul 2, 2020
ulvii
reviewed
Jul 2, 2020
ulvii
reviewed
Jul 3, 2020
ulvii
reviewed
Jul 3, 2020
ulvii
reviewed
Jul 3, 2020
ulvii
reviewed
Jul 3, 2020
ulvii
reviewed
Jul 3, 2020
ulvii
reviewed
Jul 3, 2020
ulvii
approved these changes
Jul 3, 2020
rene-ye
approved these changes
Jul 3, 2020
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.
Fixes issue #1280.
STAsBinary is a method that's supported by SSMS to return a WKB (Well-Known binary) format of a Geometry/Geography instance. The driver also implemented this method when it first implemented spatial datatypes, but it was wrongly returning a CLR (Microsoft's internal representation of a Geometry/Geography instance, different from WKB) value instead. This PR adds new logic to parse existing spatial datatype instance into a WKB format.
The counterpart method to this method, STGeomFromWKB, (which takes in a WKB and returns a Geometry/Geography instance) will be fixed at a later date, and I've put a note in the Javadocs telling users to use deserialize(byte[]) instead which does the exact same thing as current STGeomFromWKB.