From the docs on MariaDB, for ST_LineStringFromText
Constructs a
LINESTRING
value using its WKT representation and SRID.
ST_LineFromText()
,ST_LineStringFromText()
,ST_LineFromText()
andST_LineStringFromText()
are all synonyms.
It seems to be technically incorrect though, for example here we construct a point and a polygon using ST_LineStringFromText()
,
WITH t(geom) AS ( VALUES
(ST_LineStringFromText('POLYGON ((35 10, 45 45, 15 40, 10 20, 35 10),(20 30, 35 35, 30 20, 20 30))')),
(ST_LineStringFromText('POINT( 0 0 )')),
(ST_LineStringFromText('LINESTRING( 0 0, 1 1 )'))
)
SELECT ST_AsText(geom)
FROM t;
Returns..
POLYGON((35 10,45 45,15 40,10 20,35 10),(20 30,35 35,30 20,20 30))
POINT(0 0)
LINESTRING(0 0,1 1)
The Polygon functions are just as confusingly documented,
Constructs a
POLYGON
value using its WKT representation and SRID.
ST_PolyFromText()
,ST_PolygonFromText()
,PolyFromText()
andST_PolygonFromText()
are all synonyms.
Yet you can replace ST_LineStringFromText
with ST_PolyFromText
and they work the same way.
MySQL Behavior
With MySQL 8 you seem to get an error on the above construction,
WKT value is a geometry of unexpected type
POINT
inst_linestringfromtext
.