Skip to content

Add simple MySqlGeometry type #677

@bgrainger

Description

@bgrainger

Connector/NET supports a MySqlGeometry type, but it doesn't appear to be very well designed:

  • MySqlGeometry.Value exposes the data for direct manipulation
  • The API only seems to support POINT, not any other kind of Geometry object
  • It fails when used with a lot of APIs: bugs 96498, 96499, 96500.
  • It's implemented as a struct when possibly a class would be more appropriate.

This isn't really an issue in practice as it appears to be used very infrequently: #70 (comment)

Because it's not used much, there's little backwards compatibility concern with changing its API. We should introduce a type that's suitable for use with spatial querying layers and that serves to mark a parameter value or returned result as unambiguously being a GEOMETRY value, not any arbitrary byte[].

MySqlDataReader.GetValue should still return byte[] for GEOMETRY columns, but MySqlDataReader.GetMySqlGeometry and GetFieldValue<MySqlGeometry> should be implemented.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions