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 POINT(8 4)
68 DROP TABLE t1;
69 select 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 ST_Within(ST_GeomFromText('LINESTRING(15 15, 50 50, 60 60)'), ST_GeomFromText('POLYGON((10 10,30 20,20 40, 10 10))'))
71 0 0
72 select 1, ST_Within(ST_GeomFromText('LINESTRING(15 15, 16 16)'), ST_GeomFromText('POLYGON((10 10,30 20,20 40, 10 10))'));
73 1 ST_Within(ST_GeomFromText('LINESTRING(15 15, 16 16)'), ST_GeomFromText('POLYGON((10 10,30 20,20 40, 10 10))'))
74 1 1
75 select 1, ST_Intersects(ST_GeomFromText('LINESTRING(15 15, 50 50)'), ST_GeomFromText('LINESTRING(50 15, 15 50)'));
76 1 ST_Intersects(ST_GeomFromText('LINESTRING(15 15, 50 50)'), ST_GeomFromText('LINESTRING(50 15, 15 50)'))
77 1 1
78 select 1, ST_Intersects(ST_GeomFromText('LINESTRING(15 15, 50 50)'), ST_GeomFromText('LINESTRING(16 16, 51 51)'));
79 1 ST_Intersects(ST_GeomFromText('LINESTRING(15 15, 50 50)'), ST_GeomFromText('LINESTRING(16 16, 51 51)'))
80 1 1
81 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))'));
82 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))'))
83 1 1
84 select ST_astext(ST_Union(ST_geometryfromtext('point(1 1)'), ST_geometryfromtext('polygon((0 0, 2 0, 1 2, 0 0))')));
85 ST_astext(ST_Union(ST_geometryfromtext('point(1 1)'), ST_geometryfromtext('polygon((0 0, 2 0, 1 2, 0 0))')))
86 POLYGON((0 0,1 2,2 0,0 0))
87 select ST_astext(ST_Intersection(ST_geometryfromtext('point(1 1)'), ST_geometryfromtext('polygon((0 0, 2 0, 1 2, 0 0))')));
88 ST_astext(ST_Intersection(ST_geometryfromtext('point(1 1)'), ST_geometryfromtext('polygon((0 0, 2 0, 1 2, 0 0))')))
89 POINT(1 1)
90 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))'));
91 ST_Intersects(ST_GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), ST_GeomFromText('POLYGON((50 5, 55 10, 0 45, 50 5))'))
92 1
93 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)'));
94 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)'))
95 0
96 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))'));
97 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))'))
98 1
99 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))'));
100 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))'))
101 0
102 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))'));
103 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))'))
104 1
105 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))'));
106 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))'))
107 0
108 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))'));
109 ST_DISTANCE(ST_geomfromtext('polygon((0 0, 1 2, 2 1, 0 0))'), ST_geomfromtext('polygon((2 2, 3 4, 4 3, 2 2))'))
110 0.7071067811865475
111 select ST_DISTANCE(ST_geomfromtext('polygon((0 0, 1 2, 2 1, 0 0))'), ST_geomfromtext('linestring(0 1, 1 0)'));
112 ST_DISTANCE(ST_geomfromtext('polygon((0 0, 1 2, 2 1, 0 0))'), ST_geomfromtext('linestring(0 1, 1 0)'))
113 0
114 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))'));
115 ST_DISTANCE(ST_geomfromtext('polygon((0 0, 3 6, 6 3, 0 0))'), ST_geomfromtext('polygon((2 2, 3 4, 4 3, 2 2))'))
116 0
117 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)'));
118 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)'))
119 0.4472135954999579
120 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))'));
121 ST_DISTANCE(ST_geomfromtext('linestring(0 0, 3 6, 6 3, 0 0)'), ST_geomfromtext('polygon((2 2, 3 4, 4 3, 2 2))'))
122 0.8944271909999159
123 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))')));
124 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))')))
125 POLYGON((26.47058823529412 23.823529411764707,21.951219512195124 27.439024390243905,23.855421686746986 29.819277108433734,29.289940828402365 26.36094674556213,26.47058823529412 23.823529411764707))
126 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)')));
127 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)')))
128 MULTIPOINT(26.47058823529412 23.823529411764707,29.289940828402365 26.36094674556213,21.951219512195124 27.439024390243905,23.855421686746986 29.819277108433734)
129 select ST_astext(ST_Intersection(ST_GeomFromText('LINESTRING(0 0, 50 45, 40 50)'), ST_GeomFromText('LINESTRING(50 5, 55 10, 0 45)')));
130 ST_astext(ST_Intersection(ST_GeomFromText('LINESTRING(0 0, 50 45, 40 50)'), ST_GeomFromText('LINESTRING(50 5, 55 10, 0 45)')))
131 POINT(29.289940828402365 26.36094674556213)
132 select ST_astext(ST_Intersection(ST_GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), ST_GeomFromText('POINT(20 20)')));
133 ST_astext(ST_Intersection(ST_GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), ST_GeomFromText('POINT(20 20)')))
134 POINT(20 20)
135 select ST_astext(ST_Intersection(ST_GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), ST_GeomFromText('LINESTRING(-10 -10, 200 200)')));
136 ST_astext(ST_Intersection(ST_GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), ST_GeomFromText('LINESTRING(-10 -10, 200 200)')))
137 LINESTRING(0 0,46.666666666666664 46.666666666666664)
138 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)')));
139 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)')))
140 MULTILINESTRING((0 0,46.666666666666664 46.666666666666664),(8 10,45.33333333333333 47.33333333333333))
141 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)')));
142 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)')))
143 GEOMETRYCOLLECTION(LINESTRING(-10 -10,0 0),LINESTRING(-11 -9,8 10),POLYGON((0 0,40 50,50 45,0 0)),LINESTRING(46.666666666666664 46.666666666666664,200 200,199 201,45.33333333333333 47.33333333333333))
144 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))')));
145 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))')))
146 POLYGON((0 0,0 1,0.5 0.5,0 0))
147 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))')));
148 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))')))
149 MULTIPOLYGON(((0 0,0.5 0.5,1 0,0 0)),((0.5 0.5,0 1,0 2,1 1,0.5 0.5)))
150 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)')));
151 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)')))
152 GEOMETRYCOLLECTION(LINESTRING(-10 -10,0 0),LINESTRING(-11 -9,8 10),POLYGON((0 0,40 50,50 45,0 0)),LINESTRING(46.666666666666664 46.666666666666664,200 200,199 201,45.33333333333333 47.33333333333333))
153 select ST_astext(ST_buffer(ST_geometryfromtext('point(1 1)'), 1));
154 ST_astext(ST_buffer(ST_geometryfromtext('point(1 1)'), 1))
155 POLYGON((1 0,0.9509 0.0012,0.9019 0.0048,0.8532 0.0108,0.8049 0.0192,0.7570 0.0299,0.7097 0.0430,0.6631 0.0584,0.6173 0.0761,0.5724 0.0960,0.5286 0.1180,0.4858 0.1422,0.4444 0.1685,0.4043 0.1967,0.3656 0.2269,0.3284 0.2590,0.2928 0.2928,0.2590 0.3284,0.2269 0.3656,0.1967 0.4043,0.1685 0.4444,0.1422 0.4858,0.1180 0.5286,0.0960 0.5724,0.0761 0.6173,0.0584 0.6631,0.0430 0.7097,0.0299 0.7570,0.0192 0.8049,0.0108 0.8532,0.0048 0.9019,0.0012 0.9509,0 1,0.0048 1.0980,0.0108 1.1467,0.0192 1.1950,0.0299 1.2429,0.0430 1.2902,0.0584 1.3368,0.0761 1.3826,0.0960 1.4275,0.1180 1.4713,0.1422 1.5141,0.1685 1.5555,0.1967 1.5956,0.2269 1.6343,0.2590 1.6715,0.2928 1.7071,0.3284 1.7409,0.3656 1.7730,0.4043 1.8032,0.4444 1.8314,0.4858 1.8577,0.5286 1.8819,0.5724 1.9039,0.6173 1.9238,0.6631 1.9415,0.7097 1.9569,0.7570 1.9700,0.8049 1.9807,0.8532 1.9891,0.9019 1.9951,0.9509 1.9987,1 2,1.0490 1.9987,1.0980 1.9951,1.1467 1.9891,1.1950 1.9807,1.2429 1.9700,1.2902 1.9569,1.3368 1.9415,1.3826 1.9238,1.4275 1.9039,1.4713 1.8819,1.5141 1.8577,1.5555 1.8314,1.5956 1.8032,1.6343 1.7730,1.6715 1.7409,1.7071 1.7071,1.7409 1.6715,1.7730 1.6343,1.8032 1.5956,1.8314 1.5555,1.8577 1.5141,1.8819 1.4713,1.9039 1.4275,1.9238 1.3826,1.9415 1.3368,1.9569 1.2902,1.9700 1.2429,1.9807 1.1950,1.9891 1.1467,1.9951 1.0980,1.9987 1.0490,2 1,1.9951 0.9019,1.9891 0.8532,1.9807 0.8049,1.9700 0.7570,1.9569 0.7097,1.9415 0.6631,1.9238 0.6173,1.9039 0.5724,1.8819 0.5286,1.8577 0.4858,1.8314 0.4444,1.8032 0.4043,1.7730 0.3656,1.7409 0.3284,1.7071 0.2928,1.6715 0.2590,1.6343 0.2269,1.5956 0.1967,1.5555 0.1685,1.5141 0.1422,1.4713 0.1180,1.4275 0.0960,1.3826 0.0761,1.3368 0.0584,1.2902 0.0430,1.2429 0.0299,1.1950 0.0192,1.1467 0.0108,1.0980 0.0048,1.0490 0.0012,1 0))
156 create table t1(geom geometrycollection)engine=innodb;
157 select ST_astext(geom), ST_area(geom),ST_area(ST_buffer(geom,2)) from t1;
158 ST_astext(geom) ST_area(geom) ST_area(ST_buffer(geom,2))
159 select ST_NUMPOINTS(ST_EXTERIORRING(ST_buffer(geom,2))) from t1;
160 ST_NUMPOINTS(ST_EXTERIORRING(ST_buffer(geom,2)))
161 set @geom=ST_geomfromtext('LINESTRING(2 1, 4 2, 2 3, 2 5)');
162 set @buff=ST_buffer(@geom,1);
163 select ST_NUMPOINTS(ST_EXTERIORRING(@buff)) from t1;
164 ST_NUMPOINTS(ST_EXTERIORRING(@buff))
165 DROP TABLE t1;
166 select st_touches(ST_geomfromtext('point(0 0)'), ST_geomfromtext('point(1 1)'));
167 st_touches(ST_geomfromtext('point(0 0)'), ST_geomfromtext('point(1 1)'))
168 0
169 select st_touches(ST_geomfromtext('point(1 1)'), ST_geomfromtext('point(1 1)'));
170 st_touches(ST_geomfromtext('point(1 1)'), ST_geomfromtext('point(1 1)'))
171 0
172 select st_touches(ST_geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), ST_geomfromtext('point(1 1)'));
173 st_touches(ST_geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), ST_geomfromtext('point(1 1)'))
174 1
175 select st_touches(ST_geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), ST_geomfromtext('point(1 0)'));
176 st_touches(ST_geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), ST_geomfromtext('point(1 0)'))
177 0
178 select st_touches(ST_geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), ST_geomfromtext('point(1 2)'));
179 st_touches(ST_geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), ST_geomfromtext('point(1 2)'))
180 0
181 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))'));
182 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))'))
183 0
184 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))'));
185 st_touches(ST_geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), ST_geomfromtext('polygon((1 1, 1 0, 2 0, 1 1))'))
186 1
187 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;
188 result
189 0
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 18, 59 13, 59 13, 67 13) )')) as result;
191 result
192 1
193 SELECT ST_Equals(ST_PointFromText('POINT (12 13)'),ST_PointFromText('POINT (12 13)')) as result;
194 result
195 1
196 #
197 # BUG#11755628/47429: INTERSECTION FUNCTION CRASHED MYSQLD
198 # BUG#11759650/51979: UNION/INTERSECTION OF POLYGONS CRASHES MYSQL
199 #
200 SELECT ST_ASTEXT(ST_UNION(ST_GEOMFROMTEXT('POLYGON((525000 183300,525400
201 183300,525400 18370, 525000 183700,525000 183300))'),
202 ST_geomfromtext('POLYGON((525298.67 183511.53,525296.57
203 183510.39,525296.42 183510.31,525289.11 183506.62,525283.17
204 183503.47,525280.98 183502.26,525278.63 183500.97,525278.39
205 183500.84,525276.79 183500,525260.7 183491.55,525263.95
206 183484.75,525265.58 183481.95,525278.97 183488.73,525276.5
207 183493.45,525275.5 183495.7,525280.35 183498.2,525282.3
208 183499.1,525282.2 183499.3,525283.55 183500,525301.75
209 183509.35,525304.45 183504.25,525307.85 183504.95,525304.5
210 183510.83,525302.81 183513.8,525298.67 183511.53),(525275.06
211 183489.89,525272.06 183488.37,525268.94 183494.51,525271.94
212 183496.03,525275.06 183489.89),(525263.26 183491.55,525266.15
213 183493.04,525269.88 183485.82,525266.99 183484.33,525263.26
214 183491.55))'))) st_u;
215 st_u
216 MULTIPOLYGON(((525400 18370,525000.9677614468 183300,525400 183300,525400 18370)),((525000 183300,525000 183700,525000.9677614468 183300,525000 183300)),((525265.58 183481.95,525263.95 183484.75,525260.7 183491.55,525276.79 183500,525278.39 183500.84,525278.63 183500.97,525280.98 183502.26,525283.17 183503.47,525289.11 183506.62,525296.42 183510.31,525296.57 183510.39,525298.67 183511.53,525302.81 183513.8,525304.5 183510.83,525307.85 183504.95,525304.45 183504.25,525301.75 183509.35,525283.55 183500,525282.2 183499.3,525282.3 183499.1,525280.35 183498.2,525275.5 183495.7,525276.5 183493.45,525278.97 183488.73,525265.58 183481.95),(525266.99 183484.33,525263.26 183491.55,525266.15 183493.04,525269.88 183485.82,525266.99 183484.33),(525272.06 183488.37,525268.94 183494.51,525271.94 183496.03,525275.06 183489.89,525272.06 183488.37)))
217 SET @a=0x0000000001030000000200000005000000000000000000000000000000000000000000000000002440000000000000000000000000000024400000000000002440000000000000000000000000000024400000000000000000000000000000000000000000000000000000F03F000000000000F03F0000000000000040000000000000F03F00000000000000400000000000000040000000000000F03F0000000000000040000000000000F03F000000000000F03F;
218 SELECT ST_ASTEXT(ST_TOUCHES(@a, ST_GEOMFROMTEXT('point(0 0)'))) t;
219 ERROR HY000: Illegal parameter data type boolean for operation 'st_astext'
220 DROP TABLE IF EXISTS p1;
221 CREATE PROCEDURE p1(dist DOUBLE, geom TEXT)
222 BEGIN
223 DECLARE g GEOMETRY;
224 SET g=GeomFromText(geom);
225 SELECT geom AS `-----`;
226 SELECT dist, GeometryType(@buf:=ST_Buffer(g, dist)) AS `buffer`, ROUND(ST_AREA(@buf),2) AS buf_area;
227 END|
228 #
229 # Testing ST_BUFFER with positive distance
230 #
231 -----
232 POINT(0 0))
233 dist buffer buf_area
234 1 POLYGON 3.14
235 -----
236 LineString(0 1, 1 1))
237 dist buffer buf_area
238 1 POLYGON 5.14
239 -----
240 LineString(9 9,8 1,1 5,0 0)
241 dist buffer buf_area
242 1 POLYGON 44.63
243 -----
244 Polygon((2 2,2 8,8 8,8 2,2 2))
245 dist buffer buf_area
246 1 POLYGON 63.14
247 -----
248 Polygon((0 0,0 8,8 8,8 0,0 0),(2 2,6 2,6 6,2 6,2 2))
249 dist buffer buf_area
250 1 POLYGON 95.14
251 -----
252 Polygon((0 0, 0 8, 8 8, 8 10, -10 10, -10 0, 0 0))
253 dist buffer buf_area
254 1 POLYGON 174.93
255 -----
256 MultiPoint(9 9,8 1,1 5)
257 dist buffer buf_area
258 1 MULTIPOLYGON 9.42
259 -----
260 MultiLineString((0 0,2 2))
261 dist buffer buf_area
262 1 POLYGON 8.80
263 -----
264 MultiLineString((0 0,2 2,0 4))
265 dist buffer buf_area
266 1 POLYGON 14.24
267 -----
268 MultiLineString((0 0,2 2),(0 2,2 0))
269 dist buffer buf_area
270 1 POLYGON 13.59
271 -----
272 MultiLineString((2 2,2 8,-2 8),(-6 -6, 6 6),(10 10, 14 14))
273 dist buffer buf_area
274 1 MULTIPOLYGON 70.06
275 -----
276 MultiPolygon(((2 2,2 8,8 8,8 2,2 2)), ((9 9,8 1,1 5,9 9)))
277 dist buffer buf_area
278 1 POLYGON 73.18
279 -----
280 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)))
281 dist buffer buf_area
282 1 POLYGON 73.18
283 -----
284 GeometryCollection(Point(0 0))
285 dist buffer buf_area
286 1 POLYGON 3.14
287 -----
288 GeometryCollection(LineString(0 0, 2 2)))
289 dist buffer buf_area
290 1 POLYGON 8.80
291 -----
292 GeometryCollection(Polygon((2 2,2 8,8 8,8 2,2 2))))
293 dist buffer buf_area
294 1 POLYGON 63.14
295 -----
296 GeometryCollection(MultiPoint(9 9,8 1,1 5))
297 dist buffer buf_area
298 1 MULTIPOLYGON 9.42
299 -----
300 GeometryCollection(MultiLineString((0 0,0 1),(3 0,3 1)))
301 dist buffer buf_area
302 1 MULTIPOLYGON 10.28
303 -----
304 GeometryCollection(MultiPolygon(((0 0, 3 0, 3 3, 0 3, 0 0)),((6 6,6 9,9 9,9 6,6 6))))
305 dist buffer buf_area
306 1 MULTIPOLYGON 48.28
307 -----
308 GeometryCollection(Point(9 9),LineString(1 5,0 0),Polygon((2 2,2 8,8 8,8 2,2 2)))
309 dist buffer buf_area
310 1 POLYGON 75.92
311 #
312 # Testing ST_BUFFER with zero distance
313 #
314 -----
315 POINT(0 0))
316 dist buffer buf_area
317 0 POINT 0.00
318 -----
319 LineString(0 1, 1 1))
320 dist buffer buf_area
321 0 LINESTRING 0.00
322 -----
323 LineString(9 9,8 1,1 5,0 0)
324 dist buffer buf_area
325 0 LINESTRING 0.00
326 -----
327 Polygon((2 2,2 8,8 8,8 2,2 2))
328 dist buffer buf_area
329 0 POLYGON 36.00
330 -----
331 Polygon((0 0,0 8,8 8,8 0,0 0),(2 2,6 2,6 6,2 6,2 2))
332 dist buffer buf_area
333 0 POLYGON 48.00
334 -----
335 Polygon((0 0, 0 8, 8 8, 8 10, -10 10, -10 0, 0 0))
336 dist buffer buf_area
337 0 POLYGON 116.00
338 -----
339 MultiPoint(9 9,8 1,1 5)
340 dist buffer buf_area
341 0 MULTIPOINT NULL
342 -----
343 MultiLineString((0 0,2 2))
344 dist buffer buf_area
345 0 MULTILINESTRING NULL
346 -----
347 MultiLineString((0 0,2 2,0 4))
348 dist buffer buf_area
349 0 MULTILINESTRING NULL
350 -----
351 MultiLineString((0 0,2 2),(0 2,2 0))
352 dist buffer buf_area
353 0 MULTILINESTRING NULL
354 -----
355 MultiLineString((2 2,2 8,-2 8),(-6 -6, 6 6),(10 10, 14 14))
356 dist buffer buf_area
357 0 MULTILINESTRING NULL
358 -----
359 MultiPolygon(((2 2,2 8,8 8,8 2,2 2)), ((9 9,8 1,1 5,9 9)))
360 dist buffer buf_area
361 0 MULTIPOLYGON 66.00
362 -----
363 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)))
364 dist buffer buf_area
365 0 MULTIPOLYGON 62.00
366 -----
367 GeometryCollection(Point(0 0))
368 dist buffer buf_area
369 0 GEOMETRYCOLLECTION 0.00
370 -----
371 GeometryCollection(LineString(0 0, 2 2)))
372 dist buffer buf_area
373 0 GEOMETRYCOLLECTION 0.00
374 -----
375 GeometryCollection(Polygon((2 2,2 8,8 8,8 2,2 2))))
376 dist buffer buf_area
377 0 GEOMETRYCOLLECTION 36.00
378 -----
379 GeometryCollection(MultiPoint(9 9,8 1,1 5))
380 dist buffer buf_area
381 0 GEOMETRYCOLLECTION NULL
382 -----
383 GeometryCollection(MultiLineString((0 0,0 1),(3 0,3 1)))
384 dist buffer buf_area
385 0 GEOMETRYCOLLECTION NULL
386 -----
387 GeometryCollection(MultiPolygon(((0 0, 3 0, 3 3, 0 3, 0 0)),((6 6,6 9,9 9,9 6,6 6))))
388 dist buffer buf_area
389 0 GEOMETRYCOLLECTION 18.00
390 -----
391 GeometryCollection(Point(9 9),LineString(1 5,0 0),Polygon((2 2,2 8,8 8,8 2,2 2)))
392 dist buffer buf_area
393 0 GEOMETRYCOLLECTION 36.00
394 #
395 # Testing ST_BUFFER with negative distance
396 #
397 -----
398 POINT(0 0))
399 dist buffer buf_area
400 -1 GEOMETRYCOLLECTION 0.00
401 -----
402 LineString(0 1, 1 1))
403 dist buffer buf_area
404 -1 GEOMETRYCOLLECTION 0.00
405 -----
406 LineString(9 9,8 1,1 5,0 0)
407 dist buffer buf_area
408 -1 GEOMETRYCOLLECTION 0.00
409 -----
410 Polygon((2 2,2 8,8 8,8 2,2 2))
411 dist buffer buf_area
412 -1 POLYGON 16.00
413 -----
414 MultiPoint(9 9,8 1,1 5)
415 dist buffer buf_area
416 -1 GEOMETRYCOLLECTION 0.00
417 -----
418 MultiLineString((0 0,2 2))
419 dist buffer buf_area
420 -1 GEOMETRYCOLLECTION 0.00
421 -----
422 MultiLineString((0 0,2 2,0 4))
423 dist buffer buf_area
424 -1 GEOMETRYCOLLECTION 0.00
425 -----
426 MultiLineString((0 0,2 2),(0 2,2 0))
427 dist buffer buf_area
428 -1 GEOMETRYCOLLECTION 0.00
429 -----
430 MultiLineString((2 2,2 8,-2 8),(-6 -6, 6 6),(10 10, 14 14))
431 dist buffer buf_area
432 -1 GEOMETRYCOLLECTION 0.00
433 -----
434 GeometryCollection(Point(0 0))
435 dist buffer buf_area
436 -1 GEOMETRYCOLLECTION 0.00
437 -----
438 GeometryCollection(LineString(0 0, 2 2)))
439 dist buffer buf_area
440 -1 GEOMETRYCOLLECTION 0.00
441 -----
442 GeometryCollection(Polygon((2 2,2 8,8 8,8 2,2 2))))
443 dist buffer buf_area
444 -1 POLYGON 16.00
445 -----
446 GeometryCollection(MultiPoint(9 9,8 1,1 5))
447 dist buffer buf_area
448 -1 GEOMETRYCOLLECTION 0.00
449 -----
450 GeometryCollection(MultiLineString((0 0,0 1),(3 0,3 1)))
451 dist buffer buf_area
452 -1 GEOMETRYCOLLECTION 0.00
453 -----
454 GeometryCollection(Point(9 9),LineString(1 5,0 0),Polygon((2 2,2 8,8 8,8 2,2 2)))
455 dist buffer buf_area
456 -1 POLYGON 16.00
457 SELECT ST_CONTAINS(
458 GeomFromText('MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)),((6 6, 6 11, 11 11, 11 6, 6 6)))'),
459 GeomFromText('POINT(5 10)')) as geom;
460 geom
461 0
462 SELECT AsText(ST_UNION(
463 GeomFromText('MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)),((6 6, 6 11, 11 11, 11 6, 6 6)))'),
464 GeomFromText('POINT(5 10)'))) as geom;
465 geom
466 GEOMETRYCOLLECTION(POLYGON((0 0,0 5,5 5,5 0,0 0)),POLYGON((6 6,6 11,11 11,11 6,6 6)),POINT(5 10))
467 DROP PROCEDURE p1;
468 #
469 # Bug #13833019 ASSERTION `T1->RESULT_RANGE' FAILED IN GCALC_OPERATION_REDUCER::END_COUPLE
470 #
471 SELECT GeometryType(ST_BUFFER(MULTIPOLYGONFROMTEXT('MULTIPOLYGON(((0 0,9 4,3 3,0 0)),((2 2,2 2,8 8,2 3,2 2)))'), 3)) as geom;
472 geom
473 POLYGON
474 #
475 # Bug #13832749 HANDLE_FATAL_SIGNAL IN GCALC_FUNCTION::COUNT_INTERNAL
476 #
477 SELECT GeometryType(ST_BUFFER(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)) as geom;
478 geom
479 POLYGON
480 #
481 # Bug#13358363 - ASSERTION: N > 0 && N < SINUSES_CALCULATED*2+1 | GET_N_SINCOS/ADD_EDGE_BUFFER
482 #
483 DO ST_BUFFER(ST_GEOMCOLLFROMTEXT('linestring(1 1,2 2)'),'');
484 Warnings:
485 Warning 1292 Truncated incorrect DOUBLE value: ''
486 SELECT ST_WITHIN(
487 LINESTRINGFROMTEXT(' LINESTRING(3 8,9 2,3 8,3 3,7 6,4 7,4 7,8 1) '),
488 ST_BUFFER(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))) '),
489 ST_NUMINTERIORRINGS(POLYGONFROMTEXT('POLYGON((3 5,2 4,2 5,3 5)) ')))) as st;
490 st
491 0
492 SELECT ST_DIMENSION(ST_BUFFER(POLYGONFROMTEXT(' POLYGON((3 5,2 5,2 4,3 4,3 5)) '),
493 ST_NUMINTERIORRINGS(POLYGONFROMTEXT(' POLYGON((0 0,9 3,4 2,0 0))')))) as st;
494 st
495 2
496 SELECT ST_NUMINTERIORRINGS(
497 ST_ENVELOPE(ST_BUFFER(MULTIPOLYGONFROMTEXT('MULTIPOLYGON(((3 5,2 5,2 4,3 4,3 5))) '),
498 SRID(MULTILINESTRINGFROMTEXT('MULTILINESTRING((2 2,4 2,1 2,2 4,2 2)) '))))) as st;
499 st
500 0
501 SELECT ASTEXT(ST_BUFFER(POLYGONFROMTEXT(' POLYGON((9 9,5 2,4 5,9 9))'),
502 SRID(GEOMETRYFROMTEXT(' MULTIPOINT(8 4,5 0,7 8,6 9,3 4,7 3,5 5) ')))) as st;
503 st
504 POLYGON((9 9,5 2,4 5,9 9))