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
Panic in GeometryType.SQL when trying to cast GeometryType to string #3645
Comments
On my windows machine, MySQL does not convert geometry binary values to hex for display. |
Thanks for testing on Windows. What's the result you see in the mysql shell on Windows for a select of a geometry column with a simple geo type like |
Yep, selecting a simple point like that is mostly null characters
|
Weird that the Windows MySQL shell behavior is different. It seems like a bug to ever print out unreadable chars. Could you search/open a bug report with MySQL and we'll see what they say? I couldn't find any documentation for that behavior anywhere yet. Here's the Mac MySQL shell behavior, for completeness, too:
Thanks for jumping on the fix, too! |
This appears to be a printing issue from certain shells.
We need 2 things here:
|
When running in
sql-server
mode selecting geometry types can cause a panic and crash the server:When running in a local sql shell, we just see garbled output:
The problem is that
GeometryType::SQL
attempts to cast a geometry type to a string:https://github.com/dolthub/go-mysql-server/blob/main/sql/geometry.go#L293
We should follow MySQL and convert geometry binary values to hex for display:
The text was updated successfully, but these errors were encountered: