Commit c709993b authored by unknown's avatar unknown

GEOMCOLLFROMWKB(), GEOMETRYCOLLECTIONFROMWKB(),

LINEFROMWKB(), LINESTRINGFROMWKB(), MLINEFROMWKB(), MPOINTFROMWKB(),
MPOLYFROMWKB(), MULTILINESTRINGFROMWKB(), MULTIPOINTFROMWKB(),
MULTIPOLYGONFROMWKB(), POINTFROMWKB(), POLYFROMWKB(), POLYGONFROMWKB()
functions have been added (as synonyms for GEOMFROMWKB()).


mysql-test/t/gis.test:
  GEOMCOLLFROMWKB(), GEOMETRYCOLLECTIONFROMWKB(),
  LINEFROMWKB(), LINESTRINGFROMWKB(), MLINEFROMWKB(), MPOINTFROMWKB(),
  MPOLYFROMWKB(), MULTILINESTRINGFROMWKB(), MULTIPOINTFROMWKB(),
  MULTIPOLYGONFROMWKB(), POINTFROMWKB(), POLYFROMWKB(), POLYGONFROMWKB()
  functions have been added (as synonyms for GEOMFROMWKB()).
sql/lex.h:
  GEOMCOLLFROMWKB(), GEOMETRYCOLLECTIONFROMWKB(),
  LINEFROMWKB(), LINESTRINGFROMWKB(), MLINEFROMWKB(), MPOINTFROMWKB(),
  MPOLYFROMWKB(), MULTILINESTRINGFROMWKB(), MULTIPOINTFROMWKB(),
  MULTIPOLYGONFROMWKB(), POINTFROMWKB(), POLYFROMWKB(), POLYGONFROMWKB()
  functions have been added (as synonyms for GEOMFROMWKB()).
