order they appear in the expression. If the expression contains any polygons with inner rings, an ER_WRONG_PARAMETERS_TO_STORED_FCT  error occurs. 

•If the expression to cast is a well-formed geometry of type GeometryCollection  containing only linestrings, the function result is a MultiLineString  containing those linestrings. If the expression is empty or contains other geometry types, an ER_INVALID_CAST_TO_GEOMETRY  error occurs. 

•If the expression to cast is a well-formed geometry of type other than LineString , Polygon , MultiLineString , MultiPolygon , or GeometryCollection , an ER_INVALID_CAST_TO_GEOMETRY  error occurs. 

## Conditions for Casts to MultiPolygon 

These conditions apply when the cast result type is MultiPolygon : 

•If the expression to cast is a well-formed geometry of type Polygon , the function result is a MultiPolygon  containing the Polygon  as its sole element. 

•If the expression to cast is a well-formed geometry of type MultiLineString  where all elements are rings, the function result is a MultiPolygon  containing a Polygon  with only an outer ring for each element of the expression. If any element is not a ring, an ER_INVALID_CAST_TO_GEOMETRY 

