1

I am using MySQL version 8.0.29 and I have an issue with WKB string, I will simplify query here

SELECT ST_GeomFromWKB(X'0103000020E61000000100000005000000834B0400800125C0AE8645BE2BCE484089E20C00805011C0AE8645BE2BCE48407DB4FBFF7F5011C0333D29DFA8544B40834B0400800125C0711727DFA8544B40834B0400800125C0AE8645BE2BCE4840')

but this query runs fine

SELECT ST_GeomFromWKB(X'0103000000010000000500000000000000800125C07CAF45BE2BCE4840000000000088FD3F7CAF45BE2BCE4840000000000088FD3F7D7F0B0026DB4D4000000000800125C07D7F0B0026DB4D4000000000800125C07CAF45BE2BCE4840')

return an error : [22001][3037] Data truncation: Invalid GIS data provided to function st_polygonfromwkb.

but I can validate with online resources that WKB is valid and polygon is valid as well https://tools-utils.com/wkb-to-wkt/

I have looked at MySQL documentation but was not able to find any answer, maybe someone had a similar issue?

Original Geometry that throws error:

POLYGON((-10.502929688 49.610709938,-4.328613282 49.610709938,-4.328613281 54.661403556,-10.502929688 54.661403555,-10.502929688 49.610709938))
6
  • Please edit your question, it is now hard to understand which geometry gives an error with MySQL. Commented May 19, 2022 at 16:48
  • @user30184 Done Commented May 20, 2022 at 4:55
  • Does ST_PolyFromWKB work? Commented May 20, 2022 at 5:30
  • You have written "but this query runs fine", then a query, then "return an error :". Does that query run fine or return an error? Commented May 20, 2022 at 7:38
  • Those are different queries, WKB is not same Commented May 20, 2022 at 13:09

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.