1 DROP TABLE IF EXISTS t1, t2;
3 fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
10 `fid` int(11) NOT NULL AUTO_INCREMENT,
11 `g` geometry NOT NULL,
14 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
15 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(150 150, 150 150)'));
16 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(149 149, 151 151)'));
17 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(148 148, 152 152)'));
18 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(147 147, 153 153)'));
19 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(146 146, 154 154)'));
20 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(145 145, 155 155)'));
21 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(144 144, 156 156)'));
22 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(143 143, 157 157)'));
23 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(142 142, 158 158)'));
24 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(141 141, 159 159)'));
25 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(140 140, 160 160)'));
26 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(139 139, 161 161)'));
27 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(138 138, 162 162)'));
28 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(137 137, 163 163)'));
29 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(136 136, 164 164)'));
30 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(135 135, 165 165)'));
31 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(134 134, 166 166)'));
32 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(133 133, 167 167)'));
33 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(132 132, 168 168)'));
34 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(131 131, 169 169)'));
35 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(130 130, 170 170)'));
36 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(129 129, 171 171)'));
37 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(128 128, 172 172)'));
38 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(127 127, 173 173)'));
39 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(126 126, 174 174)'));
40 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(125 125, 175 175)'));
41 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(124 124, 176 176)'));
42 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(123 123, 177 177)'));
43 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(122 122, 178 178)'));
44 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(121 121, 179 179)'));
45 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(120 120, 180 180)'));
46 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(119 119, 181 181)'));
47 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(118 118, 182 182)'));
48 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(117 117, 183 183)'));
49 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(116 116, 184 184)'));
50 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(115 115, 185 185)'));
51 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(114 114, 186 186)'));
52 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(113 113, 187 187)'));
53 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(112 112, 188 188)'));
54 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(111 111, 189 189)'));
55 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(110 110, 190 190)'));
56 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(109 109, 191 191)'));
57 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(108 108, 192 192)'));
58 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(107 107, 193 193)'));
59 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(106 106, 194 194)'));
60 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(105 105, 195 195)'));
61 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(104 104, 196 196)'));
62 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(103 103, 197 197)'));
63 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(102 102, 198 198)'));
64 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(101 101, 199 199)'));
65 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(100 100, 200 200)'));
66 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(99 99, 201 201)'));
67 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(98 98, 202 202)'));
68 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(97 97, 203 203)'));
69 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(96 96, 204 204)'));
70 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(95 95, 205 205)'));
71 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(94 94, 206 206)'));
72 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(93 93, 207 207)'));
73 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(92 92, 208 208)'));
74 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(91 91, 209 209)'));
75 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(90 90, 210 210)'));
76 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(89 89, 211 211)'));
77 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(88 88, 212 212)'));
78 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(87 87, 213 213)'));
79 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(86 86, 214 214)'));
80 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(85 85, 215 215)'));
81 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(84 84, 216 216)'));
82 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(83 83, 217 217)'));
83 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(82 82, 218 218)'));
84 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(81 81, 219 219)'));
85 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(80 80, 220 220)'));
86 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(79 79, 221 221)'));
87 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(78 78, 222 222)'));
88 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(77 77, 223 223)'));
89 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(76 76, 224 224)'));
90 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(75 75, 225 225)'));
91 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(74 74, 226 226)'));
92 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(73 73, 227 227)'));
93 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(72 72, 228 228)'));
94 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(71 71, 229 229)'));
95 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(70 70, 230 230)'));
96 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(69 69, 231 231)'));
97 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(68 68, 232 232)'));
98 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(67 67, 233 233)'));
99 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(66 66, 234 234)'));
100 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(65 65, 235 235)'));
101 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(64 64, 236 236)'));
102 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(63 63, 237 237)'));
103 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(62 62, 238 238)'));
104 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(61 61, 239 239)'));
105 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(60 60, 240 240)'));
106 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(59 59, 241 241)'));
107 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(58 58, 242 242)'));
108 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(57 57, 243 243)'));
109 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(56 56, 244 244)'));
110 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(55 55, 245 245)'));
111 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(54 54, 246 246)'));
112 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(53 53, 247 247)'));
113 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(52 52, 248 248)'));
114 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(51 51, 249 249)'));
115 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(50 50, 250 250)'));
116 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(49 49, 251 251)'));
117 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(48 48, 252 252)'));
118 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(47 47, 253 253)'));
119 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(46 46, 254 254)'));
120 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(45 45, 255 255)'));
121 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(44 44, 256 256)'));
122 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(43 43, 257 257)'));
123 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(42 42, 258 258)'));
124 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(41 41, 259 259)'));
125 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(40 40, 260 260)'));
126 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(39 39, 261 261)'));
127 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(38 38, 262 262)'));
128 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(37 37, 263 263)'));
129 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(36 36, 264 264)'));
130 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(35 35, 265 265)'));
131 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(34 34, 266 266)'));
132 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(33 33, 267 267)'));
133 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(32 32, 268 268)'));
134 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(31 31, 269 269)'));
135 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(30 30, 270 270)'));
136 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(29 29, 271 271)'));
137 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(28 28, 272 272)'));
138 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(27 27, 273 273)'));
139 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(26 26, 274 274)'));
140 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(25 25, 275 275)'));
141 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(24 24, 276 276)'));
142 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(23 23, 277 277)'));
143 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(22 22, 278 278)'));
144 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(21 21, 279 279)'));
145 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(20 20, 280 280)'));
146 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(19 19, 281 281)'));
147 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(18 18, 282 282)'));
148 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(17 17, 283 283)'));
149 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(16 16, 284 284)'));
150 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(15 15, 285 285)'));
151 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(14 14, 286 286)'));
152 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(13 13, 287 287)'));
153 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(12 12, 288 288)'));
154 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(11 11, 289 289)'));
155 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(10 10, 290 290)'));
156 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(9 9, 291 291)'));
157 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(8 8, 292 292)'));
158 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(7 7, 293 293)'));
159 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(6 6, 294 294)'));
160 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(5 5, 295 295)'));
161 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(4 4, 296 296)'));
162 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(3 3, 297 297)'));
163 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(2 2, 298 298)'));
164 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(1 1, 299 299)'));
165 SELECT count(*) FROM t1;
168 EXPLAIN SELECT fid, AsText(g) FROM t1 WHERE Within(g, GeomFromText('Polygon((140 140,160 140,160 160,140 160,140 140))'));
169 id select_type table type possible_keys key key_len ref rows Extra
170 1 SIMPLE t1 range g g 34 NULL 8 Using where
171 SELECT fid, AsText(g) FROM t1 WHERE Within(g, GeomFromText('Polygon((140 140,160 140,160 160,140 160,140 140))'));
173 1 LINESTRING(150 150,150 150)
174 3 LINESTRING(148 148,152 152)
175 4 LINESTRING(147 147,153 153)
176 5 LINESTRING(146 146,154 154)
177 6 LINESTRING(145 145,155 155)
178 7 LINESTRING(144 144,156 156)
179 8 LINESTRING(143 143,157 157)
180 9 LINESTRING(142 142,158 158)
181 10 LINESTRING(141 141,159 159)
182 11 LINESTRING(140 140,160 160)
183 2 LINESTRING(149 149,151 151)
186 fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
189 INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 10 * 10 - 9), Point(10 * 10, 10 * 10)));
190 INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 9 * 10 - 9), Point(10 * 10, 9 * 10)));
191 INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 8 * 10 - 9), Point(10 * 10, 8 * 10)));
192 INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 7 * 10 - 9), Point(10 * 10, 7 * 10)));
193 INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 6 * 10 - 9), Point(10 * 10, 6 * 10)));
194 INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 5 * 10 - 9), Point(10 * 10, 5 * 10)));
195 INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 4 * 10 - 9), Point(10 * 10, 4 * 10)));
196 INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 3 * 10 - 9), Point(10 * 10, 3 * 10)));
197 INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 2 * 10 - 9), Point(10 * 10, 2 * 10)));
198 INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 1 * 10 - 9), Point(10 * 10, 1 * 10)));
199 INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 10 * 10 - 9), Point(9 * 10, 10 * 10)));
200 INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 9 * 10 - 9), Point(9 * 10, 9 * 10)));
201 INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 8 * 10 - 9), Point(9 * 10, 8 * 10)));
202 INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 7 * 10 - 9), Point(9 * 10, 7 * 10)));
203 INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 6 * 10 - 9), Point(9 * 10, 6 * 10)));
204 INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 5 * 10 - 9), Point(9 * 10, 5 * 10)));
205 INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 4 * 10 - 9), Point(9 * 10, 4 * 10)));
206 INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 3 * 10 - 9), Point(9 * 10, 3 * 10)));
207 INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 2 * 10 - 9), Point(9 * 10, 2 * 10)));
208 INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 1 * 10 - 9), Point(9 * 10, 1 * 10)));
209 INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 10 * 10 - 9), Point(8 * 10, 10 * 10)));
210 INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 9 * 10 - 9), Point(8 * 10, 9 * 10)));
211 INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 8 * 10 - 9), Point(8 * 10, 8 * 10)));
212 INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 7 * 10 - 9), Point(8 * 10, 7 * 10)));
213 INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 6 * 10 - 9), Point(8 * 10, 6 * 10)));
214 INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 5 * 10 - 9), Point(8 * 10, 5 * 10)));
215 INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 4 * 10 - 9), Point(8 * 10, 4 * 10)));
216 INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 3 * 10 - 9), Point(8 * 10, 3 * 10)));
217 INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 2 * 10 - 9), Point(8 * 10, 2 * 10)));
218 INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 1 * 10 - 9), Point(8 * 10, 1 * 10)));
219 INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 10 * 10 - 9), Point(7 * 10, 10 * 10)));
220 INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 9 * 10 - 9), Point(7 * 10, 9 * 10)));
221 INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 8 * 10 - 9), Point(7 * 10, 8 * 10)));
222 INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 7 * 10 - 9), Point(7 * 10, 7 * 10)));
223 INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 6 * 10 - 9), Point(7 * 10, 6 * 10)));
224 INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 5 * 10 - 9), Point(7 * 10, 5 * 10)));
225 INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 4 * 10 - 9), Point(7 * 10, 4 * 10)));
226 INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 3 * 10 - 9), Point(7 * 10, 3 * 10)));
227 INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 2 * 10 - 9), Point(7 * 10, 2 * 10)));
228 INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 1 * 10 - 9), Point(7 * 10, 1 * 10)));
229 INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 10 * 10 - 9), Point(6 * 10, 10 * 10)));
230 INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 9 * 10 - 9), Point(6 * 10, 9 * 10)));
231 INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 8 * 10 - 9), Point(6 * 10, 8 * 10)));
232 INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 7 * 10 - 9), Point(6 * 10, 7 * 10)));
233 INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 6 * 10 - 9), Point(6 * 10, 6 * 10)));
234 INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 5 * 10 - 9), Point(6 * 10, 5 * 10)));
235 INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 4 * 10 - 9), Point(6 * 10, 4 * 10)));
236 INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 3 * 10 - 9), Point(6 * 10, 3 * 10)));
237 INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 2 * 10 - 9), Point(6 * 10, 2 * 10)));
238 INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 1 * 10 - 9), Point(6 * 10, 1 * 10)));
239 INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 10 * 10 - 9), Point(5 * 10, 10 * 10)));
240 INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 9 * 10 - 9), Point(5 * 10, 9 * 10)));
241 INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 8 * 10 - 9), Point(5 * 10, 8 * 10)));
242 INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 7 * 10 - 9), Point(5 * 10, 7 * 10)));
243 INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 6 * 10 - 9), Point(5 * 10, 6 * 10)));
244 INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 5 * 10 - 9), Point(5 * 10, 5 * 10)));
245 INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 4 * 10 - 9), Point(5 * 10, 4 * 10)));
246 INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 3 * 10 - 9), Point(5 * 10, 3 * 10)));
247 INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 2 * 10 - 9), Point(5 * 10, 2 * 10)));
248 INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 1 * 10 - 9), Point(5 * 10, 1 * 10)));
249 INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 10 * 10 - 9), Point(4 * 10, 10 * 10)));
250 INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 9 * 10 - 9), Point(4 * 10, 9 * 10)));
251 INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 8 * 10 - 9), Point(4 * 10, 8 * 10)));
252 INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 7 * 10 - 9), Point(4 * 10, 7 * 10)));
253 INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 6 * 10 - 9), Point(4 * 10, 6 * 10)));
254 INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 5 * 10 - 9), Point(4 * 10, 5 * 10)));
255 INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 4 * 10 - 9), Point(4 * 10, 4 * 10)));
256 INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 3 * 10 - 9), Point(4 * 10, 3 * 10)));
257 INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 2 * 10 - 9), Point(4 * 10, 2 * 10)));
258 INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 1 * 10 - 9), Point(4 * 10, 1 * 10)));
259 INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 10 * 10 - 9), Point(3 * 10, 10 * 10)));
260 INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 9 * 10 - 9), Point(3 * 10, 9 * 10)));
261 INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 8 * 10 - 9), Point(3 * 10, 8 * 10)));
262 INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 7 * 10 - 9), Point(3 * 10, 7 * 10)));
263 INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 6 * 10 - 9), Point(3 * 10, 6 * 10)));
264 INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 5 * 10 - 9), Point(3 * 10, 5 * 10)));
265 INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 4 * 10 - 9), Point(3 * 10, 4 * 10)));
266 INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 3 * 10 - 9), Point(3 * 10, 3 * 10)));
267 INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 2 * 10 - 9), Point(3 * 10, 2 * 10)));
268 INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 1 * 10 - 9), Point(3 * 10, 1 * 10)));
269 INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 10 * 10 - 9), Point(2 * 10, 10 * 10)));
270 INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 9 * 10 - 9), Point(2 * 10, 9 * 10)));
271 INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 8 * 10 - 9), Point(2 * 10, 8 * 10)));
272 INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 7 * 10 - 9), Point(2 * 10, 7 * 10)));
273 INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 6 * 10 - 9), Point(2 * 10, 6 * 10)));
274 INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 5 * 10 - 9), Point(2 * 10, 5 * 10)));
275 INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 4 * 10 - 9), Point(2 * 10, 4 * 10)));
276 INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 3 * 10 - 9), Point(2 * 10, 3 * 10)));
277 INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 2 * 10 - 9), Point(2 * 10, 2 * 10)));
278 INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 1 * 10 - 9), Point(2 * 10, 1 * 10)));
279 INSERT INTO t2 (g) VALUES (LineString(Point(1 * 10 - 9, 10 * 10 - 9), Point(1 * 10, 10 * 10)));
280 INSERT INTO t2 (g) VALUES (LineString(Point(1 * 10 - 9, 9 * 10 - 9), Point(1 * 10, 9 * 10)));
281 INSERT INTO t2 (g) VALUES (LineString(Point(1 * 10 - 9, 8 * 10 - 9), Point(1 * 10, 8 * 10)));
282 INSERT INTO t2 (g) VALUES (LineString(Point(1 * 10 - 9, 7 * 10 - 9), Point(1 * 10, 7 * 10)));
283 INSERT INTO t2 (g) VALUES (LineString(Point(1 * 10 - 9, 6 * 10 - 9), Point(1 * 10, 6 * 10)));
284 INSERT INTO t2 (g) VALUES (LineString(Point(1 * 10 - 9, 5 * 10 - 9), Point(1 * 10, 5 * 10)));
285 INSERT INTO t2 (g) VALUES (LineString(Point(1 * 10 - 9, 4 * 10 - 9), Point(1 * 10, 4 * 10)));
286 INSERT INTO t2 (g) VALUES (LineString(Point(1 * 10 - 9, 3 * 10 - 9), Point(1 * 10, 3 * 10)));
287 INSERT INTO t2 (g) VALUES (LineString(Point(1 * 10 - 9, 2 * 10 - 9), Point(1 * 10, 2 * 10)));
288 INSERT INTO t2 (g) VALUES (LineString(Point(1 * 10 - 9, 1 * 10 - 9), Point(1 * 10, 1 * 10)));
289 ALTER TABLE t2 ADD SPATIAL KEY(g);
290 SHOW CREATE TABLE t2;
292 t2 CREATE TABLE `t2` (
293 `fid` int(11) NOT NULL AUTO_INCREMENT,
294 `g` geometry NOT NULL,
296 SPATIAL KEY `g` (`g`)
297 ) ENGINE=MyISAM AUTO_INCREMENT=101 DEFAULT CHARSET=latin1
298 SELECT count(*) FROM t2;
301 EXPLAIN SELECT fid, AsText(g) FROM t2 WHERE Within(g,
302 GeomFromText('Polygon((40 40,60 40,60 60,40 60,40 40))'));
303 id select_type table type possible_keys key key_len ref rows Extra
304 1 SIMPLE t2 range g g 34 NULL 4 Using where
305 SELECT fid, AsText(g) FROM t2 WHERE Within(g,
306 GeomFromText('Polygon((40 40,60 40,60 60,40 60,40 40))'));
308 46 LINESTRING(51 41,60 50)
309 56 LINESTRING(41 41,50 50)
310 45 LINESTRING(51 51,60 60)
311 55 LINESTRING(41 51,50 60)
312 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 10 * 10 - 9), Point(10 * 10, 10 * 10))));
313 SELECT count(*) FROM t2;
316 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 9 * 10 - 9), Point(10 * 10, 9 * 10))));
317 SELECT count(*) FROM t2;
320 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 8 * 10 - 9), Point(10 * 10, 8 * 10))));
321 SELECT count(*) FROM t2;
324 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 7 * 10 - 9), Point(10 * 10, 7 * 10))));
325 SELECT count(*) FROM t2;
328 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 6 * 10 - 9), Point(10 * 10, 6 * 10))));
329 SELECT count(*) FROM t2;
332 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 5 * 10 - 9), Point(10 * 10, 5 * 10))));
333 SELECT count(*) FROM t2;
336 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 4 * 10 - 9), Point(10 * 10, 4 * 10))));
337 SELECT count(*) FROM t2;
340 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 3 * 10 - 9), Point(10 * 10, 3 * 10))));
341 SELECT count(*) FROM t2;
344 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 2 * 10 - 9), Point(10 * 10, 2 * 10))));
345 SELECT count(*) FROM t2;
348 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 1 * 10 - 9), Point(10 * 10, 1 * 10))));
349 SELECT count(*) FROM t2;
352 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 10 * 10 - 9), Point(9 * 10, 10 * 10))));
353 SELECT count(*) FROM t2;
356 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 9 * 10 - 9), Point(9 * 10, 9 * 10))));
357 SELECT count(*) FROM t2;
360 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 8 * 10 - 9), Point(9 * 10, 8 * 10))));
361 SELECT count(*) FROM t2;
364 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 7 * 10 - 9), Point(9 * 10, 7 * 10))));
365 SELECT count(*) FROM t2;
368 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 6 * 10 - 9), Point(9 * 10, 6 * 10))));
369 SELECT count(*) FROM t2;
372 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 5 * 10 - 9), Point(9 * 10, 5 * 10))));
373 SELECT count(*) FROM t2;
376 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 4 * 10 - 9), Point(9 * 10, 4 * 10))));
377 SELECT count(*) FROM t2;
380 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 3 * 10 - 9), Point(9 * 10, 3 * 10))));
381 SELECT count(*) FROM t2;
384 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 2 * 10 - 9), Point(9 * 10, 2 * 10))));
385 SELECT count(*) FROM t2;
388 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 1 * 10 - 9), Point(9 * 10, 1 * 10))));
389 SELECT count(*) FROM t2;
392 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 10 * 10 - 9), Point(8 * 10, 10 * 10))));
393 SELECT count(*) FROM t2;
396 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 9 * 10 - 9), Point(8 * 10, 9 * 10))));
397 SELECT count(*) FROM t2;
400 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 8 * 10 - 9), Point(8 * 10, 8 * 10))));
401 SELECT count(*) FROM t2;
404 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 7 * 10 - 9), Point(8 * 10, 7 * 10))));
405 SELECT count(*) FROM t2;
408 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 6 * 10 - 9), Point(8 * 10, 6 * 10))));
409 SELECT count(*) FROM t2;
412 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 5 * 10 - 9), Point(8 * 10, 5 * 10))));
413 SELECT count(*) FROM t2;
416 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 4 * 10 - 9), Point(8 * 10, 4 * 10))));
417 SELECT count(*) FROM t2;
420 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 3 * 10 - 9), Point(8 * 10, 3 * 10))));
421 SELECT count(*) FROM t2;
424 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 2 * 10 - 9), Point(8 * 10, 2 * 10))));
425 SELECT count(*) FROM t2;
428 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 1 * 10 - 9), Point(8 * 10, 1 * 10))));
429 SELECT count(*) FROM t2;
432 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 10 * 10 - 9), Point(7 * 10, 10 * 10))));
433 SELECT count(*) FROM t2;
436 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 9 * 10 - 9), Point(7 * 10, 9 * 10))));
437 SELECT count(*) FROM t2;
440 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 8 * 10 - 9), Point(7 * 10, 8 * 10))));
441 SELECT count(*) FROM t2;
444 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 7 * 10 - 9), Point(7 * 10, 7 * 10))));
445 SELECT count(*) FROM t2;
448 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 6 * 10 - 9), Point(7 * 10, 6 * 10))));
449 SELECT count(*) FROM t2;
452 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 5 * 10 - 9), Point(7 * 10, 5 * 10))));
453 SELECT count(*) FROM t2;
456 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 4 * 10 - 9), Point(7 * 10, 4 * 10))));
457 SELECT count(*) FROM t2;
460 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 3 * 10 - 9), Point(7 * 10, 3 * 10))));
461 SELECT count(*) FROM t2;
464 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 2 * 10 - 9), Point(7 * 10, 2 * 10))));
465 SELECT count(*) FROM t2;
468 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 1 * 10 - 9), Point(7 * 10, 1 * 10))));
469 SELECT count(*) FROM t2;
472 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 10 * 10 - 9), Point(6 * 10, 10 * 10))));
473 SELECT count(*) FROM t2;
476 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 9 * 10 - 9), Point(6 * 10, 9 * 10))));
477 SELECT count(*) FROM t2;
480 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 8 * 10 - 9), Point(6 * 10, 8 * 10))));
481 SELECT count(*) FROM t2;
484 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 7 * 10 - 9), Point(6 * 10, 7 * 10))));
485 SELECT count(*) FROM t2;
488 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 6 * 10 - 9), Point(6 * 10, 6 * 10))));
489 SELECT count(*) FROM t2;
492 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 5 * 10 - 9), Point(6 * 10, 5 * 10))));
493 SELECT count(*) FROM t2;
496 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 4 * 10 - 9), Point(6 * 10, 4 * 10))));
497 SELECT count(*) FROM t2;
500 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 3 * 10 - 9), Point(6 * 10, 3 * 10))));
501 SELECT count(*) FROM t2;
504 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 2 * 10 - 9), Point(6 * 10, 2 * 10))));
505 SELECT count(*) FROM t2;
508 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 1 * 10 - 9), Point(6 * 10, 1 * 10))));
509 SELECT count(*) FROM t2;
512 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 10 * 10 - 9), Point(5 * 10, 10 * 10))));
513 SELECT count(*) FROM t2;
516 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 9 * 10 - 9), Point(5 * 10, 9 * 10))));
517 SELECT count(*) FROM t2;
520 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 8 * 10 - 9), Point(5 * 10, 8 * 10))));
521 SELECT count(*) FROM t2;
524 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 7 * 10 - 9), Point(5 * 10, 7 * 10))));
525 SELECT count(*) FROM t2;
528 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 6 * 10 - 9), Point(5 * 10, 6 * 10))));
529 SELECT count(*) FROM t2;
532 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 5 * 10 - 9), Point(5 * 10, 5 * 10))));
533 SELECT count(*) FROM t2;
536 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 4 * 10 - 9), Point(5 * 10, 4 * 10))));
537 SELECT count(*) FROM t2;
540 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 3 * 10 - 9), Point(5 * 10, 3 * 10))));
541 SELECT count(*) FROM t2;
544 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 2 * 10 - 9), Point(5 * 10, 2 * 10))));
545 SELECT count(*) FROM t2;
548 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 1 * 10 - 9), Point(5 * 10, 1 * 10))));
549 SELECT count(*) FROM t2;
552 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 10 * 10 - 9), Point(4 * 10, 10 * 10))));
553 SELECT count(*) FROM t2;
556 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 9 * 10 - 9), Point(4 * 10, 9 * 10))));
557 SELECT count(*) FROM t2;
560 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 8 * 10 - 9), Point(4 * 10, 8 * 10))));
561 SELECT count(*) FROM t2;
564 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 7 * 10 - 9), Point(4 * 10, 7 * 10))));
565 SELECT count(*) FROM t2;
568 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 6 * 10 - 9), Point(4 * 10, 6 * 10))));
569 SELECT count(*) FROM t2;
572 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 5 * 10 - 9), Point(4 * 10, 5 * 10))));
573 SELECT count(*) FROM t2;
576 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 4 * 10 - 9), Point(4 * 10, 4 * 10))));
577 SELECT count(*) FROM t2;
580 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 3 * 10 - 9), Point(4 * 10, 3 * 10))));
581 SELECT count(*) FROM t2;
584 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 2 * 10 - 9), Point(4 * 10, 2 * 10))));
585 SELECT count(*) FROM t2;
588 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 1 * 10 - 9), Point(4 * 10, 1 * 10))));
589 SELECT count(*) FROM t2;
592 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 10 * 10 - 9), Point(3 * 10, 10 * 10))));
593 SELECT count(*) FROM t2;
596 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 9 * 10 - 9), Point(3 * 10, 9 * 10))));
597 SELECT count(*) FROM t2;
600 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 8 * 10 - 9), Point(3 * 10, 8 * 10))));
601 SELECT count(*) FROM t2;
604 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 7 * 10 - 9), Point(3 * 10, 7 * 10))));
605 SELECT count(*) FROM t2;
608 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 6 * 10 - 9), Point(3 * 10, 6 * 10))));
609 SELECT count(*) FROM t2;
612 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 5 * 10 - 9), Point(3 * 10, 5 * 10))));
613 SELECT count(*) FROM t2;
616 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 4 * 10 - 9), Point(3 * 10, 4 * 10))));
617 SELECT count(*) FROM t2;
620 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 3 * 10 - 9), Point(3 * 10, 3 * 10))));
621 SELECT count(*) FROM t2;
624 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 2 * 10 - 9), Point(3 * 10, 2 * 10))));
625 SELECT count(*) FROM t2;
628 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 1 * 10 - 9), Point(3 * 10, 1 * 10))));
629 SELECT count(*) FROM t2;
632 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 10 * 10 - 9), Point(2 * 10, 10 * 10))));
633 SELECT count(*) FROM t2;
636 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 9 * 10 - 9), Point(2 * 10, 9 * 10))));
637 SELECT count(*) FROM t2;
640 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 8 * 10 - 9), Point(2 * 10, 8 * 10))));
641 SELECT count(*) FROM t2;
644 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 7 * 10 - 9), Point(2 * 10, 7 * 10))));
645 SELECT count(*) FROM t2;
648 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 6 * 10 - 9), Point(2 * 10, 6 * 10))));
649 SELECT count(*) FROM t2;
652 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 5 * 10 - 9), Point(2 * 10, 5 * 10))));
653 SELECT count(*) FROM t2;
656 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 4 * 10 - 9), Point(2 * 10, 4 * 10))));
657 SELECT count(*) FROM t2;
660 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 3 * 10 - 9), Point(2 * 10, 3 * 10))));
661 SELECT count(*) FROM t2;
664 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 2 * 10 - 9), Point(2 * 10, 2 * 10))));
665 SELECT count(*) FROM t2;
668 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 1 * 10 - 9), Point(2 * 10, 1 * 10))));
669 SELECT count(*) FROM t2;
672 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 10 * 10 - 9), Point(1 * 10, 10 * 10))));
673 SELECT count(*) FROM t2;
676 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 9 * 10 - 9), Point(1 * 10, 9 * 10))));
677 SELECT count(*) FROM t2;
680 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 8 * 10 - 9), Point(1 * 10, 8 * 10))));
681 SELECT count(*) FROM t2;
684 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 7 * 10 - 9), Point(1 * 10, 7 * 10))));
685 SELECT count(*) FROM t2;
688 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 6 * 10 - 9), Point(1 * 10, 6 * 10))));
689 SELECT count(*) FROM t2;
692 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 5 * 10 - 9), Point(1 * 10, 5 * 10))));
693 SELECT count(*) FROM t2;
696 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 4 * 10 - 9), Point(1 * 10, 4 * 10))));
697 SELECT count(*) FROM t2;
700 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 3 * 10 - 9), Point(1 * 10, 3 * 10))));
701 SELECT count(*) FROM t2;
704 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 2 * 10 - 9), Point(1 * 10, 2 * 10))));
705 SELECT count(*) FROM t2;
708 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 1 * 10 - 9), Point(1 * 10, 1 * 10))));
709 SELECT count(*) FROM t2;
713 drop table if exists t1;
715 Note 1051 Unknown table 't1'
716 CREATE TABLE t1 (a geometry NOT NULL, SPATIAL (a));
717 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
718 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
719 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
720 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
721 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
722 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
723 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
724 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
725 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
726 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
727 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
728 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
729 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
730 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
731 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
732 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
733 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
734 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
735 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
736 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
737 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
738 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
739 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
740 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
741 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
742 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
743 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
744 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
745 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
747 Table Op Msg_type Msg_text
748 test.t1 check status OK
750 Table Op Msg_type Msg_text
751 test.t1 analyze status OK
754 fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
758 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(1 2, 2 3)')),(GeomFromText('LineString(1 2, 2 4)'));
761 line LINESTRING NOT NULL,
762 kind ENUM('po', 'pp', 'rr', 'dr', 'rd', 'ts', 'cl') NOT NULL DEFAULT 'po',
766 ALTER TABLE t1 DISABLE KEYS;
767 INSERT INTO t1 (name, kind, line) VALUES
768 ("Aadaouane", "pp", GeomFromText("POINT(32.816667 35.983333)")),
769 ("Aadassiye", "pp", GeomFromText("POINT(35.816667 36.216667)")),
770 ("Aadbel", "pp", GeomFromText("POINT(34.533333 36.100000)")),
771 ("Aadchit", "pp", GeomFromText("POINT(33.347222 35.423611)")),
772 ("Aadchite", "pp", GeomFromText("POINT(33.347222 35.423611)")),
773 ("Aadchit el Qoussair", "pp", GeomFromText("POINT(33.283333 35.483333)")),
774 ("Aaddaye", "pp", GeomFromText("POINT(36.716667 40.833333)")),
775 ("'Aadeissa", "pp", GeomFromText("POINT(32.823889 35.698889)")),
776 ("Aaderup", "pp", GeomFromText("POINT(55.216667 11.766667)")),
777 ("Qalaat Aades", "pp", GeomFromText("POINT(33.503333 35.377500)")),
778 ("A ad'ino", "pp", GeomFromText("POINT(54.812222 38.209167)")),
779 ("Aadi Noia", "pp", GeomFromText("POINT(13.800000 39.833333)")),
780 ("Aad La Macta", "pp", GeomFromText("POINT(35.779444 -0.129167)")),
781 ("Aadland", "pp", GeomFromText("POINT(60.366667 5.483333)")),
782 ("Aadliye", "pp", GeomFromText("POINT(33.366667 36.333333)")),
783 ("Aadloun", "pp", GeomFromText("POINT(33.403889 35.273889)")),
784 ("Aadma", "pp", GeomFromText("POINT(58.798333 22.663889)")),
785 ("Aadma Asundus", "pp", GeomFromText("POINT(58.798333 22.663889)")),
786 ("Aadmoun", "pp", GeomFromText("POINT(34.150000 35.650000)")),
787 ("Aadneram", "pp", GeomFromText("POINT(59.016667 6.933333)")),
788 ("Aadneskaar", "pp", GeomFromText("POINT(58.083333 6.983333)")),
789 ("Aadorf", "pp", GeomFromText("POINT(47.483333 8.900000)")),
790 ("Aadorp", "pp", GeomFromText("POINT(52.366667 6.633333)")),
791 ("Aadouane", "pp", GeomFromText("POINT(32.816667 35.983333)")),
792 ("Aadoui", "pp", GeomFromText("POINT(34.450000 35.983333)")),
793 ("Aadouiye", "pp", GeomFromText("POINT(34.583333 36.183333)")),
794 ("Aadouss", "pp", GeomFromText("POINT(33.512500 35.601389)")),
795 ("Aadra", "pp", GeomFromText("POINT(33.616667 36.500000)")),
796 ("Aadzi", "pp", GeomFromText("POINT(38.100000 64.850000)"));
797 ALTER TABLE t1 ENABLE KEYS;
798 INSERT INTO t1 (name, kind, line) VALUES ("austria", "pp", GeomFromText('LINESTRING(14.9906 48.9887,14.9946 48.9904,14.9947 48.9916)'));
800 CREATE TABLE t1 (st varchar(100));
801 INSERT INTO t1 VALUES ("Fake string");
802 CREATE TABLE t2 (geom GEOMETRY NOT NULL, SPATIAL KEY gk(geom));
803 INSERT INTO t2 SELECT GeomFromText(st) FROM t1;
804 ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
806 CREATE TABLE t1 (`geometry` geometry NOT NULL default '',SPATIAL KEY `gndx` (`geometry`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
808 Warning 1101 BLOB/TEXT column 'geometry' can't have a default value
809 INSERT INTO t1 (geometry) VALUES
810 (PolygonFromText('POLYGON((-18.6086111000 -66.9327777000, -18.6055555000
811 -66.8158332999, -18.7186111000 -66.8102777000, -18.7211111000 -66.9269443999,
812 -18.6086111000 -66.9327777000))'));
813 INSERT INTO t1 (geometry) VALUES
814 (PolygonFromText('POLYGON((-65.7402776999 -96.6686111000, -65.7372222000
815 -96.5516666000, -65.8502777000 -96.5461111000, -65.8527777000 -96.6627777000,
816 -65.7402776999 -96.6686111000))'));
817 check table t1 extended;
818 Table Op Msg_type Msg_text
819 test.t1 check status OK
822 c1 geometry NOT NULL default '',
824 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
826 Warning 1101 BLOB/TEXT column 'c1' can't have a default value
827 INSERT INTO t1 (c1) VALUES (
828 PolygonFromText('POLYGON((-18.6086111000 -66.9327777000,
829 -18.6055555000 -66.8158332999,
830 -18.7186111000 -66.8102777000,
831 -18.7211111000 -66.9269443999,
832 -18.6086111000 -66.9327777000))'));
833 CHECK TABLE t1 EXTENDED;
834 Table Op Msg_type Msg_text
835 test.t1 check status OK
838 c1 geometry NOT NULL default '',
840 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
842 Warning 1101 BLOB/TEXT column 'c1' can't have a default value
843 INSERT INTO t1 (c1) VALUES (
844 PolygonFromText('POLYGON((-18.6086111000 -66.9327777000,
845 -18.6055555000 -66.8158332999,
846 -18.7186111000 -66.8102777000,
847 -18.7211111000 -66.9269443999,
848 -18.6086111000 -66.9327777000))'));
849 INSERT INTO t1 (c1) VALUES (
850 PolygonFromText('POLYGON((-65.7402776999 -96.6686111000,
851 -65.7372222000 -96.5516666000,
852 -65.8502777000 -96.5461111000,
853 -65.8527777000 -96.6627777000,
854 -65.7402776999 -96.6686111000))'));
855 INSERT INTO t1 (c1) VALUES (
856 PolygonFromText('POLYGON((-18.6086111000 -66.9327777000,
857 -18.6055555000 -66.8158332999,
858 -18.7186111000 -66.8102777000,
859 -18.7211111000 -66.9269443999,
860 -18.6086111000 -66.9327777000))'));
861 CHECK TABLE t1 EXTENDED;
862 Table Op Msg_type Msg_text
863 test.t1 check status OK
865 CREATE TABLE t1 (foo GEOMETRY NOT NULL, SPATIAL INDEX(foo) );
866 INSERT INTO t1 (foo) VALUES (POINT(1,1));
867 INSERT INTO t1 (foo) VALUES (POINT(1,0));
868 INSERT INTO t1 (foo) VALUES (POINT(0,1));
869 INSERT INTO t1 (foo) VALUES (POINT(0,0));
870 SELECT 1 FROM t1 WHERE foo != POINT(0,0);
876 CREATE TABLE t1 (id bigint(12) unsigned NOT NULL auto_increment,
877 c2 varchar(15) collate utf8_bin default NULL,
878 c1 varchar(15) collate utf8_bin default NULL,
879 c3 varchar(10) collate utf8_bin default NULL,
880 spatial_point point NOT NULL,
882 SPATIAL KEY (spatial_point)
883 )ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
884 INSERT INTO t1 (c2, c1, c3, spatial_point) VALUES
885 ('y', 's', 'j', GeomFromText('POINT(167 74)')),
886 ('r', 'n', 'd', GeomFromText('POINT(215 118)')),
887 ('g', 'n', 'e', GeomFromText('POINT(203 98)')),
888 ('h', 'd', 'd', GeomFromText('POINT(54 193)')),
889 ('r', 'x', 'y', GeomFromText('POINT(47 69)')),
890 ('t', 'q', 'r', GeomFromText('POINT(109 42)')),
891 ('a', 'z', 'd', GeomFromText('POINT(0 154)')),
892 ('x', 'v', 'o', GeomFromText('POINT(174 131)')),
893 ('b', 'r', 'a', GeomFromText('POINT(114 253)')),
894 ('x', 'z', 'i', GeomFromText('POINT(163 21)')),
895 ('w', 'p', 'i', GeomFromText('POINT(42 102)')),
896 ('g', 'j', 'j', GeomFromText('POINT(170 133)')),
897 ('m', 'g', 'n', GeomFromText('POINT(28 22)')),
898 ('b', 'z', 'h', GeomFromText('POINT(174 28)')),
899 ('q', 'k', 'f', GeomFromText('POINT(233 73)')),
900 ('w', 'w', 'a', GeomFromText('POINT(124 200)')),
901 ('t', 'j', 'w', GeomFromText('POINT(252 101)')),
902 ('d', 'r', 'd', GeomFromText('POINT(98 18)')),
903 ('w', 'o', 'y', GeomFromText('POINT(165 31)')),
904 ('y', 'h', 't', GeomFromText('POINT(14 220)')),
905 ('d', 'p', 'u', GeomFromText('POINT(223 196)')),
906 ('g', 'y', 'g', GeomFromText('POINT(207 96)')),
907 ('x', 'm', 'n', GeomFromText('POINT(214 3)')),
908 ('g', 'v', 'e', GeomFromText('POINT(140 205)')),
909 ('g', 'm', 'm', GeomFromText('POINT(10 236)')),
910 ('i', 'r', 'j', GeomFromText('POINT(137 228)')),
911 ('w', 's', 'p', GeomFromText('POINT(115 6)')),
912 ('o', 'n', 'k', GeomFromText('POINT(158 129)')),
913 ('j', 'h', 'l', GeomFromText('POINT(129 72)')),
914 ('f', 'x', 'l', GeomFromText('POINT(139 207)')),
915 ('u', 'd', 'n', GeomFromText('POINT(125 109)')),
916 ('b', 'a', 'z', GeomFromText('POINT(30 32)')),
917 ('m', 'h', 'o', GeomFromText('POINT(251 251)')),
918 ('f', 'r', 'd', GeomFromText('POINT(243 211)')),
919 ('b', 'd', 'r', GeomFromText('POINT(232 80)')),
920 ('g', 'k', 'v', GeomFromText('POINT(15 100)')),
921 ('i', 'f', 'c', GeomFromText('POINT(109 66)')),
922 ('r', 't', 'j', GeomFromText('POINT(178 6)')),
923 ('y', 'n', 'f', GeomFromText('POINT(233 211)')),
924 ('f', 'y', 'm', GeomFromText('POINT(99 16)')),
925 ('z', 'q', 'l', GeomFromText('POINT(39 49)')),
926 ('j', 'c', 'r', GeomFromText('POINT(75 187)')),
927 ('c', 'y', 'y', GeomFromText('POINT(246 253)')),
928 ('w', 'u', 'd', GeomFromText('POINT(56 190)')),
929 ('n', 'q', 'm', GeomFromText('POINT(73 149)')),
930 ('d', 'y', 'a', GeomFromText('POINT(134 6)')),
931 ('z', 's', 'w', GeomFromText('POINT(216 225)')),
932 ('d', 'u', 'k', GeomFromText('POINT(132 70)')),
933 ('f', 'v', 't', GeomFromText('POINT(187 141)')),
934 ('r', 'r', 'a', GeomFromText('POINT(152 39)')),
935 ('y', 'p', 'o', GeomFromText('POINT(45 27)')),
936 ('p', 'n', 'm', GeomFromText('POINT(228 148)')),
937 ('e', 'g', 'e', GeomFromText('POINT(88 81)')),
938 ('m', 'a', 'h', GeomFromText('POINT(35 29)')),
939 ('m', 'h', 'f', GeomFromText('POINT(30 71)')),
940 ('h', 'k', 'i', GeomFromText('POINT(244 78)')),
941 ('z', 'v', 'd', GeomFromText('POINT(241 38)')),
942 ('q', 'l', 'j', GeomFromText('POINT(13 71)')),
943 ('s', 'p', 'g', GeomFromText('POINT(108 38)')),
944 ('q', 's', 'j', GeomFromText('POINT(92 101)')),
945 ('l', 'h', 'g', GeomFromText('POINT(120 78)')),
946 ('w', 't', 'b', GeomFromText('POINT(193 109)')),
947 ('b', 's', 's', GeomFromText('POINT(223 211)')),
948 ('w', 'w', 'y', GeomFromText('POINT(122 42)')),
949 ('q', 'c', 'c', GeomFromText('POINT(104 102)')),
950 ('w', 'g', 'n', GeomFromText('POINT(213 120)')),
951 ('p', 'q', 'a', GeomFromText('POINT(247 148)')),
952 ('c', 'z', 'e', GeomFromText('POINT(18 106)')),
953 ('z', 'u', 'n', GeomFromText('POINT(70 133)')),
954 ('j', 'n', 'x', GeomFromText('POINT(232 13)')),
955 ('e', 'h', 'f', GeomFromText('POINT(22 135)')),
956 ('w', 'l', 'f', GeomFromText('POINT(9 180)')),
957 ('a', 'v', 'q', GeomFromText('POINT(163 228)')),
958 ('i', 'z', 'o', GeomFromText('POINT(180 100)')),
959 ('e', 'c', 'l', GeomFromText('POINT(182 231)')),
960 ('c', 'k', 'o', GeomFromText('POINT(19 60)')),
961 ('q', 'f', 'p', GeomFromText('POINT(79 95)')),
962 ('m', 'd', 'r', GeomFromText('POINT(3 127)')),
963 ('m', 'e', 't', GeomFromText('POINT(136 154)')),
964 ('w', 'w', 'w', GeomFromText('POINT(102 15)')),
965 ('l', 'n', 'q', GeomFromText('POINT(71 196)')),
966 ('p', 'k', 'c', GeomFromText('POINT(47 139)')),
967 ('j', 'o', 'r', GeomFromText('POINT(177 128)')),
968 ('j', 'q', 'a', GeomFromText('POINT(170 6)')),
969 ('b', 'a', 'o', GeomFromText('POINT(63 211)')),
970 ('g', 's', 'o', GeomFromText('POINT(144 251)')),
971 ('w', 'u', 'w', GeomFromText('POINT(221 214)')),
972 ('g', 'a', 'm', GeomFromText('POINT(14 102)')),
973 ('u', 'q', 'z', GeomFromText('POINT(86 200)')),
974 ('k', 'a', 'm', GeomFromText('POINT(144 222)')),
975 ('j', 'u', 'r', GeomFromText('POINT(216 142)')),
976 ('q', 'k', 'v', GeomFromText('POINT(121 236)')),
977 ('p', 'o', 'r', GeomFromText('POINT(108 102)')),
978 ('b', 'd', 'x', GeomFromText('POINT(127 198)')),
979 ('k', 's', 'a', GeomFromText('POINT(2 150)')),
980 ('f', 'm', 'f', GeomFromText('POINT(160 191)')),
981 ('q', 'y', 'x', GeomFromText('POINT(98 111)')),
982 ('o', 'f', 'm', GeomFromText('POINT(232 218)')),
983 ('c', 'w', 'j', GeomFromText('POINT(156 165)')),
984 ('s', 'q', 'v', GeomFromText('POINT(98 161)'));
985 SET @@RAND_SEED1=692635050, @@RAND_SEED2=297339954;
986 DELETE FROM t1 ORDER BY RAND() LIMIT 10;
987 SET @@RAND_SEED1=159925977, @@RAND_SEED2=942570618;
988 DELETE FROM t1 ORDER BY RAND() LIMIT 10;
989 SET @@RAND_SEED1=328169745, @@RAND_SEED2=410451954;
990 DELETE FROM t1 ORDER BY RAND() LIMIT 10;
991 SET @@RAND_SEED1=178507359, @@RAND_SEED2=332493072;
992 DELETE FROM t1 ORDER BY RAND() LIMIT 10;
993 SET @@RAND_SEED1=1034033013, @@RAND_SEED2=558966507;
994 DELETE FROM t1 ORDER BY RAND() LIMIT 10;
995 UPDATE t1 set spatial_point=GeomFromText('POINT(230 9)') where c1 like 'y%';
996 UPDATE t1 set spatial_point=GeomFromText('POINT(95 35)') where c1 like 'j%';
997 UPDATE t1 set spatial_point=GeomFromText('POINT(93 99)') where c1 like 'a%';
998 UPDATE t1 set spatial_point=GeomFromText('POINT(19 81)') where c1 like 'r%';
999 UPDATE t1 set spatial_point=GeomFromText('POINT(20 177)') where c1 like 'h%';
1000 UPDATE t1 set spatial_point=GeomFromText('POINT(221 193)') where c1 like 'u%';
1001 UPDATE t1 set spatial_point=GeomFromText('POINT(195 205)') where c1 like 'd%';
1002 UPDATE t1 set spatial_point=GeomFromText('POINT(15 213)') where c1 like 'u%';
1003 UPDATE t1 set spatial_point=GeomFromText('POINT(214 63)') where c1 like 'n%';
1004 UPDATE t1 set spatial_point=GeomFromText('POINT(243 171)') where c1 like 'c%';
1005 UPDATE t1 set spatial_point=GeomFromText('POINT(198 82)') where c1 like 'y%';
1006 INSERT INTO t1 (c2, c1, c3, spatial_point) VALUES
1007 ('f', 'y', 'p', GeomFromText('POINT(109 235)')),
1008 ('b', 'e', 'v', GeomFromText('POINT(20 48)')),
1009 ('i', 'u', 'f', GeomFromText('POINT(15 55)')),
1010 ('o', 'r', 'z', GeomFromText('POINT(105 64)')),
1011 ('a', 'p', 'a', GeomFromText('POINT(142 236)')),
1012 ('g', 'i', 'k', GeomFromText('POINT(10 49)')),
1013 ('x', 'z', 'x', GeomFromText('POINT(192 200)')),
1014 ('c', 'v', 'r', GeomFromText('POINT(94 168)')),
1015 ('y', 'z', 'e', GeomFromText('POINT(141 51)')),
1016 ('h', 'm', 'd', GeomFromText('POINT(35 251)')),
1017 ('v', 'm', 'q', GeomFromText('POINT(44 90)')),
1018 ('j', 'l', 'z', GeomFromText('POINT(67 237)')),
1019 ('i', 'v', 'a', GeomFromText('POINT(75 14)')),
1020 ('b', 'q', 't', GeomFromText('POINT(153 33)')),
1021 ('e', 'm', 'a', GeomFromText('POINT(247 49)')),
1022 ('l', 'y', 'g', GeomFromText('POINT(56 203)')),
1023 ('v', 'o', 'r', GeomFromText('POINT(90 54)')),
1024 ('r', 'n', 'd', GeomFromText('POINT(135 83)')),
1025 ('j', 't', 'u', GeomFromText('POINT(174 239)')),
1026 ('u', 'n', 'g', GeomFromText('POINT(104 191)')),
1027 ('p', 'q', 'y', GeomFromText('POINT(63 171)')),
1028 ('o', 'q', 'p', GeomFromText('POINT(192 103)')),
1029 ('f', 'x', 'e', GeomFromText('POINT(244 30)')),
1030 ('n', 'x', 'c', GeomFromText('POINT(92 103)')),
1031 ('r', 'q', 'z', GeomFromText('POINT(166 20)')),
1032 ('s', 'a', 'j', GeomFromText('POINT(137 205)')),
1033 ('z', 't', 't', GeomFromText('POINT(99 134)')),
1034 ('o', 'm', 'j', GeomFromText('POINT(217 3)')),
1035 ('n', 'h', 'j', GeomFromText('POINT(211 17)')),
1036 ('v', 'v', 'a', GeomFromText('POINT(41 137)')),
1037 ('q', 'o', 'j', GeomFromText('POINT(5 92)')),
1038 ('z', 'y', 'e', GeomFromText('POINT(175 212)')),
1039 ('j', 'z', 'h', GeomFromText('POINT(224 194)')),
1040 ('a', 'g', 'm', GeomFromText('POINT(31 119)')),
1041 ('p', 'c', 'f', GeomFromText('POINT(17 221)')),
1042 ('t', 'h', 'k', GeomFromText('POINT(26 203)')),
1043 ('u', 'w', 'p', GeomFromText('POINT(47 185)')),
1044 ('z', 'a', 'c', GeomFromText('POINT(61 133)')),
1045 ('u', 'k', 'a', GeomFromText('POINT(210 115)')),
1046 ('k', 'f', 'h', GeomFromText('POINT(125 113)')),
1047 ('t', 'v', 'y', GeomFromText('POINT(12 239)')),
1048 ('u', 'v', 'd', GeomFromText('POINT(90 24)')),
1049 ('m', 'y', 'w', GeomFromText('POINT(25 243)')),
1050 ('d', 'n', 'g', GeomFromText('POINT(122 92)')),
1051 ('z', 'm', 'f', GeomFromText('POINT(235 110)')),
1052 ('q', 'd', 'f', GeomFromText('POINT(233 217)')),
1053 ('a', 'v', 'u', GeomFromText('POINT(69 59)')),
1054 ('x', 'k', 'p', GeomFromText('POINT(240 14)')),
1055 ('i', 'v', 'r', GeomFromText('POINT(154 42)')),
1056 ('w', 'h', 'l', GeomFromText('POINT(178 156)')),
1057 ('d', 'h', 'n', GeomFromText('POINT(65 157)')),
1058 ('c', 'k', 'z', GeomFromText('POINT(62 33)')),
1059 ('e', 'l', 'w', GeomFromText('POINT(162 1)')),
1060 ('r', 'f', 'i', GeomFromText('POINT(127 71)')),
1061 ('q', 'm', 'c', GeomFromText('POINT(63 118)')),
1062 ('c', 'h', 'u', GeomFromText('POINT(205 203)')),
1063 ('d', 't', 'p', GeomFromText('POINT(234 87)')),
1064 ('s', 'g', 'h', GeomFromText('POINT(149 34)')),
1065 ('o', 'b', 'q', GeomFromText('POINT(159 179)')),
1066 ('k', 'u', 'f', GeomFromText('POINT(202 254)')),
1067 ('u', 'f', 'g', GeomFromText('POINT(70 15)')),
1068 ('x', 's', 'b', GeomFromText('POINT(25 181)')),
1069 ('s', 'c', 'g', GeomFromText('POINT(252 17)')),
1070 ('a', 'c', 'f', GeomFromText('POINT(89 67)')),
1071 ('r', 'e', 'q', GeomFromText('POINT(55 54)')),
1072 ('f', 'i', 'k', GeomFromText('POINT(178 230)')),
1073 ('p', 'e', 'l', GeomFromText('POINT(198 28)')),
1074 ('w', 'o', 'd', GeomFromText('POINT(204 189)')),
1075 ('c', 'a', 'g', GeomFromText('POINT(230 178)')),
1076 ('r', 'o', 'e', GeomFromText('POINT(61 116)')),
1077 ('w', 'a', 'a', GeomFromText('POINT(178 237)')),
1078 ('v', 'd', 'e', GeomFromText('POINT(70 85)')),
1079 ('k', 'c', 'e', GeomFromText('POINT(147 118)')),
1080 ('d', 'q', 't', GeomFromText('POINT(218 77)')),
1081 ('k', 'g', 'f', GeomFromText('POINT(192 113)')),
1082 ('w', 'n', 'e', GeomFromText('POINT(92 124)')),
1083 ('r', 'm', 'q', GeomFromText('POINT(130 65)')),
1084 ('o', 'r', 'r', GeomFromText('POINT(174 233)')),
1085 ('k', 'n', 't', GeomFromText('POINT(175 147)')),
1086 ('q', 'm', 'r', GeomFromText('POINT(18 208)')),
1087 ('l', 'd', 'i', GeomFromText('POINT(13 104)')),
1088 ('w', 'o', 'y', GeomFromText('POINT(207 39)')),
1089 ('p', 'u', 'o', GeomFromText('POINT(114 31)')),
1090 ('y', 'a', 'p', GeomFromText('POINT(106 59)')),
1091 ('a', 'x', 'z', GeomFromText('POINT(17 57)')),
1092 ('v', 'h', 'x', GeomFromText('POINT(170 13)')),
1093 ('t', 's', 'u', GeomFromText('POINT(84 18)')),
1094 ('z', 'z', 'f', GeomFromText('POINT(250 197)')),
1095 ('l', 'z', 't', GeomFromText('POINT(59 80)')),
1096 ('j', 'g', 's', GeomFromText('POINT(54 26)')),
1097 ('g', 'v', 'm', GeomFromText('POINT(89 98)')),
1098 ('q', 'v', 'b', GeomFromText('POINT(39 240)')),
1099 ('x', 'k', 'v', GeomFromText('POINT(246 207)')),
1100 ('k', 'u', 'i', GeomFromText('POINT(105 111)')),
1101 ('w', 'z', 's', GeomFromText('POINT(235 8)')),
1102 ('d', 'd', 'd', GeomFromText('POINT(105 4)')),
1103 ('c', 'z', 'q', GeomFromText('POINT(13 140)')),
1104 ('m', 'k', 'i', GeomFromText('POINT(208 120)')),
1105 ('g', 'a', 'g', GeomFromText('POINT(9 182)')),
1106 ('z', 'j', 'r', GeomFromText('POINT(149 153)')),
1107 ('h', 'f', 'g', GeomFromText('POINT(81 236)')),
1108 ('m', 'e', 'q', GeomFromText('POINT(209 215)')),
1109 ('c', 'h', 'y', GeomFromText('POINT(235 70)')),
1110 ('i', 'e', 'g', GeomFromText('POINT(138 26)')),
1111 ('m', 't', 'u', GeomFromText('POINT(119 237)')),
1112 ('o', 'w', 's', GeomFromText('POINT(193 166)')),
1113 ('f', 'm', 'q', GeomFromText('POINT(85 96)')),
1114 ('x', 'l', 'x', GeomFromText('POINT(58 115)')),
1115 ('x', 'q', 'u', GeomFromText('POINT(108 210)')),
1116 ('b', 'h', 'i', GeomFromText('POINT(250 139)')),
1117 ('y', 'd', 'x', GeomFromText('POINT(199 135)')),
1118 ('w', 'h', 'p', GeomFromText('POINT(247 233)')),
1119 ('p', 'z', 't', GeomFromText('POINT(148 249)')),
1120 ('q', 'a', 'u', GeomFromText('POINT(174 78)')),
1121 ('v', 't', 'm', GeomFromText('POINT(70 228)')),
1122 ('t', 'n', 'f', GeomFromText('POINT(123 2)')),
1123 ('x', 't', 'b', GeomFromText('POINT(35 50)')),
1124 ('r', 'j', 'f', GeomFromText('POINT(200 51)')),
1125 ('s', 'q', 'o', GeomFromText('POINT(23 184)')),
1126 ('u', 'v', 'z', GeomFromText('POINT(7 113)')),
1127 ('v', 'u', 'l', GeomFromText('POINT(145 190)')),
1128 ('o', 'k', 'i', GeomFromText('POINT(161 122)')),
1129 ('l', 'y', 'e', GeomFromText('POINT(17 232)')),
1130 ('t', 'b', 'e', GeomFromText('POINT(120 50)')),
1131 ('e', 's', 'u', GeomFromText('POINT(254 1)')),
1132 ('d', 'd', 'u', GeomFromText('POINT(167 140)')),
1133 ('o', 'b', 'x', GeomFromText('POINT(186 237)')),
1134 ('m', 's', 's', GeomFromText('POINT(172 149)')),
1135 ('t', 'y', 'a', GeomFromText('POINT(149 85)')),
1136 ('x', 't', 'r', GeomFromText('POINT(10 165)')),
1137 ('g', 'c', 'e', GeomFromText('POINT(95 165)')),
1138 ('e', 'e', 'z', GeomFromText('POINT(98 65)')),
1139 ('f', 'v', 'i', GeomFromText('POINT(149 144)')),
1140 ('o', 'p', 'm', GeomFromText('POINT(233 67)')),
1141 ('t', 'u', 'b', GeomFromText('POINT(109 215)')),
1142 ('o', 'o', 'b', GeomFromText('POINT(130 48)')),
1143 ('e', 'm', 'h', GeomFromText('POINT(88 189)')),
1144 ('e', 'v', 'y', GeomFromText('POINT(55 29)')),
1145 ('e', 't', 'm', GeomFromText('POINT(129 55)')),
1146 ('p', 'p', 'i', GeomFromText('POINT(126 222)')),
1147 ('c', 'i', 'c', GeomFromText('POINT(19 158)')),
1148 ('c', 'b', 's', GeomFromText('POINT(13 19)')),
1149 ('u', 'y', 'a', GeomFromText('POINT(114 5)')),
1150 ('a', 'o', 'f', GeomFromText('POINT(227 232)')),
1151 ('t', 'c', 'z', GeomFromText('POINT(63 62)')),
1152 ('d', 'o', 'k', GeomFromText('POINT(48 228)')),
1153 ('x', 'c', 'e', GeomFromText('POINT(204 2)')),
1154 ('e', 'e', 'g', GeomFromText('POINT(125 43)')),
1155 ('o', 'r', 'f', GeomFromText('POINT(171 140)'));
1156 UPDATE t1 set spatial_point=GeomFromText('POINT(163 157)') where c1 like 'w%';
1157 UPDATE t1 set spatial_point=GeomFromText('POINT(53 151)') where c1 like 'd%';
1158 UPDATE t1 set spatial_point=GeomFromText('POINT(96 183)') where c1 like 'r%';
1159 UPDATE t1 set spatial_point=GeomFromText('POINT(57 91)') where c1 like 'q%';
1160 UPDATE t1 set spatial_point=GeomFromText('POINT(202 110)') where c1 like 'c%';
1161 UPDATE t1 set spatial_point=GeomFromText('POINT(120 137)') where c1 like 'w%';
1162 UPDATE t1 set spatial_point=GeomFromText('POINT(207 147)') where c1 like 'c%';
1163 UPDATE t1 set spatial_point=GeomFromText('POINT(31 125)') where c1 like 'e%';
1164 UPDATE t1 set spatial_point=GeomFromText('POINT(27 36)') where c1 like 'r%';
1165 INSERT INTO t1 (c2, c1, c3, spatial_point) VALUES
1166 ('b', 'c', 'e', GeomFromText('POINT(41 137)')),
1167 ('p', 'y', 'k', GeomFromText('POINT(50 22)')),
1168 ('s', 'c', 'h', GeomFromText('POINT(208 173)')),
1169 ('x', 'u', 'l', GeomFromText('POINT(199 175)')),
1170 ('s', 'r', 'h', GeomFromText('POINT(85 192)')),
1171 ('j', 'k', 'u', GeomFromText('POINT(18 25)')),
1172 ('p', 'w', 'h', GeomFromText('POINT(152 197)')),
1173 ('e', 'd', 'c', GeomFromText('POINT(229 3)')),
1174 ('o', 'x', 'k', GeomFromText('POINT(187 155)')),
1175 ('o', 'b', 'k', GeomFromText('POINT(208 150)')),
1176 ('d', 'a', 'j', GeomFromText('POINT(70 87)')),
1177 ('f', 'e', 'k', GeomFromText('POINT(156 96)')),
1178 ('u', 'y', 'p', GeomFromText('POINT(239 193)')),
1179 ('n', 'v', 'p', GeomFromText('POINT(223 98)')),
1180 ('z', 'j', 'r', GeomFromText('POINT(87 89)')),
1181 ('h', 'x', 'x', GeomFromText('POINT(92 0)')),
1182 ('r', 'v', 'r', GeomFromText('POINT(159 139)')),
1183 ('v', 'g', 'g', GeomFromText('POINT(16 229)')),
1184 ('z', 'k', 'u', GeomFromText('POINT(99 52)')),
1185 ('p', 'p', 'o', GeomFromText('POINT(105 125)')),
1186 ('w', 'h', 'y', GeomFromText('POINT(105 154)')),
1187 ('v', 'y', 'z', GeomFromText('POINT(134 238)')),
1188 ('x', 'o', 'o', GeomFromText('POINT(178 88)')),
1189 ('z', 'w', 'd', GeomFromText('POINT(123 60)')),
1190 ('q', 'f', 'u', GeomFromText('POINT(64 90)')),
1191 ('s', 'n', 't', GeomFromText('POINT(50 138)')),
1192 ('v', 'p', 't', GeomFromText('POINT(114 91)')),
1193 ('a', 'o', 'n', GeomFromText('POINT(78 43)')),
1194 ('k', 'u', 'd', GeomFromText('POINT(185 161)')),
1195 ('w', 'd', 'n', GeomFromText('POINT(25 92)')),
1196 ('k', 'w', 'a', GeomFromText('POINT(59 238)')),
1197 ('t', 'c', 'f', GeomFromText('POINT(65 87)')),
1198 ('g', 's', 'p', GeomFromText('POINT(238 126)')),
1199 ('d', 'n', 'y', GeomFromText('POINT(107 173)')),
1200 ('l', 'a', 'w', GeomFromText('POINT(125 152)')),
1201 ('m', 'd', 'j', GeomFromText('POINT(146 53)')),
1202 ('q', 'm', 'c', GeomFromText('POINT(217 187)')),
1203 ('i', 'r', 'r', GeomFromText('POINT(6 113)')),
1204 ('e', 'j', 'b', GeomFromText('POINT(37 83)')),
1205 ('w', 'w', 'h', GeomFromText('POINT(83 199)')),
1206 ('k', 'b', 's', GeomFromText('POINT(170 64)')),
1207 ('s', 'b', 'c', GeomFromText('POINT(163 130)')),
1208 ('c', 'h', 'a', GeomFromText('POINT(141 3)')),
1209 ('k', 'j', 'u', GeomFromText('POINT(143 76)')),
1210 ('r', 'h', 'o', GeomFromText('POINT(243 92)')),
1211 ('i', 'd', 'b', GeomFromText('POINT(205 13)')),
1212 ('r', 'y', 'q', GeomFromText('POINT(138 8)')),
1213 ('m', 'o', 'i', GeomFromText('POINT(36 45)')),
1214 ('v', 'g', 'm', GeomFromText('POINT(0 40)')),
1215 ('f', 'e', 'i', GeomFromText('POINT(76 6)')),
1216 ('c', 'q', 'q', GeomFromText('POINT(115 248)')),
1217 ('x', 'c', 'i', GeomFromText('POINT(29 74)')),
1218 ('l', 's', 't', GeomFromText('POINT(83 18)')),
1219 ('t', 't', 'a', GeomFromText('POINT(26 168)')),
1220 ('u', 'n', 'x', GeomFromText('POINT(200 110)')),
1221 ('j', 'b', 'd', GeomFromText('POINT(216 136)')),
1222 ('s', 'p', 'w', GeomFromText('POINT(38 156)')),
1223 ('f', 'b', 'v', GeomFromText('POINT(29 186)')),
1224 ('v', 'e', 'r', GeomFromText('POINT(149 40)')),
1225 ('v', 't', 'm', GeomFromText('POINT(184 24)')),
1226 ('y', 'g', 'a', GeomFromText('POINT(219 105)')),
1227 ('s', 'f', 'i', GeomFromText('POINT(114 130)')),
1228 ('e', 'q', 'h', GeomFromText('POINT(203 135)')),
1229 ('h', 'g', 'b', GeomFromText('POINT(9 208)')),
1230 ('o', 'l', 'r', GeomFromText('POINT(245 79)')),
1231 ('s', 's', 'v', GeomFromText('POINT(238 198)')),
1232 ('w', 'w', 'z', GeomFromText('POINT(209 232)')),
1233 ('v', 'd', 'n', GeomFromText('POINT(30 193)')),
1234 ('q', 'w', 'k', GeomFromText('POINT(133 18)')),
1235 ('o', 'h', 'o', GeomFromText('POINT(42 140)')),
1236 ('f', 'f', 'h', GeomFromText('POINT(145 1)')),
1237 ('u', 's', 'r', GeomFromText('POINT(70 62)')),
1238 ('x', 'n', 'q', GeomFromText('POINT(33 86)')),
1239 ('u', 'p', 'v', GeomFromText('POINT(232 220)')),
1240 ('z', 'e', 'a', GeomFromText('POINT(130 69)')),
1241 ('r', 'u', 'z', GeomFromText('POINT(243 241)')),
1242 ('b', 'n', 't', GeomFromText('POINT(120 12)')),
1243 ('u', 'f', 's', GeomFromText('POINT(190 212)')),
1244 ('a', 'd', 'q', GeomFromText('POINT(235 191)')),
1245 ('f', 'q', 'm', GeomFromText('POINT(176 2)')),
1246 ('n', 'c', 's', GeomFromText('POINT(218 163)')),
1247 ('e', 'm', 'h', GeomFromText('POINT(163 108)')),
1248 ('c', 'f', 'l', GeomFromText('POINT(220 115)')),
1249 ('c', 'v', 'q', GeomFromText('POINT(66 45)')),
1250 ('w', 'v', 'x', GeomFromText('POINT(251 220)')),
1251 ('f', 'w', 'z', GeomFromText('POINT(146 149)')),
1252 ('h', 'n', 'h', GeomFromText('POINT(148 128)')),
1253 ('y', 'k', 'v', GeomFromText('POINT(28 110)')),
1254 ('c', 'x', 'q', GeomFromText('POINT(13 13)')),
1255 ('e', 'd', 's', GeomFromText('POINT(91 190)')),
1256 ('c', 'w', 'c', GeomFromText('POINT(10 231)')),
1257 ('u', 'j', 'n', GeomFromText('POINT(250 21)')),
1258 ('w', 'n', 'x', GeomFromText('POINT(141 69)')),
1259 ('f', 'p', 'y', GeomFromText('POINT(228 246)')),
1260 ('d', 'q', 'f', GeomFromText('POINT(194 22)')),
1261 ('d', 'z', 'l', GeomFromText('POINT(233 181)')),
1262 ('c', 'a', 'q', GeomFromText('POINT(183 96)')),
1263 ('m', 'i', 'd', GeomFromText('POINT(117 226)')),
1264 ('z', 'y', 'y', GeomFromText('POINT(62 81)')),
1265 ('g', 'v', 'm', GeomFromText('POINT(66 158)'));
1266 SET @@RAND_SEED1=481064922, @@RAND_SEED2=438133497;
1267 DELETE FROM t1 ORDER BY RAND() LIMIT 10;
1268 SET @@RAND_SEED1=280535103, @@RAND_SEED2=444518646;
1269 DELETE FROM t1 ORDER BY RAND() LIMIT 10;
1270 SET @@RAND_SEED1=1072017234, @@RAND_SEED2=484203885;
1271 DELETE FROM t1 ORDER BY RAND() LIMIT 10;
1272 SET @@RAND_SEED1=358851897, @@RAND_SEED2=358495224;
1273 DELETE FROM t1 ORDER BY RAND() LIMIT 10;
1274 SET @@RAND_SEED1=509031459, @@RAND_SEED2=675962925;
1275 DELETE FROM t1 ORDER BY RAND() LIMIT 10;
1276 UPDATE t1 set spatial_point=GeomFromText('POINT(61 203)') where c1 like 'y%';
1277 UPDATE t1 set spatial_point=GeomFromText('POINT(202 194)') where c1 like 'f%';
1278 UPDATE t1 set spatial_point=GeomFromText('POINT(228 18)') where c1 like 'h%';
1279 UPDATE t1 set spatial_point=GeomFromText('POINT(88 18)') where c1 like 'l%';
1280 UPDATE t1 set spatial_point=GeomFromText('POINT(176 94)') where c1 like 'e%';
1281 UPDATE t1 set spatial_point=GeomFromText('POINT(44 47)') where c1 like 'g%';
1282 UPDATE t1 set spatial_point=GeomFromText('POINT(95 191)') where c1 like 'b%';
1283 UPDATE t1 set spatial_point=GeomFromText('POINT(179 218)') where c1 like 'y%';
1284 UPDATE t1 set spatial_point=GeomFromText('POINT(239 40)') where c1 like 'g%';
1285 UPDATE t1 set spatial_point=GeomFromText('POINT(248 41)') where c1 like 'q%';
1286 UPDATE t1 set spatial_point=GeomFromText('POINT(167 82)') where c1 like 't%';
1287 UPDATE t1 set spatial_point=GeomFromText('POINT(13 104)') where c1 like 'u%';
1288 UPDATE t1 set spatial_point=GeomFromText('POINT(139 84)') where c1 like 'a%';
1289 UPDATE t1 set spatial_point=GeomFromText('POINT(145 108)') where c1 like 'p%';
1290 UPDATE t1 set spatial_point=GeomFromText('POINT(147 57)') where c1 like 't%';
1291 UPDATE t1 set spatial_point=GeomFromText('POINT(217 144)') where c1 like 'n%';
1292 UPDATE t1 set spatial_point=GeomFromText('POINT(160 224)') where c1 like 'w%';
1293 UPDATE t1 set spatial_point=GeomFromText('POINT(38 28)') where c1 like 'j%';
1294 UPDATE t1 set spatial_point=GeomFromText('POINT(104 114)') where c1 like 'q%';
1295 UPDATE t1 set spatial_point=GeomFromText('POINT(88 19)') where c1 like 'c%';
1296 INSERT INTO t1 (c2, c1, c3, spatial_point) VALUES
1297 ('f', 'x', 'p', GeomFromText('POINT(92 181)')),
1298 ('s', 'i', 'c', GeomFromText('POINT(49 60)')),
1299 ('c', 'c', 'i', GeomFromText('POINT(7 57)')),
1300 ('n', 'g', 'k', GeomFromText('POINT(252 105)')),
1301 ('g', 'b', 'm', GeomFromText('POINT(180 11)')),
1302 ('u', 'l', 'r', GeomFromText('POINT(32 90)')),
1303 ('c', 'x', 'e', GeomFromText('POINT(143 24)')),
1304 ('x', 'u', 'a', GeomFromText('POINT(123 92)')),
1305 ('s', 'b', 'h', GeomFromText('POINT(190 108)')),
1306 ('c', 'x', 'b', GeomFromText('POINT(104 100)')),
1307 ('i', 'd', 't', GeomFromText('POINT(214 104)')),
1308 ('r', 'w', 'g', GeomFromText('POINT(29 67)')),
1309 ('b', 'f', 'g', GeomFromText('POINT(149 46)')),
1310 ('r', 'r', 'd', GeomFromText('POINT(242 196)')),
1311 ('j', 'l', 'a', GeomFromText('POINT(90 196)')),
1312 ('e', 't', 'b', GeomFromText('POINT(190 64)')),
1313 ('l', 'x', 'w', GeomFromText('POINT(250 73)')),
1314 ('q', 'y', 'r', GeomFromText('POINT(120 182)')),
1315 ('s', 'j', 'a', GeomFromText('POINT(180 175)')),
1316 ('n', 'i', 'y', GeomFromText('POINT(124 136)')),
1317 ('s', 'x', 's', GeomFromText('POINT(176 209)')),
1318 ('u', 'f', 's', GeomFromText('POINT(215 173)')),
1319 ('m', 'j', 'x', GeomFromText('POINT(44 140)')),
1320 ('v', 'g', 'x', GeomFromText('POINT(177 233)')),
1321 ('u', 't', 'b', GeomFromText('POINT(136 197)')),
1322 ('f', 'g', 'b', GeomFromText('POINT(10 8)')),
1323 ('v', 'c', 'j', GeomFromText('POINT(13 81)')),
1324 ('d', 's', 'q', GeomFromText('POINT(200 100)')),
1325 ('a', 'p', 'j', GeomFromText('POINT(33 40)')),
1326 ('i', 'c', 'g', GeomFromText('POINT(168 204)')),
1327 ('k', 'h', 'i', GeomFromText('POINT(93 243)')),
1328 ('s', 'b', 's', GeomFromText('POINT(157 13)')),
1329 ('v', 'l', 'l', GeomFromText('POINT(103 6)')),
1330 ('r', 'b', 'k', GeomFromText('POINT(244 137)')),
1331 ('l', 'd', 'r', GeomFromText('POINT(162 254)')),
1332 ('q', 'b', 'z', GeomFromText('POINT(136 246)')),
1333 ('x', 'x', 'p', GeomFromText('POINT(120 37)')),
1334 ('m', 'e', 'z', GeomFromText('POINT(203 167)')),
1335 ('q', 'n', 'p', GeomFromText('POINT(94 119)')),
1336 ('b', 'g', 'u', GeomFromText('POINT(93 248)')),
1337 ('r', 'v', 'v', GeomFromText('POINT(53 88)')),
1338 ('y', 'a', 'i', GeomFromText('POINT(98 219)')),
1339 ('a', 's', 'g', GeomFromText('POINT(173 138)')),
1340 ('c', 'a', 't', GeomFromText('POINT(235 135)')),
1341 ('q', 'm', 'd', GeomFromText('POINT(224 208)')),
1342 ('e', 'p', 'k', GeomFromText('POINT(161 238)')),
1343 ('n', 'g', 'q', GeomFromText('POINT(35 204)')),
1344 ('t', 't', 'x', GeomFromText('POINT(230 178)')),
1345 ('w', 'f', 'a', GeomFromText('POINT(150 221)')),
1346 ('z', 'm', 'z', GeomFromText('POINT(119 42)')),
1347 ('l', 'j', 's', GeomFromText('POINT(97 96)')),
1348 ('f', 'z', 'x', GeomFromText('POINT(208 65)')),
1349 ('i', 'v', 'c', GeomFromText('POINT(145 79)')),
1350 ('l', 'f', 'k', GeomFromText('POINT(83 234)')),
1351 ('u', 'a', 's', GeomFromText('POINT(250 49)')),
1352 ('o', 'k', 'p', GeomFromText('POINT(46 50)')),
1353 ('d', 'e', 'z', GeomFromText('POINT(30 198)')),
1354 ('r', 'r', 'l', GeomFromText('POINT(78 189)')),
1355 ('y', 'l', 'f', GeomFromText('POINT(188 132)')),
1356 ('d', 'q', 'm', GeomFromText('POINT(247 107)')),
1357 ('p', 'j', 'n', GeomFromText('POINT(148 227)')),
1358 ('b', 'o', 'i', GeomFromText('POINT(172 25)')),
1359 ('e', 'v', 'd', GeomFromText('POINT(94 248)')),
1360 ('q', 'd', 'f', GeomFromText('POINT(15 29)')),
1361 ('w', 'b', 'b', GeomFromText('POINT(74 111)')),
1362 ('g', 'q', 'f', GeomFromText('POINT(107 215)')),
1363 ('o', 'h', 'r', GeomFromText('POINT(25 168)')),
1364 ('u', 't', 'w', GeomFromText('POINT(251 188)')),
1365 ('h', 's', 'w', GeomFromText('POINT(254 247)')),
1366 ('f', 'f', 'b', GeomFromText('POINT(166 103)'));
1367 SET @@RAND_SEED1=866613816, @@RAND_SEED2=92289615;
1368 INSERT INTO t1 (c2, c1, c3, spatial_point) VALUES
1369 ('l', 'c', 'l', GeomFromText('POINT(202 98)')),
1370 ('k', 'c', 'b', GeomFromText('POINT(46 206)')),
1371 ('r', 'y', 'm', GeomFromText('POINT(74 140)')),
1372 ('y', 'z', 'd', GeomFromText('POINT(200 160)')),
1373 ('s', 'y', 's', GeomFromText('POINT(156 205)')),
1374 ('u', 'v', 'p', GeomFromText('POINT(86 82)')),
1375 ('j', 's', 's', GeomFromText('POINT(91 233)')),
1376 ('x', 'j', 'f', GeomFromText('POINT(3 14)')),
1377 ('l', 'z', 'v', GeomFromText('POINT(123 156)')),
1378 ('h', 'i', 'o', GeomFromText('POINT(145 229)')),
1379 ('o', 'r', 'd', GeomFromText('POINT(15 22)')),
1380 ('f', 'x', 't', GeomFromText('POINT(21 60)')),
1381 ('t', 'g', 'h', GeomFromText('POINT(50 153)')),
1382 ('g', 'u', 'b', GeomFromText('POINT(82 85)')),
1383 ('v', 'a', 'p', GeomFromText('POINT(231 178)')),
1384 ('n', 'v', 'o', GeomFromText('POINT(183 25)')),
1385 ('j', 'n', 'm', GeomFromText('POINT(50 144)')),
1386 ('e', 'f', 'i', GeomFromText('POINT(46 16)')),
1387 ('d', 'w', 'a', GeomFromText('POINT(66 6)')),
1388 ('f', 'x', 'a', GeomFromText('POINT(107 197)')),
1389 ('m', 'o', 'a', GeomFromText('POINT(142 80)')),
1390 ('q', 'l', 'g', GeomFromText('POINT(251 23)')),
1391 ('c', 's', 's', GeomFromText('POINT(158 43)')),
1392 ('y', 'd', 'o', GeomFromText('POINT(196 228)')),
1393 ('d', 'p', 'l', GeomFromText('POINT(107 5)')),
1394 ('h', 'a', 'b', GeomFromText('POINT(183 166)')),
1395 ('m', 'w', 'p', GeomFromText('POINT(19 59)')),
1396 ('b', 'y', 'o', GeomFromText('POINT(178 30)')),
1397 ('x', 'w', 'i', GeomFromText('POINT(168 94)')),
1398 ('t', 'k', 'z', GeomFromText('POINT(171 5)')),
1399 ('r', 'm', 'a', GeomFromText('POINT(222 19)')),
1400 ('u', 'v', 'e', GeomFromText('POINT(224 80)')),
1401 ('q', 'r', 'k', GeomFromText('POINT(212 218)')),
1402 ('d', 'p', 'j', GeomFromText('POINT(169 7)')),
1403 ('d', 'r', 'v', GeomFromText('POINT(193 23)')),
1404 ('n', 'y', 'y', GeomFromText('POINT(130 178)')),
1405 ('m', 'z', 'r', GeomFromText('POINT(81 200)')),
1406 ('j', 'e', 'w', GeomFromText('POINT(145 239)')),
1407 ('v', 'h', 'x', GeomFromText('POINT(24 105)')),
1408 ('z', 'm', 'a', GeomFromText('POINT(175 129)')),
1409 ('b', 'c', 'v', GeomFromText('POINT(213 10)')),
1410 ('t', 't', 'u', GeomFromText('POINT(2 129)')),
1411 ('r', 's', 'v', GeomFromText('POINT(209 192)')),
1412 ('x', 'p', 'g', GeomFromText('POINT(43 63)')),
1413 ('t', 'e', 'u', GeomFromText('POINT(139 210)')),
1414 ('l', 'e', 't', GeomFromText('POINT(245 148)')),
1415 ('a', 'i', 'k', GeomFromText('POINT(167 195)')),
1416 ('m', 'o', 'h', GeomFromText('POINT(206 120)')),
1417 ('g', 'z', 's', GeomFromText('POINT(169 240)')),
1418 ('z', 'u', 's', GeomFromText('POINT(202 120)')),
1419 ('i', 'b', 'a', GeomFromText('POINT(216 18)')),
1420 ('w', 'y', 'g', GeomFromText('POINT(119 236)')),
1421 ('h', 'y', 'p', GeomFromText('POINT(161 24)'));
1422 UPDATE t1 set spatial_point=GeomFromText('POINT(33 100)') where c1 like 't%';
1423 UPDATE t1 set spatial_point=GeomFromText('POINT(41 46)') where c1 like 'f%';
1424 CHECK TABLE t1 EXTENDED;
1425 Table Op Msg_type Msg_text
1426 test.t1 check status OK
1428 create table t1 (a geometry not null, spatial index(a));
1429 insert into t1 values (POINT(1.1517219314031e+164, 131072));
1430 insert into t1 values (POINT(9.1248812352444e+192, 2.9740338169556e+284));
1431 insert into t1 values (POINT(4.7783097267365e-299, -0));
1432 insert into t1 values (POINT(1.49166814624e-154, 2.0880974297595e-53));
1433 insert into t1 values (POINT(4.0917382598702e+149, 1.2024538023802e+111));
1434 insert into t1 values (POINT(2.0349165139404e+236, 2.9993936277913e-241));
1435 insert into t1 values (POINT(2.5243548967072e-29, 1.2024538023802e+111));
1436 insert into t1 values (POINT(0, 6.9835074892995e-251));
1437 insert into t1 values (POINT(2.0880974297595e-53, 3.1050361846014e+231));
1438 insert into t1 values (POINT(2.8728483499323e-188, 2.4600631144627e+260));
1439 insert into t1 values (POINT(3.0517578125e-05, 2.0349165139404e+236));
1440 insert into t1 values (POINT(1.1517219314031e+164, 1.1818212630766e-125));
1441 insert into t1 values (POINT(2.481040258324e-265, 5.7766220027675e-275));
1442 insert into t1 values (POINT(2.0880974297595e-53, 2.5243548967072e-29));
1443 insert into t1 values (POINT(5.7766220027675e-275, 9.9464647281957e+86));
1444 insert into t1 values (POINT(2.2181357552967e+130, 3.7857669957337e-270));
1445 insert into t1 values (POINT(4.5767114681874e-246, 3.6893488147419e+19));
1446 insert into t1 values (POINT(4.5767114681874e-246, 3.7537584144024e+255));
1447 insert into t1 values (POINT(3.7857669957337e-270, 1.8033161362863e-130));
1448 insert into t1 values (POINT(0, 5.8774717541114e-39));
1449 insert into t1 values (POINT(1.1517219314031e+164, 2.2761049594727e-159));
1450 insert into t1 values (POINT(6.243497100632e+144, 3.7857669957337e-270));
1451 insert into t1 values (POINT(3.7857669957337e-270, 2.6355494858076e-82));
1452 insert into t1 values (POINT(2.0349165139404e+236, 3.8518598887745e-34));
1453 insert into t1 values (POINT(4.6566128730774e-10, 2.0880974297595e-53));
1454 insert into t1 values (POINT(2.0880974297595e-53, 1.8827498946116e-183));
1455 insert into t1 values (POINT(1.8033161362863e-130, 9.1248812352444e+192));
1456 insert into t1 values (POINT(4.7783097267365e-299, 2.2761049594727e-159));
1457 insert into t1 values (POINT(1.94906280228e+289, 1.2338789709327e-178));
1459 CREATE TABLE t1(foo GEOMETRY NOT NULL, SPATIAL INDEX(foo) );
1460 INSERT INTO t1(foo) VALUES (NULL);
1461 ERROR 23000: Column 'foo' cannot be null
1462 INSERT INTO t1() VALUES ();
1463 ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
1464 INSERT INTO t1(foo) VALUES ('');
1465 ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
1467 CREATE TABLE t1 (a INT AUTO_INCREMENT, b POINT NOT NULL, KEY (a), SPATIAL KEY (b));
1468 INSERT INTO t1 (b) VALUES (GeomFromText('POINT(1 2)'));
1469 INSERT INTO t1 (b) SELECT b FROM t1;
1470 INSERT INTO t1 (b) SELECT b FROM t1;
1471 INSERT INTO t1 (b) SELECT b FROM t1;
1472 INSERT INTO t1 (b) SELECT b FROM t1;
1473 INSERT INTO t1 (b) SELECT b FROM t1;
1475 Table Op Msg_type Msg_text
1476 test.t1 optimize status OK
1478 CREATE TABLE t1 (a INT, b GEOMETRY NOT NULL, SPATIAL KEY b(b));
1479 INSERT INTO t1 VALUES (1, GEOMFROMTEXT('LINESTRING(1102218.456 1,2000000 2)'));
1480 INSERT INTO t1 VALUES (2, GEOMFROMTEXT('LINESTRING(1102218.456 1,2000000 2)'));
1481 SELECT COUNT(*) FROM t1 WHERE
1482 MBRINTERSECTS(b, GEOMFROMTEXT('LINESTRING(1 1,1102219 2)') );
1485 SELECT COUNT(*) FROM t1 IGNORE INDEX (b) WHERE
1486 MBRINTERSECTS(b, GEOMFROMTEXT('LINESTRING(1 1,1102219 2)') );
1491 # Bug #48258: Assertion failed when using a spatial index
1493 CREATE TABLE t1(a LINESTRING NOT NULL, SPATIAL KEY(a));
1494 INSERT INTO t1 VALUES
1495 (GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)')),
1496 (GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)'));
1497 EXPLAIN SELECT 1 FROM t1 WHERE a = GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)');
1498 id select_type table type possible_keys key key_len ref rows Extra
1499 1 SIMPLE t1 ALL a NULL NULL NULL 2 Using where
1500 SELECT 1 FROM t1 WHERE a = GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)');
1504 EXPLAIN SELECT 1 FROM t1 WHERE a < GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)');
1505 id select_type table type possible_keys key key_len ref rows Extra
1506 1 SIMPLE t1 ALL a NULL NULL NULL 2 Using where
1507 SELECT 1 FROM t1 WHERE a < GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)');
1509 EXPLAIN SELECT 1 FROM t1 WHERE a <= GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)');
1510 id select_type table type possible_keys key key_len ref rows Extra
1511 1 SIMPLE t1 ALL a NULL NULL NULL 2 Using where
1512 SELECT 1 FROM t1 WHERE a <= GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)');
1516 EXPLAIN SELECT 1 FROM t1 WHERE a > GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)');
1517 id select_type table type possible_keys key key_len ref rows Extra
1518 1 SIMPLE t1 ALL a NULL NULL NULL 2 Using where
1519 SELECT 1 FROM t1 WHERE a > GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)');
1521 EXPLAIN SELECT 1 FROM t1 WHERE a >= GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)');
1522 id select_type table type possible_keys key key_len ref rows Extra
1523 1 SIMPLE t1 ALL a NULL NULL NULL 2 Using where
1524 SELECT 1 FROM t1 WHERE a >= GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)');
1530 # Bug #51357: crash when using handler commands on spatial indexes
1532 CREATE TABLE t1(a GEOMETRY NOT NULL,SPATIAL INDEX a(a));
1534 HANDLER t1 READ a FIRST;
1536 HANDLER t1 READ a NEXT;
1538 HANDLER t1 READ a PREV;
1540 HANDLER t1 READ a LAST;
1544 HANDLER t1 READ a FIRST;
1546 INSERT INTO t1 VALUES (GeomFromText('Polygon((40 40,60 40,60 60,40 60,40 40))'));
1548 HANDLER t1 READ a NEXT;
1553 # Bug #57323/11764487: myisam corruption with insert ignore
1554 # and invalid spatial data
1556 CREATE TABLE t1(a LINESTRING NOT NULL, b GEOMETRY NOT NULL,
1557 SPATIAL KEY(a), SPATIAL KEY(b)) ENGINE=MyISAM;
1558 INSERT INTO t1 VALUES(GEOMFROMTEXT("point (0 0)"), GEOMFROMTEXT("point (1 1)"));
1559 INSERT IGNORE INTO t1 SET a=GEOMFROMTEXT("point (-6 0)"), b=GEOMFROMTEXT("error");
1560 ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
1561 INSERT IGNORE INTO t1 SET a=GEOMFROMTEXT("point (-6 0)"), b=NULL;
1562 ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
1563 SELECT ASTEXT(a), ASTEXT(b) FROM t1;
1565 POINT(0 0) POINT(1 1)
1567 CREATE TABLE t1(a INT NOT NULL, b GEOMETRY NOT NULL,
1568 KEY(a), SPATIAL KEY(b)) ENGINE=MyISAM;
1569 INSERT INTO t1 VALUES(0, GEOMFROMTEXT("point (1 1)"));
1570 INSERT IGNORE INTO t1 SET a=0, b=GEOMFROMTEXT("error");
1571 ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
1572 INSERT IGNORE INTO t1 SET a=1, b=NULL;
1573 ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
1574 SELECT a, ASTEXT(b) FROM t1;