mirror of
https://github.com/MariaDB/server.git
synced 2026-05-10 17:14:30 +02:00
gis-related tests fixes.
merging.
This commit is contained in:
commit
b826c88841
1144 changed files with 76866 additions and 23703 deletions
|
|
@ -258,7 +258,7 @@ fid AsText(EndPoint(g))
|
|||
107 POINT(40 10)
|
||||
SELECT fid, GLength(g) FROM gis_line;
|
||||
fid GLength(g)
|
||||
105 24.14213562373095
|
||||
105 24.142135623731
|
||||
106 40
|
||||
107 30
|
||||
SELECT fid, NumPoints(g) FROM gis_line;
|
||||
|
|
@ -284,7 +284,7 @@ Note 1003 select st_astext(st_startpoint(`test`.`gis_line`.`g`)) AS `AsText(Star
|
|||
SELECT fid, AsText(Centroid(g)) FROM gis_polygon;
|
||||
fid AsText(Centroid(g))
|
||||
108 POINT(15 15)
|
||||
109 POINT(25.416666666666668 25.416666666666668)
|
||||
109 POINT(25.4166666666667 25.4166666666667)
|
||||
110 POINT(20 10)
|
||||
SELECT fid, Area(g) FROM gis_polygon;
|
||||
fid Area(g)
|
||||
|
|
@ -318,8 +318,8 @@ fid IsClosed(g)
|
|||
116 0
|
||||
SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon;
|
||||
fid AsText(Centroid(g))
|
||||
117 POINT(55.58852775304245 17.426536064113982)
|
||||
118 POINT(55.58852775304245 17.426536064113982)
|
||||
117 POINT(55.5885277530424 17.426536064114)
|
||||
118 POINT(55.5885277530424 17.426536064114)
|
||||
119 POINT(2 2)
|
||||
SELECT fid, Area(g) FROM gis_multi_polygon;
|
||||
fid Area(g)
|
||||
|
|
@ -384,10 +384,10 @@ Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
|
|||
Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
|
||||
FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
|
||||
first second w c o e d t i r
|
||||
120 120 1 1 0 1 0 1 1 0
|
||||
120 120 0 0 0 1 0 1 1 0
|
||||
120 121 0 0 1 0 0 0 1 0
|
||||
121 120 0 0 1 0 0 0 1 0
|
||||
121 121 1 1 0 1 0 1 1 0
|
||||
121 121 0 0 0 1 0 1 1 0
|
||||
explain extended SELECT g1.fid as first, g2.fid as second,
|
||||
Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
|
||||
Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
|
||||
|
|
@ -395,9 +395,9 @@ Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
|
|||
FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE g1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort
|
||||
1 SIMPLE g2 ALL NULL NULL NULL NULL 2 100.00 Using join buffer (BNL, regular buffers)
|
||||
1 SIMPLE g2 ALL NULL NULL NULL NULL 2 100.00 Using join buffer (flat, BNL join)
|
||||
Warnings:
|
||||
Note 1003 select `test`.`g1`.`fid` AS `first`,`test`.`g2`.`fid` AS `second`,mbrwithin(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `w`,mbrcontains(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `c`,mbroverlaps(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `o`,mbrequals(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `e`,mbrdisjoint(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `d`,st_touches(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `t`,mbrintersects(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `i`,st_crosses(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `r` from `test`.`gis_geometrycollection` `g1` join `test`.`gis_geometrycollection` `g2` order by `test`.`g1`.`fid`,`test`.`g2`.`fid`
|
||||
Note 1003 select `test`.`g1`.`fid` AS `first`,`test`.`g2`.`fid` AS `second`,st_within(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `w`,st_contains(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `c`,mbroverlaps(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `o`,mbrequals(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `e`,mbrdisjoint(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `d`,st_touches(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `t`,mbrintersects(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `i`,st_crosses(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `r` from `test`.`gis_geometrycollection` `g1` join `test`.`gis_geometrycollection` `g2` order by `test`.`g1`.`fid`,`test`.`g2`.`fid`
|
||||
DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
|
||||
CREATE TABLE t1 (
|
||||
gp point,
|
||||
|
|
@ -651,11 +651,11 @@ insert into t1 values ('85984',GeomFromText('MULTIPOLYGON(((-115.006363
|
|||
select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from
|
||||
t1 where object_id=85998;
|
||||
object_id geometrytype(geo) ISSIMPLE(GEO) ASTEXT(centroid(geo))
|
||||
85998 MULTIPOLYGON 1 POINT(115.31877315203187 -36.23747282102153)
|
||||
85998 MULTIPOLYGON 1 POINT(115.318773152032 -36.2374728210215)
|
||||
select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from
|
||||
t1 where object_id=85984;
|
||||
object_id geometrytype(geo) ISSIMPLE(GEO) ASTEXT(centroid(geo))
|
||||
85984 MULTIPOLYGON 1 POINT(-114.87787186923313 36.33101763469059)
|
||||
85984 MULTIPOLYGON 1 POINT(-114.877871869233 36.3310176346905)
|
||||
drop table t1;
|
||||
create table t1 (fl geometry not null);
|
||||
insert into t1 values (1);
|
||||
|
|
@ -802,17 +802,6 @@ create table t1 (g geometry not null);
|
|||
insert into t1 values(default);
|
||||
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (a GEOMETRY);
|
||||
CREATE VIEW v1 AS SELECT GeomFromwkb(ASBINARY(a)) FROM t1;
|
||||
CREATE VIEW v2 AS SELECT a FROM t1;
|
||||
DESCRIBE v1;
|
||||
Field Type Null Key Default Extra
|
||||
GeomFromwkb(ASBINARY(a)) geometry YES NULL
|
||||
DESCRIBE v2;
|
||||
Field Type Null Key Default Extra
|
||||
a geometry YES NULL
|
||||
DROP VIEW v1,v2;
|
||||
DROP TABLE t1;
|
||||
create table t1 (name VARCHAR(100), square GEOMETRY);
|
||||
INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))'));
|
||||
INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))'));
|
||||
|
|
@ -852,7 +841,6 @@ mbrwithin
|
|||
big,center
|
||||
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS contains FROM t1 a1 JOIN t1 a2 ON Contains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
|
||||
contains
|
||||
center,small
|
||||
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS disjoint FROM t1 a1 JOIN t1 a2 ON Disjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
|
||||
disjoint
|
||||
down3,left3,right3,up3
|
||||
|
|
@ -870,7 +858,6 @@ touches
|
|||
down2,left2,right2,up2
|
||||
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within FROM t1 a1 JOIN t1 a2 ON Within( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
|
||||
within
|
||||
big,center
|
||||
SET @vert1 = GeomFromText('POLYGON ((0 -2, 0 2, 0 -2))');
|
||||
SET @horiz1 = GeomFromText('POLYGON ((-2 0, 2 0, -2 0))');
|
||||
SET @horiz2 = GeomFromText('POLYGON ((-1 0, 3 0, -1 0))');
|
||||
|
|
@ -960,6 +947,18 @@ COUNT(*)
|
|||
2
|
||||
DROP TABLE t1, t2;
|
||||
End of 5.0 tests
|
||||
#
|
||||
# Test for bug #58650 "Failing assertion: primary_key_no == -1 ||
|
||||
# primary_key_no == 0".
|
||||
#
|
||||
drop table if exists t1;
|
||||
# The minimal test case.
|
||||
create table t1 (a int not null, b linestring not null, unique key b (b(12)), unique key a (a));
|
||||
drop table t1;
|
||||
# The original test case.
|
||||
create table t1 (a int not null, b linestring not null, unique key b (b(12)));
|
||||
create unique index a on t1(a);
|
||||
drop table t1;
|
||||
create table `t1` (`col002` point)engine=myisam;
|
||||
insert into t1 values (),(),();
|
||||
select min(`col002`) from t1 union select `col002` from t1;
|
||||
|
|
@ -1014,6 +1013,22 @@ SET @a=0x00000000030000000100000000000000000000000000144000000000000014400000000
|
|||
SET @a=POLYFROMWKB(@a);
|
||||
SET @a=0x00000000030000000000000000000000000000000000144000000000000014400000000000001840000000000000184000000000000014400000000000001440;
|
||||
SET @a=POLYFROMWKB(@a);
|
||||
create table t1(a polygon NOT NULL)engine=myisam;
|
||||
insert into t1 values (geomfromtext("point(0 1)"));
|
||||
insert into t1 values (geomfromtext("point(1 0)"));
|
||||
select * from (select polygon(t1.a) as p from t1 order by t1.a) d;
|
||||
p
|
||||
NULL
|
||||
NULL
|
||||
drop table t1;
|
||||
#
|
||||
# Test for bug #59888 "debug assertion when attempt to create spatial index
|
||||
# on char > 31 bytes".
|
||||
#
|
||||
create table t1(a char(32) not null) engine=myisam;
|
||||
create spatial index i on t1 (a);
|
||||
ERROR 42000: A SPATIAL index may only contain a geometrical type column
|
||||
drop table t1;
|
||||
End of 5.1 tests
|
||||
CREATE TABLE t1(
|
||||
col0 BINARY NOT NULL,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue