ST_AsBinary(g), ST_AsWKB(g)

Converts a value in internal geometry format to its WKB representation
and returns the binary result.

If the argument is NULL, the return value is NULL. If the argument is
not a syntactically well-formed geometry, an ER_GIS_INVALID_DATA
(https://dev.mysql.com/doc/mysql-errors/5.7/en/server-error-reference.html
#error_er_gis_invalid_data) error occurs.

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

