ST_MakeEnvelope(pt1, pt2)

Returns the rectangle that forms the envelope around two points, as a
Point, LineString, or Polygon. If any argument is NULL, the return
value is NULL.

Calculations are done using the Cartesian coordinate system rather than
on a sphere, spheroid, or on earth.

Given two points pt1 and pt2, ST_MakeEnvelope() creates the result
geometry on an abstract plane like this:

o If pt1 and pt2 are equal, the result is the point pt1.

o Otherwise, if (pt1, pt2) is a vertical or horizontal line segment,
  the result is the line segment (pt1, pt2).

o Otherwise, the result is a polygon using pt1 and pt2 as diagonal
  points.

The result geometry has an SRID of 0.

ST_MakeEnvelope() requires Point geometry arguments with an SRID of 0.
An ER_WRONG_ARGUMENTS
(https://dev.mysql.com/doc/mysql-errors/5.7/en/server-error-reference.h
tml#error_er_wrong_arguments) error occurs otherwise.

If any argument is not a syntactically well-formed geometry byte
string, or if any coordinate value of the two points is infinite or
NaN, an ER_GIS_INVALID_DATA
(https://dev.mysql.com/doc/mysql-errors/5.7/en/server-error-reference.h
tml#error_er_gis_invalid_data) error occurs.

URL: https://dev.mysql.com/doc/refman/5.7/en/spatial-convenience-functions.html

