Bug #86974 | Cannot create instance of MySqlGeometry for empty geometry collection | ||
---|---|---|---|
Submitted: | 6 Jul 2017 13:43 | Modified: | 18 Jul 2018 22:26 |
Reporter: | Peet Whittaker (OCA) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / NET | Severity: | S2 (Serious) |
Version: | 6.9.9 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | Collection, Geometry, spatial |
[6 Jul 2017 13:43]
Peet Whittaker
[10 Jul 2017 13:34]
Chiranjeevi Battula
Hello Peet, Thank you for the bug report. Please refer to the below developer forums it may help you to solve your problem: https://forums.mysql.com/read.php?38,645461,645526#msg-645526 If issue persists, please provide repeatable test case (exact steps/sample project, create tables statements/database etc. - please make it as private if you prefer) to confirm this issue at our end? Thanks, Chiranjeevi.
[10 Jul 2017 14:07]
Peet Whittaker
Hi Chiranjeevi, Thank you for looking into this. However, this issue is not about how to create an empty collection in the database. It is an issue with the constructor of the MySqlGeometry class in the ADO.NET NuGet package. I've created a very simple project that reproduces the bug. You can find it here: https://github.com/peetw/MySqlBug Thanks
[11 Jul 2017 7:28]
Chiranjeevi Battula
Hello Peet, Thank you for the feedback and test case. Verified this behavior on Visual Studio 2015 (C#.Net) and Connector/NET 6.9.9 version. Thanks, Chiranjeevi.
[11 Jul 2017 7:29]
Chiranjeevi Battula
StackTrace :at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource) at System.BitConverter.ToDouble(Byte[] value, Int32 startIndex) at MySql.Data.Types.MySqlGeometry..ctor(MySqlDbType type, Byte[] val)
[11 Jul 2017 7:29]
Chiranjeevi Battula
Screenshot
Attachment: 86974.JPG (image/jpeg, text), 156.86 KiB.
[18 Jul 2017 8:51]
Peet Whittaker
I can submit a pull request to the github project if that would help? https://github.com/mysql/mysql-connector-net Not sure who maintains it, or how active it is... Or even which branch to base the PR off.
[19 Aug 2017 14:33]
Peet Whittaker
Hi Chiranjeevi, Any progress on this? Is there any way I can help?
[17 Nov 2017 9:36]
Peet Whittaker
I have submitted a pull request containing a fix here: https://github.com/mysql/mysql-connector-net/pull/15
[27 Nov 2017 14:58]
OCA Admin
Contribution submitted via Github - Fix bug #86974 (*) Contribution by Peet Whittaker (Github peetw, mysql-connector-net/pull/15#issuecomment-346619108): I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.
Contribution: git_patch_153169181.txt (text/plain), 3.83 KiB.
[26 Mar 2018 19:27]
Peet Whittaker
Hi, any update on this? It also affects both version 7.x and 8.x
[15 Jul 2018 19:13]
Andreas Ravnestad
This is a real showstopper with the MySQL connector (affecting both 6.9.9 as specified in this bug report as well as version 8.0.11 currently available on NuGet). Please take a look at Peet's pull request, it seems to fix the problem well.
[18 Jul 2018 22:26]
Christine Cole
Posted by developer: Fixed as of the upcoming MySQL Connector/NET 6.10.8 and 8.0.13 releases, and here's the changelog entry: The MySql.Data.Types.MySqlGeometry constructor called with an array of bytes representing an empty geometry collection generated an ArgumentOutOfRangeException exception, rather than creating the type as expected. Thanks to Peet Whittaker for the patch. Thank you for the bug report.