Bug #108265 Native error 517 when querying a tables with Geometry columns
Submitted: 24 Aug 2022 8:13 Modified: 5 Apr 2024 12:23
Reporter: Sruli Ganor Email Updates:
Status: Can't repeat Impact on me:
None 
Category:Connector / ODBC Severity:S3 (Non-critical)
Version:8.0.30 OS:Any
Assigned to: CPU Architecture:Any

[24 Aug 2022 8:13] Sruli Ganor
Description:
Hi,
I get a mysterious error that occurs when I run a SELECT * query on a MySQL table that contains a geometry column (Geometry, Polygon. etc).
It happens only with ODBC driver versions 8.0.26 thru 8.0.30 (Windows or Linux).
It happens also when the table is empty.

The native error is 517, SQL State HY000, and the message is
"MySQL][ODBC 8.0(w) Driver][mysqld-8.0.20]" with no further text.
This looks like an invalid error.

The only workaround I found is to cast the column, e.g.:
SELECT cast(my_polygon as binary)

How to repeat:
Create a table with one or more columns of type Geometry, Polygon, etc.
No need to insert any data.
Run a query like SELECT * from geo_table;
[24 Aug 2022 12:19] MySQL Verification Team
Hello Sruli Ganor,

Thank you for the bug report.
Could you please provide repeatable test case(create table and code) to reproduce this issue at our end? Thanks.

Regards,
Ashwini Patil
[24 Aug 2022 14:55] Sruli Ganor
Here is a simple way to reproduce:

create table geo_tab (id int, geo geometry);

Run a program that connects to the server, and then:

res = SQLPrepare(hStmt, L"SELECT * FROM geo_tab", SQL_NTS);  // OK
res = SQLExecute(hStmt);       // Fails

Notes:
* Use ODBC driver 8.0.26 or above
* The bug occurs only on prepared statements.
[5 Apr 2024 12:23] MySQL Verification Team
Hello Sruli Ganor,

Thank you for the create table statement. However this is not enough to reproduce the issue.
Please upgrade to latest version and report us back if issue persist even in latest version along with test case. Thank you.

Regards,
Ashwini Patil