IsClosed(ls)

Returns 1 if the LineString value ls is closed (that is, its
StartPoint() and EndPoint() values are the same) and is simple (does
not pass through the same point more than once). Returns 0 if ls is not
closed, and -1 if it is NULL.

URL: http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html