parent 4b06bc84
...@@ -47,23 +47,23 @@ INSERT INTO pt VALUES ...@@ -47,23 +47,23 @@ INSERT INTO pt VALUES
INSERT INTO ls VALUES INSERT INTO ls VALUES
(105, LineFromText('LINESTRING(0 0,0 10,10 0)')), (105, LineFromText('LINESTRING(0 0,0 10,10 0)')),
(106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')), (106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')),
(107, GeometryFromWKB(LineString(Point(10, 10), Point(40, 10)))); (107, LineStringFromWKB(LineString(Point(10, 10), Point(40, 10))));
INSERT INTO p VALUES INSERT INTO p VALUES
(108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')), (108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')),
(109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')), (109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')),
(110, GeometryFromWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0))))); (110, PolyFromWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))));
INSERT INTO mpt VALUES INSERT INTO mpt VALUES
(111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')), (111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')),
(112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')), (112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')),
(113, GeometryFromWKB(MultiPoint(Point(3, 6), Point(4, 10)))); (113, MPointFromWKB(MultiPoint(Point(3, 6), Point(4, 10))));
INSERT INTO mls VALUES INSERT INTO mls VALUES
(114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')), (114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')),
(115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')), (115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')),
(116, GeometryFromWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7))))); (116, MLineFromWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))));
INSERT INTO mp VALUES INSERT INTO mp VALUES
(117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), (117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
(118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), (118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
(119, GeometryFromWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3)))))); (119, MPolyFromWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))));
INSERT INTO gc VALUES INSERT INTO gc VALUES
(120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')), (120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')),
(121, GeometryFromWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9))))); (121, GeometryFromWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))));
......
...@@ -34,28 +34,28 @@ INSERT INTO pt VALUES ...@@ -34,28 +34,28 @@ INSERT INTO pt VALUES
INSERT INTO ls VALUES INSERT INTO ls VALUES
(105, LineFromText('LINESTRING(0 0,0 10,10 0)')), (105, LineFromText('LINESTRING(0 0,0 10,10 0)')),
(106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')), (106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')),
(107, GeometryFromWKB(LineString(Point(10, 10), Point(40, 10)))); (107, LineStringFromWKB(LineString(Point(10, 10), Point(40, 10))));
INSERT INTO p VALUES INSERT INTO p VALUES
(108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')), (108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')),
(109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')), (109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')),
(110, GeometryFromWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0))))); (110, PolyFromWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))));
INSERT INTO mpt VALUES INSERT INTO mpt VALUES
(111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')), (111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')),
(112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')), (112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')),
(113, GeometryFromWKB(MultiPoint(Point(3, 6), Point(4, 10)))); (113, MPointFromWKB(MultiPoint(Point(3, 6), Point(4, 10))));
INSERT INTO mls VALUES INSERT INTO mls VALUES
(114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')), (114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')),
(115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')), (115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')),
(116, GeometryFromWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7))))); (116, MLineFromWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))));
INSERT INTO mp VALUES INSERT INTO mp VALUES
(117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), (117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
(118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), (118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
(119, GeometryFromWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3)))))); (119, MPolyFromWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))));
INSERT INTO gc VALUES INSERT INTO gc VALUES
(120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')), (120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')),
......
...@@ -494,11 +494,13 @@ static SYMBOL sql_functions[] = { ...@@ -494,11 +494,13 @@ static SYMBOL sql_functions[] = {
{ "GEOMETRYN", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_geometryn)}, { "GEOMETRYN", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_geometryn)},
{ "GEOMETRYTYPE", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_geometry_type)}, { "GEOMETRYTYPE", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_geometry_type)},
{ "GEOMCOLLFROMTEXT", SYM(GEOMCOLLFROMTEXT),0,0}, { "GEOMCOLLFROMTEXT", SYM(GEOMCOLLFROMTEXT),0,0},
{ "GEOMCOLLFROMWKB", SYM(GEOMFROMWKB),0,0},
{ "GEOMETRYCOLLECTIONFROMTEXT",SYM(GEOMCOLLFROMTEXT),0,0}, { "GEOMETRYCOLLECTIONFROMTEXT",SYM(GEOMCOLLFROMTEXT),0,0},
{ "GEOMFROMTEXT", SYM(GEOMFROMTEXT),0,0}, { "GEOMETRYCOLLECTIONFROMWKB",SYM(GEOMFROMWKB),0,0},
{ "GEOMETRYFROMTEXT", SYM(GEOMFROMTEXT),0,0}, { "GEOMETRYFROMTEXT", SYM(GEOMFROMTEXT),0,0},
{ "GEOMFROMWKB", SYM(GEOMFROMWKB),0,0},
{ "GEOMETRYFROMWKB", SYM(GEOMFROMWKB),0,0}, { "GEOMETRYFROMWKB", SYM(GEOMFROMWKB),0,0},
{ "GEOMFROMTEXT", SYM(GEOMFROMTEXT),0,0},
{ "GEOMFROMWKB", SYM(GEOMFROMWKB),0,0},
{ "GLENGTH", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_glength)}, { "GLENGTH", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_glength)},
{ "GREATEST", SYM(GREATEST_SYM),0,0}, { "GREATEST", SYM(GREATEST_SYM),0,0},
{ "GROUP_UNIQUE_USERS", SYM(GROUP_UNIQUE_USERS),0,0}, { "GROUP_UNIQUE_USERS", SYM(GROUP_UNIQUE_USERS),0,0},
...@@ -521,7 +523,9 @@ static SYMBOL sql_functions[] = { ...@@ -521,7 +523,9 @@ static SYMBOL sql_functions[] = {
{ "LENGTH", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_length)}, { "LENGTH", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_length)},
{ "LN", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ln)}, { "LN", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ln)},
{ "LINEFROMTEXT", SYM(LINEFROMTEXT),0,0}, { "LINEFROMTEXT", SYM(LINEFROMTEXT),0,0},
{ "LINEFROMWKB", SYM(GEOMFROMWKB),0,0},
{ "LINESTRINGFROMTEXT",SYM(LINEFROMTEXT),0,0}, { "LINESTRINGFROMTEXT",SYM(LINEFROMTEXT),0,0},
{ "LINESTRINGFROMWKB",SYM(GEOMFROMWKB),0,0},
{ "LOAD_FILE", SYM(FUNC_ARG1),0,CREATE_FUNC(create_load_file)}, { "LOAD_FILE", SYM(FUNC_ARG1),0,CREATE_FUNC(create_load_file)},
{ "LOCATE", SYM(LOCATE),0,0}, { "LOCATE", SYM(LOCATE),0,0},
{ "LOG", SYM(LOG_SYM),0,0}, { "LOG", SYM(LOG_SYM),0,0},
...@@ -544,12 +548,18 @@ static SYMBOL sql_functions[] = { ...@@ -544,12 +548,18 @@ static SYMBOL sql_functions[] = {
{ "MID", SYM(SUBSTRING),0,0}, /* unireg function */ { "MID", SYM(SUBSTRING),0,0}, /* unireg function */
{ "MIN", SYM(MIN_SYM),0,0}, { "MIN", SYM(MIN_SYM),0,0},
{ "MLINEFROMTEXT", SYM(MLINEFROMTEXT),0,0}, { "MLINEFROMTEXT", SYM(MLINEFROMTEXT),0,0},
{ "MLINEFROMWKB", SYM(GEOMFROMWKB),0,0},
{ "MPOINTFROMTEXT", SYM(MPOINTFROMTEXT),0,0}, { "MPOINTFROMTEXT", SYM(MPOINTFROMTEXT),0,0},
{ "MPOINTFROMWKB", SYM(GEOMFROMWKB),0,0},
{ "MPOLYFROMTEXT", SYM(MPOLYFROMTEXT),0,0}, { "MPOLYFROMTEXT", SYM(MPOLYFROMTEXT),0,0},
{ "MPOLYFROMWKB", SYM(GEOMFROMWKB),0,0},
{ "MONTHNAME", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_monthname)}, { "MONTHNAME", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_monthname)},
{ "MULTILINESTRINGFROMTEXT",SYM(MLINEFROMTEXT),0,0}, { "MULTILINESTRINGFROMTEXT",SYM(MLINEFROMTEXT),0,0},
{ "MULTILINESTRINGFROMWKB",SYM(GEOMFROMWKB),0,0},
{ "MULTIPOINTFROMTEXT",SYM(MPOINTFROMTEXT),0,0}, { "MULTIPOINTFROMTEXT",SYM(MPOINTFROMTEXT),0,0},
{ "MULTIPOINTFROMWKB",SYM(GEOMFROMWKB),0,0},
{ "MULTIPOLYGONFROMTEXT",SYM(MPOLYFROMTEXT),0,0}, { "MULTIPOLYGONFROMTEXT",SYM(MPOLYFROMTEXT),0,0},
{ "MULTIPOLYGONFROMWKB",SYM(GEOMFROMWKB),0,0},
{ "NOW", SYM(NOW_SYM),0,0}, { "NOW", SYM(NOW_SYM),0,0},
{ "NULLIF", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_nullif)}, { "NULLIF", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_nullif)},
{ "NUMGEOMETRIES", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_numgeometries)}, { "NUMGEOMETRIES", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_numgeometries)},
...@@ -564,9 +574,12 @@ static SYMBOL sql_functions[] = { ...@@ -564,9 +574,12 @@ static SYMBOL sql_functions[] = {
{ "PERIOD_DIFF", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_period_diff)}, { "PERIOD_DIFF", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_period_diff)},
{ "PI", SYM(FUNC_ARG0),0,CREATE_FUNC(create_func_pi)}, { "PI", SYM(FUNC_ARG0),0,CREATE_FUNC(create_func_pi)},
{ "POINTFROMTEXT", SYM(POINTFROMTEXT),0,0}, { "POINTFROMTEXT", SYM(POINTFROMTEXT),0,0},
{ "POINTFROMWKB", SYM(GEOMFROMWKB),0,0},
{ "POINTN", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_pointn)}, { "POINTN", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_pointn)},
{ "POLYFROMTEXT", SYM(POLYFROMTEXT),0,0}, { "POLYFROMTEXT", SYM(POLYFROMTEXT),0,0},
{ "POLYFROMWKB", SYM(GEOMFROMWKB),0,0},
{ "POLYGONFROMTEXT", SYM(POLYFROMTEXT),0,0}, { "POLYGONFROMTEXT", SYM(POLYFROMTEXT),0,0},
{ "POLYGONFROMWKB", SYM(GEOMFROMWKB),0,0},
{ "POSITION", SYM(POSITION_SYM),0,0}, { "POSITION", SYM(POSITION_SYM),0,0},
{ "POW", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_pow)}, { "POW", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_pow)},
{ "POWER", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_pow)}, { "POWER", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_pow)},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment