ST_ExteriorRing(poly)

Returns the exterior ring of the Polygon value poly as a LineString. If
the argument is NULL or an empty geometry, the return value is NULL.

URL: https://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html

