ST_Buffer(g, d [, strategy1 [, strategy2 [, strategy3]]])

Returns a geometry that represents all points whose distance from the
geometry value g is less than or equal to a distance of d. The result
is in the same SRS as the geometry argument.

If the geometry argument is empty, ST_Buffer() returns an empty
geometry.

If the distance is 0, ST_Buffer() returns the geometry argument
unchanged:

mysql> SET @pt = ST_GeomFromText('POINT(0 0)');
mysql> SELECT ST_AsText(ST_Buffer(@pt, 0));
+------------------------------+
| ST_AsText(ST_Buffer(@pt, 0)) |
+------------------------------+
| POINT(0 0)                   |
+------------------------------+

If the geometry argument is in a Cartesian SRS:

o ST_Buffer() supports negative distances for Polygon and MultiPolygon
  values, and for geometry collections containing Polygon or
  MultiPolygon values.

o If the result is reduced so much that it disappears, the result is an
  empty geometry.

o An ER_WRONG_ARGUMENTS
  (https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference
  .html#error_er_wrong_arguments) error occurs for ST_Buffer() with a
  negative distance for Point, MultiPoint, LineString, and
  MultiLineString values, and for geometry collections not containing
  any Polygon or MultiPolygon values.

If the geometry argument is in a geographic SRS:

o Prior to MySQL 8.0.26, an ER_NOT_IMPLEMENTED_FOR_GEOGRAPHIC_SRS
  (https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference
  .html#error_er_not_implemented_for_geographic_srs) error occurs.

o As of MySQL 8.0.26, Point geometries in a geographic SRS are
  permitted. For non-Point geometries, an
  ER_NOT_IMPLEMENTED_FOR_GEOGRAPHIC_SRS
  (https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference
  .html#error_er_not_implemented_for_geographic_srs) error still
  occurs.

For MySQL versions that permit geographic Point geometries:

o If the distance is not negative and no strategies are specified, the
  function returns the geographic buffer of the Point in its SRS. The
  distance argument must be in the SRS distance unit (currently always
  meters).

o If the distance is negative or any strategy (except NULL) is
  specified, an ER_WRONG_ARGUMENTS
  (https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference
  .html#error_er_wrong_arguments) error occurs.

ST_Buffer() permits up to three optional strategy arguments following
the distance argument. Strategies influence buffer computation. These
arguments are byte string values produced by the ST_Buffer_Strategy()
function, to be used for point, join, and end strategies:

o Point strategies apply to Point and MultiPoint geometries. If no
  point strategy is specified, the default is
  ST_Buffer_Strategy('point_circle', 32).

o Join strategies apply to LineString, MultiLineString, Polygon, and
  MultiPolygon geometries. If no join strategy is specified, the
  default is ST_Buffer_Strategy('join_round', 32).

o End strategies apply to LineString and MultiLineString geometries. If
  no end strategy is specified, the default is
  ST_Buffer_Strategy('end_round', 32).

Up to one strategy of each type may be specified, and they may be given
in any order.

If the buffer strategies are invalid, an ER_WRONG_ARGUMENTS
(https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference.html
#error_er_wrong_arguments) error occurs. Strategies are invalid
under any of these circumstances:

o Multiple strategies of a given type (point, join, or end) are
  specified.

o A value that is not a strategy (such as an arbitrary binary string or
  a number) is passed as a strategy.

o A Point strategy is passed and the geometry contains no Point or
  MultiPoint values.

o An end or join strategy is passed and the geometry contains no
  LineString, Polygon, MultiLinestring or MultiPolygon values.

URL: https://dev.mysql.com/doc/refman/8.0/en/spatial-operator-functions.html

