Debian Codegraph @

mysql-test/suite/innodb_gis/r/precise.result

raw
1 DROP TABLE IF EXISTS t1;
2 select 1, ST_Intersects(ST_GeomFromText('POLYGON((0 0,20 0,20 20,0 20,0 0))'), ST_GeomFromText('POLYGON((10 10,30 10,30 30,10 30,10 10))'));
3 1 ST_Intersects(ST_GeomFromText('POLYGON((0 0,20 0,20 20,0 20,0 0))'), ST_GeomFromText('POLYGON((10 10,30 10,30 30,10 30,10 10))'))
4 1 1
5 select 0, ST_Intersects(ST_GeomFromText('POLYGON((0 0,20 10,10 30, 0 0))'), ST_GeomFromText('POLYGON((10 40, 40 50, 20 70, 10 40))'));
6 0 ST_Intersects(ST_GeomFromText('POLYGON((0 0,20 10,10 30, 0 0))'), ST_GeomFromText('POLYGON((10 40, 40 50, 20 70, 10 40))'))
7 0 0
8 select 1, ST_Intersects(ST_GeomFromText('POLYGON((0 0,20 10,10 30, 0 0))'), ST_GeomFromText('POINT(10 10)'));
9 1 ST_Intersects(ST_GeomFromText('POLYGON((0 0,20 10,10 30, 0 0))'), ST_GeomFromText('POINT(10 10)'))
10 1 1
11 select 1, ST_Intersects(ST_GeomFromText('POLYGON((0 0,20 10,10 30, 0 0))'), ST_GeomFromText('POLYGON((10 10,30 20,20 40, 10 10))'));
12 1 ST_Intersects(ST_GeomFromText('POLYGON((0 0,20 10,10 30, 0 0))'), ST_GeomFromText('POLYGON((10 10,30 20,20 40, 10 10))'))
13 1 1
14 select 0, ST_Within(ST_GeomFromText('POLYGON((0 0,20 10,10 30, 0 0))'), ST_GeomFromText('POLYGON((10 10,30 20,20 40, 10 10))'));
15 0 ST_Within(ST_GeomFromText('POLYGON((0 0,20 10,10 30, 0 0))'), ST_GeomFromText('POLYGON((10 10,30 20,20 40, 10 10))'))
16 0 0
17 select 1, ST_Within(ST_GeomFromText('POLYGON((1 1,20 10,10 30, 1 1))'), ST_GeomFromText('POLYGON((0 0,30 5,10 40, 0 0))'));
18 1 ST_Within(ST_GeomFromText('POLYGON((1 1,20 10,10 30, 1 1))'), ST_GeomFromText('POLYGON((0 0,30 5,10 40, 0 0))'))
19 1 1
20 create table t1 (g point)engine=innodb;
21 insert into t1 values
22 (ST_GeomFromText('POINT(2 2)')), (ST_GeomFromText('POINT(2 4)')), (ST_GeomFromText('POINT(2 6)')), (ST_GeomFromText('POINT(2 8)')),
23 (ST_GeomFromText('POINT(4 2)')), (ST_GeomFromText('POINT(4 4)')), (ST_GeomFromText('POINT(4 6)')), (ST_GeomFromText('POINT(4 8)')),
24 (ST_GeomFromText('POINT(6 2)')), (ST_GeomFromText('POINT(6 4)')), (ST_GeomFromText('POINT(6 6)')), (ST_GeomFromText('POINT(6 8)')),
25 (ST_GeomFromText('POINT(8 2)')), (ST_GeomFromText('POINT(8 4)')), (ST_GeomFromText('POINT(8 6)')), (ST_GeomFromText('POINT(8 8)'));
26 select ST_astext(g) from t1 where ST_Within(g, ST_GeomFromText('POLYGON((5 1, 7 1, 7 7, 5 7, 3 3, 5 3, 5 1))'));
27 ST_astext(g)
28 POINT(4 4)
29 POINT(6 2)
30 POINT(6 4)
31 POINT(6 6)
32 select 'Contains';
33 Contains
34 Contains
35 select ST_astext(g) from t1 where ST_Contains(ST_GeomFromText('POLYGON((5 1, 7 1, 7 7, 5 7, 3 3, 5 3, 5 1))'), g);
36 ST_astext(g)
37 POINT(4 4)
38 POINT(6 2)
39 POINT(6 4)
40 POINT(6 6)
41 select 'Intersects';
42 Intersects
43 Intersects
44 select ST_astext(g) from t1 where ST_Intersects(ST_GeomFromText('POLYGON((5 1, 7 1, 7 7, 5 7, 3 3, 5 3, 5 1))'), g);
45 ST_astext(g)
46 POINT(4 4)
47 POINT(6 2)
48 POINT(6 4)
49 POINT(6 6)
50 select 'Contains';
51 Contains
52 Contains
53 select ST_astext(g) from t1 where ST_Contains(ST_GeomFromText('POLYGON((5 1, 7 1, 7 7, 5 7, 3 3, 5 3, 5 1))'), g);
54 ST_astext(g)
55 POINT(4 4)
56 POINT(6 2)
57 POINT(6 4)
58 POINT(6 6)
59 select 'Contains2';
60 Contains2
61 Contains2
62 select ST_astext(g) from t1 where ST_Contains(ST_GeomFromText('POLYGON((5 1, 7 1, 7 7, 5 7, 3 3, 5 3, 5 1), (5.01 3.01, 6 5, 9 5, 8 3, 5.01 3.01))'), g);
63 ST_astext(g)
64 POINT(4 4)
65 POINT(6 2)
66 POINT(6 6)
67 DROP TABLE t1;
68 select 0, ST_Within(ST_GeomFromText('LINESTRING(15 15, 50 50, 60 60)'), ST_GeomFromText('POLYGON((10 10,30 20,20 40, 10 10))'));
69 0 ST_Within(ST_GeomFromText('LINESTRING(15 15, 50 50, 60 60)'), ST_GeomFromText('POLYGON((10 10,30 20,20 40, 10 10))'))
70 0 0
71 select 1, ST_Within(ST_GeomFromText('LINESTRING(15 15, 16 16)'), ST_GeomFromText('POLYGON((10 10,30 20,20 40, 10 10))'));
72 1 ST_Within(ST_GeomFromText('LINESTRING(15 15, 16 16)'), ST_GeomFromText('POLYGON((10 10,30 20,20 40, 10 10))'))
73 1 1
74 select 1, ST_Intersects(ST_GeomFromText('LINESTRING(15 15, 50 50)'), ST_GeomFromText('LINESTRING(50 15, 15 50)'));
75 1 ST_Intersects(ST_GeomFromText('LINESTRING(15 15, 50 50)'), ST_GeomFromText('LINESTRING(50 15, 15 50)'))
76 1 1
77 select 1, ST_Intersects(ST_GeomFromText('LINESTRING(15 15, 50 50)'), ST_GeomFromText('LINESTRING(16 16, 51 51)'));
78 1 ST_Intersects(ST_GeomFromText('LINESTRING(15 15, 50 50)'), ST_GeomFromText('LINESTRING(16 16, 51 51)'))
79 1 1
80 select 1, ST_Intersects(ST_GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), ST_GeomFromText('POLYGON((50 5, 55 10, 0 45, 50 5))'));
81 1 ST_Intersects(ST_GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), ST_GeomFromText('POLYGON((50 5, 55 10, 0 45, 50 5))'))
82 1 1
83 select ST_astext(ST_Union(ST_geometryfromtext('point(1 1)'), ST_geometryfromtext('polygon((0 0, 2 0, 1 2, 0 0))')));
84 ST_astext(ST_Union(ST_geometryfromtext('point(1 1)'), ST_geometryfromtext('polygon((0 0, 2 0, 1 2, 0 0))')))
85 POLYGON((0 0,2 0,1 2,0 0))
86 select ST_astext(ST_Intersection(ST_geometryfromtext('point(1 1)'), ST_geometryfromtext('polygon((0 0, 2 0, 1 2, 0 0))')));
87 ST_astext(ST_Intersection(ST_geometryfromtext('point(1 1)'), ST_geometryfromtext('polygon((0 0, 2 0, 1 2, 0 0))')))
88 POINT(1 1)
89 select ST_Intersects(ST_GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), ST_GeomFromText('POLYGON((50 5, 55 10, 0 45, 50 5))'));
90 ST_Intersects(ST_GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), ST_GeomFromText('POLYGON((50 5, 55 10, 0 45, 50 5))'))
91 1
92 select ST_contains(ST_GeomFromText('MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)), ((6 6, 6 11, 11 11, 11 6, 6 6)))'), ST_GeomFromText('POINT(5 10)'));
93 ST_contains(ST_GeomFromText('MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)), ((6 6, 6 11, 11 11, 11 6, 6 6)))'), ST_GeomFromText('POINT(5 10)'))
94 0
95 select ST_Disjoint(ST_GeomFromText('POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))'), ST_GeomFromText('POLYGON((10 10, 10 15, 15 15, 15 10, 10 10))'));
96 ST_Disjoint(ST_GeomFromText('POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))'), ST_GeomFromText('POLYGON((10 10, 10 15, 15 15, 15 10, 10 10))'))
97 1
98 select ST_Disjoint(ST_GeomFromText('POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))'), ST_GeomFromText('POLYGON((10 10, 10 4, 4 4, 4 10, 10 10))'));
99 ST_Disjoint(ST_GeomFromText('POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))'), ST_GeomFromText('POLYGON((10 10, 10 4, 4 4, 4 10, 10 10))'))
100 0
101 select ST_Overlaps(ST_GeomFromText('POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))'), ST_GeomFromText('POLYGON((10 10, 10 4, 4 4, 4 10, 10 10))'));
102 ST_Overlaps(ST_GeomFromText('POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))'), ST_GeomFromText('POLYGON((10 10, 10 4, 4 4, 4 10, 10 10))'))
103 1
104 select ST_Overlaps(ST_GeomFromText('POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))'), ST_GeomFromText('POLYGON((1 1, 1 4, 4 4, 4 1, 1 1))'));
105 ST_Overlaps(ST_GeomFromText('POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))'), ST_GeomFromText('POLYGON((1 1, 1 4, 4 4, 4 1, 1 1))'))
106 0
107 select ST_DISTANCE(ST_geomfromtext('polygon((0 0, 1 2, 2 1, 0 0))'), ST_geomfromtext('polygon((2 2, 3 4, 4 3, 2 2))'));
108 ST_DISTANCE(ST_geomfromtext('polygon((0 0, 1 2, 2 1, 0 0))'), ST_geomfromtext('polygon((2 2, 3 4, 4 3, 2 2))'))
109 0.7071067811865476
110 select ST_DISTANCE(ST_geomfromtext('polygon((0 0, 1 2, 2 1, 0 0))'), ST_geomfromtext('linestring(0 1, 1 0)'));
111 ST_DISTANCE(ST_geomfromtext('polygon((0 0, 1 2, 2 1, 0 0))'), ST_geomfromtext('linestring(0 1, 1 0)'))
112 0
113 select ST_DISTANCE(ST_geomfromtext('polygon((0 0, 3 6, 6 3, 0 0))'), ST_geomfromtext('polygon((2 2, 3 4, 4 3, 2 2))'));
114 ST_DISTANCE(ST_geomfromtext('polygon((0 0, 3 6, 6 3, 0 0))'), ST_geomfromtext('polygon((2 2, 3 4, 4 3, 2 2))'))
115 0
116 select ST_DISTANCE(ST_geomfromtext('polygon((0 0, 3 6, 6 3, 0 0),(2 2, 3 4, 4 3, 2 2))'), ST_geomfromtext('point(3 3)'));
117 ST_DISTANCE(ST_geomfromtext('polygon((0 0, 3 6, 6 3, 0 0),(2 2, 3 4, 4 3, 2 2))'), ST_geomfromtext('point(3 3)'))
118 0.4472135954999579
119 select ST_DISTANCE(ST_geomfromtext('linestring(0 0, 3 6, 6 3, 0 0)'), ST_geomfromtext('polygon((2 2, 3 4, 4 3, 2 2))'));
120 ST_DISTANCE(ST_geomfromtext('linestring(0 0, 3 6, 6 3, 0 0)'), ST_geomfromtext('polygon((2 2, 3 4, 4 3, 2 2))'))
121 0.8944271909999159
122 select ST_astext(ST_Intersection(ST_GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), ST_GeomFromText('POLYGON((50 5, 55 10, 0 45, 50 5))')));
123 ST_astext(ST_Intersection(ST_GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), ST_GeomFromText('POLYGON((50 5, 55 10, 0 45, 50 5))')))
124 POLYGON((21.951219512195124 27.4390243902439,26.470588235294116 23.823529411764707,29.28994082840237 26.36094674556213,23.85542168674699 29.819277108433734,21.951219512195124 27.4390243902439))
125 select ST_astext(ST_Intersection(ST_GeomFromText('LINESTRING(0 0, 50 45, 40 50, 0 0)'), ST_GeomFromText('LINESTRING(50 5, 55 10, 0 45, 50 5)')));
126 ST_astext(ST_Intersection(ST_GeomFromText('LINESTRING(0 0, 50 45, 40 50, 0 0)'), ST_GeomFromText('LINESTRING(50 5, 55 10, 0 45, 50 5)')))
127 MULTIPOINT((26.470588235294116 23.823529411764707),(29.28994082840237 26.36094674556213),(23.85542168674699 29.819277108433734),(21.951219512195124 27.4390243902439))
128 select ST_astext(ST_Intersection(ST_GeomFromText('LINESTRING(0 0, 50 45, 40 50)'), ST_GeomFromText('LINESTRING(50 5, 55 10, 0 45)')));
129 ST_astext(ST_Intersection(ST_GeomFromText('LINESTRING(0 0, 50 45, 40 50)'), ST_GeomFromText('LINESTRING(50 5, 55 10, 0 45)')))
130 POINT(29.28994082840237 26.36094674556213)
131 select ST_astext(ST_Intersection(ST_GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), ST_GeomFromText('POINT(20 20)')));
132 ST_astext(ST_Intersection(ST_GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), ST_GeomFromText('POINT(20 20)')))
133 POINT(20 20)
134 select ST_astext(ST_Intersection(ST_GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), ST_GeomFromText('LINESTRING(-10 -10, 200 200)')));
135 ST_astext(ST_Intersection(ST_GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), ST_GeomFromText('LINESTRING(-10 -10, 200 200)')))
136 LINESTRING(0 0,46.666666666666664 46.666666666666664)
137 select ST_astext(ST_Intersection(ST_GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), ST_GeomFromText('LINESTRING(-10 -10, 200 200, 199 201, -11 -9)')));
138 ST_astext(ST_Intersection(ST_GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), ST_GeomFromText('LINESTRING(-10 -10, 200 200, 199 201, -11 -9)')))
139 GEOMETRYCOLLECTION(LINESTRING(0 0,46.666666666666664 46.666666666666664),LINESTRING(45.333333333333336 47.333333333333336,8 10))
140 select ST_astext(ST_UNION(ST_GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), ST_GeomFromText('LINESTRING(-10 -10, 200 200, 199 201, -11 -9)')));
141 ST_astext(ST_UNION(ST_GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), ST_GeomFromText('LINESTRING(-10 -10, 200 200, 199 201, -11 -9)')))
142 GEOMETRYCOLLECTION(POLYGON((0 0,50 45,40 50,0 0)),LINESTRING(-10 -10,0 0),LINESTRING(46.666666666666664 46.666666666666664,200 200,199 201,45.333333333333336 47.333333333333336),LINESTRING(8 10,-11 -9))
143 select ST_astext(ST_intersection(ST_geomfromtext('polygon((0 0, 1 0, 0 1, 0 0))'), ST_geomfromtext('polygon((0 0, 1 1, 0 2, 0 0))')));
144 ST_astext(ST_intersection(ST_geomfromtext('polygon((0 0, 1 0, 0 1, 0 0))'), ST_geomfromtext('polygon((0 0, 1 1, 0 2, 0 0))')))
145 POLYGON((0 1,0 0,0.5 0.5,0 1))
146 select ST_astext(ST_symdifference(ST_geomfromtext('polygon((0 0, 1 0, 0 1, 0 0))'), ST_geomfromtext('polygon((0 0, 1 1, 0 2, 0 0))')));
147 ST_astext(ST_symdifference(ST_geomfromtext('polygon((0 0, 1 0, 0 1, 0 0))'), ST_geomfromtext('polygon((0 0, 1 1, 0 2, 0 0))')))
148 MULTIPOLYGON(((0.5 0.5,0 0,1 0,0.5 0.5)),((0.5 0.5,1 1,0 2,0 1,0.5 0.5)))
149 select ST_astext(ST_UNION(ST_GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), ST_GeomFromText('LINESTRING(-10 -10, 200 200, 199 201, -11 -9)')));
150 ST_astext(ST_UNION(ST_GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), ST_GeomFromText('LINESTRING(-10 -10, 200 200, 199 201, -11 -9)')))
151 GEOMETRYCOLLECTION(POLYGON((0 0,50 45,40 50,0 0)),LINESTRING(-10 -10,0 0),LINESTRING(46.666666666666664 46.666666666666664,200 200,199 201,45.333333333333336 47.333333333333336),LINESTRING(8 10,-11 -9))
152 select ST_astext(ST_buffer(ST_geometryfromtext('point(1 1)'), 1));
153 ST_astext(ST_buffer(ST_geometryfromtext('point(1 1)'), 1))
154 POLYGON((2 1,1.98078528040323 1.19509032201612,1.92387953251129 1.38268343236509,1.83146961230255 1.5555702330196,1.70710678118655 1.70710678118655,1.5555702330196 1.83146961230254,1.38268343236509 1.92387953251129,1.19509032201613 1.98078528040323,1 2,0.80490967798387 1.98078528040323,0.61731656763491 1.92387953251129,0.4444297669804 1.83146961230255,0.29289321881345 1.70710678118655,0.16853038769746 1.5555702330196,0.07612046748871 1.38268343236509,0.01921471959677 1.19509032201613,0 1,0.01921471959677 0.80490967798387,0.07612046748871 0.61731656763491,0.16853038769745 0.4444297669804,0.29289321881345 0.29289321881345,0.4444297669804 0.16853038769745,0.61731656763491 0.07612046748871,0.80490967798387 0.01921471959677,1 0,1.19509032201613 0.01921471959677,1.38268343236509 0.07612046748871,1.5555702330196 0.16853038769745,1.70710678118655 0.29289321881345,1.83146961230255 0.4444297669804,1.92387953251129 0.61731656763491,1.98078528040323 0.80490967798387,2 1))
155 create table t1(geom geometrycollection)engine=innodb;
156 insert into t1 values (ST_geomfromtext('POLYGON((0 0, 10 10, 0 8, 0 0))'));
157 ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
158 insert into t1 values (ST_geomfromtext('POLYGON((1 1, 10 10, 0 8, 1 1))'));
159 ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
160 select ST_astext(geom), ST_area(geom),ST_area(ST_buffer(geom,2)) from t1;
161 ST_astext(geom) ST_area(geom) ST_area(ST_buffer(geom,2))
162 select ST_NUMPOINTS(ST_EXTERIORRING(ST_buffer(geom,2))) from t1;
163 ST_NUMPOINTS(ST_EXTERIORRING(ST_buffer(geom,2)))
164 set @geom=ST_geomfromtext('LINESTRING(2 1, 4 2, 2 3, 2 5)');
165 set @buff=ST_buffer(@geom,1);
166 select ST_NUMPOINTS(ST_EXTERIORRING(@buff)) from t1;
167 ST_NUMPOINTS(ST_EXTERIORRING(@buff))
168 DROP TABLE t1;
169 select st_touches(ST_geomfromtext('point(0 0)'), ST_geomfromtext('point(1 1)'));
170 st_touches(ST_geomfromtext('point(0 0)'), ST_geomfromtext('point(1 1)'))
171 NULL
172 select st_touches(ST_geomfromtext('point(1 1)'), ST_geomfromtext('point(1 1)'));
173 st_touches(ST_geomfromtext('point(1 1)'), ST_geomfromtext('point(1 1)'))
174 NULL
175 select st_touches(ST_geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), ST_geomfromtext('point(1 1)'));
176 st_touches(ST_geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), ST_geomfromtext('point(1 1)'))
177 1
178 select st_touches(ST_geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), ST_geomfromtext('point(1 0)'));
179 st_touches(ST_geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), ST_geomfromtext('point(1 0)'))
180 0
181 select st_touches(ST_geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), ST_geomfromtext('point(1 2)'));
182 st_touches(ST_geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), ST_geomfromtext('point(1 2)'))
183 0
184 select st_touches(ST_geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), ST_geomfromtext('polygon((1 1.2, 1 0, 2 0, 1 1.2))'));
185 st_touches(ST_geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), ST_geomfromtext('polygon((1 1.2, 1 0, 2 0, 1 1.2))'))
186 0
187 select st_touches(ST_geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), ST_geomfromtext('polygon((1 1, 1 0, 2 0, 1 1))'));
188 st_touches(ST_geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), ST_geomfromtext('polygon((1 1, 1 0, 2 0, 1 1))'))
189 1
190 SELECT ST_Equals(ST_PolyFromText('POLYGON((67 13, 67 18, 67 18, 59 18, 59 13, 67 13) )'),ST_PolyFromText('POLYGON((67 13, 67 18, 59 19, 59 13, 59 13, 67 13) )')) as result;
191 result
192 0
193 SELECT ST_Equals(ST_PolyFromText('POLYGON((67 13, 67 18, 67 18, 59 18, 59 13, 67 13) )'),ST_PolyFromText('POLYGON((67 13, 67 18, 59 18, 59 13, 59 13, 67 13) )')) as result;
194 result
195 1
196 SELECT ST_Equals(ST_PointFromText('POINT (12 13)'),ST_PointFromText('POINT (12 13)')) as result;
197 result
198 1
199 #
200 # BUG#11755628/47429: INTERSECTION FUNCTION CRASHED MYSQLD
201 # BUG#11759650/51979: UNION/INTERSECTION OF POLYGONS CRASHES MYSQL
202 #
203 # Invalid geometry in input.
204 DO ST_ASTEXT(ST_UNION(ST_GEOMFROMTEXT('POLYGON((525000 183300,525400
205 183300,525400 18370, 525000 183700,525000 183300))'),
206 ST_geomfromtext('POLYGON((525298.67 183511.53,525296.57
207 183510.39,525296.42 183510.31,525289.11 183506.62,525283.17
208 183503.47,525280.98 183502.26,525278.63 183500.97,525278.39
209 183500.84,525276.79 183500,525260.7 183491.55,525263.95
210 183484.75,525265.58 183481.95,525278.97 183488.73,525276.5
211 183493.45,525275.5 183495.7,525280.35 183498.2,525282.3
212 183499.1,525282.2 183499.3,525283.55 183500,525301.75
213 183509.35,525304.45 183504.25,525307.85 183504.95,525304.5
214 183510.83,525302.81 183513.8,525298.67 183511.53),(525275.06
215 183489.89,525272.06 183488.37,525268.94 183494.51,525271.94
216 183496.03,525275.06 183489.89),(525263.26 183491.55,525266.15
217 183493.04,525269.88 183485.82,525266.99 183484.33,525263.26
218 183491.55))'))) st_u;
219 SET @a=0x0000000001030000000200000005000000000000000000000000000000000000000000000000002440000000000000000000000000000024400000000000002440000000000000000000000000000024400000000000000000000000000000000000000000000000000000F03F000000000000F03F0000000000000040000000000000F03F00000000000000400000000000000040000000000000F03F0000000000000040000000000000F03F000000000000F03F;
220 SELECT ST_ASTEXT(ST_TOUCHES(@a, ST_GEOMFROMTEXT('point(0 0)'))) t;
221 ERROR 22023: Invalid GIS data provided to function st_touches.
222 DROP TABLE IF EXISTS p1;
223 CREATE PROCEDURE p1(dist DOUBLE, geom TEXT)
224 BEGIN
225 DECLARE g GEOMETRY;
226 SET g=ST_GeomFromText(geom);
227 SELECT geom AS `-----`;
228 SELECT dist, ST_GeometryType(@buf:=ST_Buffer(g, dist)) AS `buffer`, ROUND(ST_AREA(@buf),2) AS buf_area;
229 END|
230 Warnings:
231 Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'.
232 #
233 # Testing ST_BUFFER with positive distance
234 #
235 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
236 -----
237 POINT(0 0)
238 dist buffer buf_area
239 1 POLYGON 3.12
240 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
241 -----
242 LineString(0 1, 1 1)
243 dist buffer buf_area
244 1 POLYGON 5.12
245 -----
246 LineString(9 9,8 1,1 5,0 0)
247 dist buffer buf_area
248 1 POLYGON 44.6
249 -----
250 Polygon((2 2,2 8,8 8,8 2,2 2))
251 dist buffer buf_area
252 1 POLYGON 63.12
253 -----
254 Polygon((0 0,0 8,8 8,8 0,0 0),(2 2,6 2,6 6,2 6,2 2))
255 dist buffer buf_area
256 1 POLYGON 95.12
257 -----
258 Polygon((0 0, 0 8, 8 8, 8 10, -10 10, -10 0, 0 0))
259 dist buffer buf_area
260 1 POLYGON 174.9
261 -----
262 MultiPoint(9 9,8 1,1 5)
263 dist buffer buf_area
264 1 MULTIPOLYGON 9.36
265 -----
266 MultiLineString((0 0,2 2))
267 dist buffer buf_area
268 1 POLYGON 8.78
269 -----
270 MultiLineString((0 0,2 2,0 4))
271 dist buffer buf_area
272 1 POLYGON 14.22
273 -----
274 MultiLineString((0 0,2 2),(0 2,2 0))
275 dist buffer buf_area
276 1 POLYGON 13.56
277 -----
278 MultiLineString((2 2,2 8,-2 8),(-6 -6, 6 6),(10 10, 14 14))
279 dist buffer buf_area
280 1 MULTIPOLYGON 70.01
281 -----
282 MultiLineString((0 0,0 1),(3 0,3 1))
283 dist buffer buf_area
284 1 MULTIPOLYGON 10.24
285 # Invalid geometry in input
286 -----
287 MultiPolygon(((2 2,2 8,8 8,8 2,2 2)), ((9 9,8 1,1 5,9 9)))
288 dist buffer buf_area
289 1 POLYGON 73.16
290 # Invalid geometry in input
291 -----
292 MultiPolygon(((2 2,2 8,8 8,8 2,2 2), (4 4,4 6,6 6,6 4,4 4)),((9 9,8 1,1 5,9 9)))
293 dist buffer buf_area
294 1 POLYGON 73.16
295 -----
296 GeometryCollection(Point(0 0))
297 dist buffer buf_area
298 1 POLYGON 3.12
299 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
300 -----
301 GeometryCollection(LineString(0 0, 2 2))
302 dist buffer buf_area
303 1 POLYGON 8.78
304 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
305 -----
306 GeometryCollection(Polygon((2 2,2 8,8 8,8 2,2 2)))
307 dist buffer buf_area
308 1 POLYGON 63.12
309 -----
310 GeometryCollection(MultiPoint(9 9,8 1,1 5))
311 dist buffer buf_area
312 1 MULTIPOLYGON 9.36
313 -----
314 GeometryCollection(MultiLineString((0 0,0 1),(3 0,3 1)))
315 dist buffer buf_area
316 1 MULTIPOLYGON 10.24
317 -----
318 GeometryCollection(MultiPolygon(((0 0, 3 0, 3 3, 0 3, 0 0)),((6 6,6 9,9 9,9 6,6 6))))
319 dist buffer buf_area
320 1 MULTIPOLYGON 48.24
321 -----
322 GeometryCollection(Point(9 9),LineString(1 5,0 0),Polygon((2 2,2 8,8 8,8 2,2 2)))
323 dist buffer buf_area
324 1 POLYGON 75.88
325 #
326 # Testing ST_BUFFER with zero distance
327 #
328 -----
329 Polygon((2 2,2 8,8 8,8 2,2 2))
330 dist buffer buf_area
331 0 POLYGON 36
332 -----
333 Polygon((0 0,0 8,8 8,8 0,0 0),(2 2,6 2,6 6,2 6,2 2))
334 dist buffer buf_area
335 0 POLYGON 48
336 -----
337 Polygon((0 0, 0 8, 8 8, 8 10, -10 10, -10 0, 0 0))
338 dist buffer buf_area
339 0 POLYGON 116
340 # Invalid geometry in input
341 -----
342 MultiPolygon(((2 2,2 8,8 8,8 2,2 2)), ((9 9,8 1,1 5,9 9)))
343 dist buffer buf_area
344 0 MULTIPOLYGON 66
345 # Invalid geometry in input
346 -----
347 MultiPolygon(((2 2,2 8,8 8,8 2,2 2), (4 4,4 6,6 6,6 4,4 4)),((9 9,8 1,1 5,9 9)))
348 dist buffer buf_area
349 0 MULTIPOLYGON 62
350 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
351 #
352 # Testing ST_BUFFER with negative distance
353 #
354 -----
355 POINT(0 0)
356 ERROR HY000: Incorrect arguments to st_buffer
357 -----
358 LineString(0 1, 1 1)
359 ERROR HY000: Incorrect arguments to st_buffer
360 -----
361 LineString(9 9,8 1,1 5,0 0)
362 ERROR HY000: Incorrect arguments to st_buffer
363 -----
364 Polygon((2 2,2 8,8 8,8 2,2 2))
365 dist buffer buf_area
366 -1 POLYGON 16
367 -----
368 Polygon((0 0,0 8,8 8,8 0,0 0),(2 2,6 2,6 6,2 6,2 2))
369 dist buffer buf_area
370 -1 MULTIPOLYGON 0.88
371 -----
372 Polygon((0 0, 0 8, 8 8, 8 10, -10 10, -10 0, 0 0))
373 dist buffer buf_area
374 -1 POLYGON 64.22
375 -----
376 MultiPoint(9 9,8 1,1 5)
377 ERROR HY000: Incorrect arguments to st_buffer
378 -----
379 MultiLineString((0 0,2 2))
380 ERROR HY000: Incorrect arguments to st_buffer
381 -----
382 MultiLineString((0 0,2 2,0 4))
383 ERROR HY000: Incorrect arguments to st_buffer
384 -----
385 MultiLineString((0 0,2 2),(0 2,2 0))
386 ERROR HY000: Incorrect arguments to st_buffer
387 -----
388 MultiLineString((2 2,2 8,-2 8),(-6 -6, 6 6),(10 10, 14 14))
389 ERROR HY000: Incorrect arguments to st_buffer
390 # Invalid geometry in input
391 -----
392 MultiPolygon(((2 2,2 8,8 8,8 2,2 2)), ((9 9,8 1,1 5,9 9)))
393 dist buffer buf_area
394 -1 POLYGON 8
395 # Invalid geometry in input
396 -----
397 MultiPolygon(((2 2,2 8,8 8,8 2,2 2), (4 4,4 6,6 6,6 4,4 4)),((9 9,8 1,1 5,9 9)))
398 dist buffer buf_area
399 -1 MULTIPOLYGON 0.74
400 -----
401 GeometryCollection(Point(0 0))
402 ERROR HY000: Incorrect arguments to st_buffer
403 -----
404 GeometryCollection(LineString(0 0, 2 2))
405 ERROR HY000: Incorrect arguments to st_buffer
406 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
407 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
408 -----
409 GeometryCollection(Polygon((2 2,2 8,8 8,8 2,2 2)))
410 dist buffer buf_area
411 -1 POLYGON 16
412 -----
413 GeometryCollection(MultiPoint(9 9,8 1,1 5))
414 ERROR HY000: Incorrect arguments to st_buffer
415 -----
416 GeometryCollection(MultiLineString((0 0,0 1),(3 0,3 1)))
417 ERROR HY000: Incorrect arguments to st_buffer
418 -----
419 GeometryCollection(Point(9 9),LineString(1 5,0 0),Polygon((2 2,2 8,8 8,8 2,2 2)))
420 ERROR HY000: Incorrect arguments to st_buffer
421 SELECT ST_CONTAINS(
422 ST_GeomFromText('MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)),((6 6, 6 11, 11 11, 11 6, 6 6)))'),
423 ST_GeomFromText('POINT(5 10)'));
424 ST_CONTAINS(
425 ST_GeomFromText('MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)),((6 6, 6 11, 11 11, 11 6, 6 6)))'),
426 ST_GeomFromText('POINT(5 10)'))
427 0
428 SELECT ST_AsText(ST_UNION(
429 ST_GeomFromText('MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)),((6 6, 6 11, 11 11, 11 6, 6 6)))'),
430 ST_GeomFromText('POINT(5 10)')));
431 ST_AsText(ST_UNION(
432 ST_GeomFromText('MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)),((6 6, 6 11, 11 11, 11 6, 6 6)))'),
433 ST_GeomFromText('POINT(5 10)')))
434 GEOMETRYCOLLECTION(POLYGON((0 0,5 0,5 5,0 5,0 0)),POLYGON((6 6,11 6,11 11,6 11,6 6)),POINT(5 10))
435 DROP PROCEDURE p1;
436 #
437 # Bug #13833019 ASSERTION `T1->RESULT_RANGE' FAILED IN GCALC_OPERATION_REDUCER::END_COUPLE
438 #
439 SELECT ST_GeometryType(ST_BUFFER(ST_MULTIPOLYGONFROMTEXT('MULTIPOLYGON(((0 0,9 4,3 3,0 0)),((2 2,2 2,8 8,2 3,2 2)))'), 3));
440 ST_GeometryType(ST_BUFFER(ST_MULTIPOLYGONFROMTEXT('MULTIPOLYGON(((0 0,9 4,3 3,0 0)),((2 2,2 2,8 8,2 3,2 2)))'), 3))
441 POLYGON
442 #
443 # Bug #13832749 HANDLE_FATAL_SIGNAL IN GCALC_FUNCTION::COUNT_INTERNAL
444 #
445 SELECT ST_GeometryType(ST_BUFFER(ST_MULTIPOLYGONFROMTEXT('MULTIPOLYGON(((3 5,2 5,2 4,3 4,3 5)),((2 2,2 8,8 8,8 2,2 2), (4 4,4 6,6 6,6 4,4 4)), ((9 9,8 1,1 5,9 9)))'),1));
446 ST_GeometryType(ST_BUFFER(ST_MULTIPOLYGONFROMTEXT('MULTIPOLYGON(((3 5,2 5,2 4,3 4,3 5)),((2 2,2 8,8 8,8 2,2 2), (4 4,4 6,6 6,6 4,4 4)), ((9 9,8 1,1 5,9 9)))'),1))
447 POLYGON
448 #
449 # Bug#13358363 - ASSERTION: N > 0 && N < SINUSES_CALCULATED*2+1 | GET_N_SINCOS/ADD_EDGE_BUFFER
450 #
451 DO ST_BUFFER(ST_LINEFROMTEXT('linestring(1 1,2 2)'),'');
452 SELECT ST_WITHIN(
453 ST_LINESTRINGFROMTEXT(' LINESTRING(3 8,9 2,3 8,3 3,7 6,4 7,4 7,8 1) '),
454 ST_BUFFER(ST_MULTIPOLYGONFROMTEXT(' MULTIPOLYGON(((3 5,2 5,2 4,3 4,3 5)),((2 2,2 8,8 8,8 2,2 2),(4 4,4 6,6 6,6 4,4 4)),((0 5,3 5,3 2,1 2,1 1,3 1,3 0,0 0,0 3,2 3,2 4,0 4,0 5))) '),
455 ST_NUMINTERIORRINGS(ST_POLYGONFROMTEXT('POLYGON((3 5,2 4,2 5,3 5)) '))));
456 ST_WITHIN(
457 ST_LINESTRINGFROMTEXT(' LINESTRING(3 8,9 2,3 8,3 3,7 6,4 7,4 7,8 1) '),
458 ST_BUFFER(ST_MULTIPOLYGONFROMTEXT(' MULTIPOLYGON(((3 5,2 5,2 4,3 4,3 5)),((2 2,2 8,8 8,8 2,2 2),(4 4,4 6,6 6,6 4,4 4)),((0 5,3 5,3 2,1 2,1 1,3 1,3 0,0 0,0 3,2 3,2 4,0 4,0 5
459 0
460 SELECT ST_DIMENSION(ST_BUFFER(ST_POLYGONFROMTEXT(' POLYGON((3 5,2 5,2 4,3 4,3 5)) '),
461 ST_NUMINTERIORRINGS(ST_POLYGONFROMTEXT(' POLYGON((0 0,9 3,4 2,0 0))'))));
462 ST_DIMENSION(ST_BUFFER(ST_POLYGONFROMTEXT(' POLYGON((3 5,2 5,2 4,3 4,3 5)) '),
463 ST_NUMINTERIORRINGS(ST_POLYGONFROMTEXT(' POLYGON((0 0,9 3,4 2,0 0))'))))
464 2
465 SELECT ST_NUMINTERIORRINGS(
466 ST_ENVELOPE(ST_BUFFER(ST_MULTIPOLYGONFROMTEXT('MULTIPOLYGON(((3 5,2 5,2 4,3 4,3 5))) '),
467 ST_SRID(ST_MULTILINESTRINGFROMTEXT('MULTILINESTRING((2 2,4 2,1 2,2 4,2 2)) ')))));
468 ST_NUMINTERIORRINGS(
469 ST_ENVELOPE(ST_BUFFER(ST_MULTIPOLYGONFROMTEXT('MULTIPOLYGON(((3 5,2 5,2 4,3 4,3 5))) '),
470 ST_SRID(ST_MULTILINESTRINGFROMTEXT('MULTILINESTRING((2 2,4 2,1 2,2 4,2 2)) ')))))
471 0
472 SELECT ST_ASTEXT(ST_BUFFER(ST_POLYGONFROMTEXT(' POLYGON((9 9,5 2,4 5,9 9))'),
473 ST_SRID(ST_GEOMETRYFROMTEXT(' MULTIPOINT(8 4,5 0,7 8,6 9,3 4,7 3,5 5) '))));
474 ST_ASTEXT(ST_BUFFER(ST_POLYGONFROMTEXT(' POLYGON((9 9,5 2,4 5,9 9))'),
475 ST_SRID(ST_GEOMETRYFROMTEXT(' MULTIPOINT(8 4,5 0,7 8,6 9,3 4,7 3,5 5) '))))
476 POLYGON((9 9,5 2,4 5,9 9))
477 #
478 # 18701868 CRASH IN MY_DECIMAL::SANITY_CHECK,
479 # ORDER BY CAST (INVALID GIS FUNCTION RESULT)
480 #
481 CREATE TABLE t1 (a INT) engine=innodb;
482 INSERT INTO t1 VALUES (1);
483 SELECT * FROM t1 ORDER BY cast(st_distance(1,1) as DECIMAL);
484 a
485 1
486 DELETE FROM t1 ORDER BY cast(st_distance(1,1) as DECIMAL);
487 ERROR 22023: Invalid GIS data provided to function st_distance.
488 UPDATE t1 SET a=1 ORDER BY cast(st_distance(1,1) as DECIMAL);
489 ERROR 22023: Invalid GIS data provided to function st_distance.
490 DROP TABLE t1;