Dear GeoTools developers,
I'm new to your project but have been using GeoServer happily for
several years.
I tried a recent upgrade to MySQL 8.0 and discovered that the MySQL team
have made some non-backwards compatible changes which have broken
GeoTools. That's a shame since MySQL 8 has been around since April 2018
and it would be great to have GeoTools compatible with it.
I know from an earlier thread that there are two distinct problems. The
harder problem is that MySQL have changed how they handle geography and
SRIDs, and they have changed the order of the co-ordinates in a
SRID-dependent way.
But there is also an easier problem, which is that they have switched
off the functions "AsWKB" and "Envelope" and replaced them with
"ST_AsBinary" and "ST_Envelope". I know that GeoTools developers tried
to be ready for this change, but missed a couple of instances.
I'm not a Java developer myself, but it looks like the problem is
concentrated in one file:
geotools-24.0\modules\plugin\jdbc\jdbc-mysql\src\main\java\org\geotools\data\mysql\MySQLDialect.java
Around line 228 where the existing code
sql.append("asWKB(");
needs to be replaced with code like
if (usePreciseSpatialOps) {
sql.append("ST_AsBinary(");
} else {
sql.append("asWKB(");
}
And lines 234-5 could change from
sql.append("asWKB(");
sql.append("envelope(");
to something like
if (usePreciseSpatialOps) {
sql.append("ST_AsBinary(");
sql.append("ST_Envelope(");
} else {
sql.append("asWKB(");
sql.append("envelope(");
}
Is it possible for someone to make the easy change and release a new
version of GeoTools? That would let GeoServer partially operate with
MySQL 8.0, and cure the current show-stopping bug. I understand that the
SRID changes are harder, but not everyone is dependent on that fix. It
would be great to get the simple bug out of the way.
Many thanks for reading this far,
Best wishes,
Martin
Martin Baxter
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel