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

Fix for #50 #53

Closed
wants to merge 1 commit into from
Closed

Fix for #50 #53

wants to merge 1 commit into from

Conversation

yorek
Copy link

@yorek yorek commented Oct 8, 2020

Seems that support to Geography binary format v2 is already there, but when reading the byte stream, the maximum expected version was still set to 1

Copy link
Owner

@dotMorten dotMorten left a comment

Choose a reason for hiding this comment

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

I don't think it's correct to just claim v2 support, without actually adding v2 support. See https://github.com/dotMorten/Microsoft.SqlServer.Types/blob/main/src/Microsoft.SqlServer.Types/ShapeData.cs#L236-L239
Also there's a huge amount of white space/newline changes in the PR

@@ -98,6 +98,9 @@ internal struct Figure
/// </summary>
internal struct ShapeData
{
// As per https://docs.microsoft.com/en-us/openspecs/sql_server_protocols/ms-ssclrt/77460aa9-8c2f-4449-a65e-1d649ebd77fa
public const byte MAX_GEOGRAPHY_SERIALIZATION_FORMAT_SUPPORTED = 2;
Copy link
Owner

Choose a reason for hiding this comment

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

That's not really the case though is it? The library currently does not support the curve segments that were added to v2

Copy link
Author

Choose a reason for hiding this comment

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

Mmmm..the point that I have created (on Azure SQL) a POLYGON and still got a binary format that shows 2 as version, even if I'm not using curve segments. Without this hack/fix, the geography will not be handled correctly

Copy link
Owner

@dotMorten dotMorten Oct 8, 2020

Choose a reason for hiding this comment

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

I don't know why it's serialized as v2 when not needed, but this library currently doesn't support v2, so it's correctly failing until #9 has been addressed.
I'm a little worried what this means to just ignore it here, without at least handling the extra fields and skipping correctly over and failing if a curved geometry is hit

@dotMorten
Copy link
Owner

Closing this, since I'd rather we get proper v2 curve support before trying to read it

@dotMorten dotMorten closed this Jan 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants