Debian Codegraph @

mysql-test/suite/maria/maria-gis-rtree-dynamic.test

raw
1 -- source include/have_maria.inc
2 -- source include/have_geometry.inc
3
4 set default_storage_engine=aria;
5
6 #
7 # test of rtree (using with spatial data)
8 #
9 --disable_warnings
10 DROP TABLE IF EXISTS t1, t2;
11 --enable_warnings
12
13 CREATE TABLE t1 (
14 fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
15 g GEOMETRY NOT NULL,
16 SPATIAL KEY(g)
17 ) row_format=dynamic;
18
19 SHOW CREATE TABLE t1;
20
21 let $1=150;
22 let $2=150;
23 while ($1)
24 {
25 eval INSERT INTO t1 (g) VALUES (GeomFromText('LineString($1 $1, $2 $2)'));
26 dec $1;
27 inc $2;
28 }
29
30 SELECT count(*) FROM t1;
31 EXPLAIN SELECT fid, AsText(g) FROM t1 WHERE Within(g, GeomFromText('Polygon((140 140,160 140,160 160,140 160,140 140))'));
32 SELECT fid, AsText(g) FROM t1 WHERE Within(g, GeomFromText('Polygon((140 140,160 140,160 160,140 160,140 140))'));
33
34 DROP TABLE t1;
35
36 CREATE TABLE t2 (
37 fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
38 g GEOMETRY NOT NULL
39 ) row_format=dynamic;
40
41 let $1=10;
42 while ($1)
43 {
44 let $2=10;
45 while ($2)
46 {
47 eval INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point($1 * 10 - 9, $2 * 10 - 9), Point($1 * 10, $2 * 10))));
48 dec $2;
49 }
50 dec $1;
51 }
52
53 ALTER TABLE t2 ADD SPATIAL KEY(g);
54 SHOW CREATE TABLE t2;
55 SELECT count(*) FROM t2;
56 EXPLAIN SELECT fid, AsText(g) FROM t2 WHERE Within(g,
57 GeomFromText('Polygon((40 40,60 40,60 60,40 60,40 40))'));
58 SELECT fid, AsText(g) FROM t2 WHERE Within(g,
59 GeomFromText('Polygon((40 40,60 40,60 60,40 60,40 40))'));
60
61 let $1=10;
62 while ($1)
63 {
64 let $2=10;
65 while ($2)
66 {
67 eval DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point($1 * 10 - 9, $2 * 10 - 9), Point($1 * 10, $2 * 10)))));
68 SELECT count(*) FROM t2;
69 dec $2;
70 }
71 dec $1;
72 }
73
74 DROP TABLE t2;
75
76 drop table if exists t1;
77 CREATE TABLE t1 (a geometry NOT NULL, SPATIAL (a)) row_format=dynamic;
78 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
79 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
80 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
81 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
82 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
83 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
84 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
85 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
86 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
87 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
88 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
89 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
90 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
91 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
92 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
93 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
94 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
95 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
96 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
97 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
98 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
99 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
100 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
101 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
102 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
103 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
104 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
105 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
106 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
107 check table t1;
108 analyze table t1;
109 drop table t1;
110
111 #
112 # The following crashed gis
113 #
114
115 CREATE TABLE t1 (
116 fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
117 g GEOMETRY NOT NULL,
118 SPATIAL KEY(g)
119 ) row_format=dynamic;
120
121 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(1 2, 2 3)')),(GeomFromText('LineString(1 2, 2 4)'));
122 #select * from t1 where g<GeomFromText('LineString(1 2, 2 3)');
123 drop table t1;
124
125 CREATE TABLE t1 (
126 line LINESTRING NOT NULL,
127 kind ENUM('po', 'pp', 'rr', 'dr', 'rd', 'ts', 'cl') NOT NULL DEFAULT 'po',
128 name VARCHAR(32),
129
130 SPATIAL KEY (line)
131
132
133 ) row_format=dynamic;
134
135 ALTER TABLE t1 DISABLE KEYS;
136
137 INSERT INTO t1 (name, kind, line) VALUES
138 ("Aadaouane", "pp", GeomFromText("LINESTRING(32.816667 35.983333)")),
139 ("Aadassiye", "pp", GeomFromText("LINESTRING(35.816667 36.216667)")),
140 ("Aadbel", "pp", GeomFromText("LINESTRING(34.533333 36.100000)")),
141 ("Aadchit", "pp", GeomFromText("LINESTRING(33.347222 35.423611)")),
142 ("Aadchite", "pp", GeomFromText("LINESTRING(33.347222 35.423611)")),
143 ("Aadchit el Qoussair", "pp", GeomFromText("LINESTRING(33.283333 35.483333)")),
144 ("Aaddaye", "pp", GeomFromText("LINESTRING(36.716667 40.833333)")),
145 ("'Aadeissa", "pp", GeomFromText("LINESTRING(32.823889 35.698889)")),
146 ("Aaderup", "pp", GeomFromText("LINESTRING(55.216667 11.766667)")),
147 ("Qalaat Aades", "pp", GeomFromText("LINESTRING(33.503333 35.377500)")),
148 ("A ad'ino", "pp", GeomFromText("LINESTRING(54.812222 38.209167)")),
149 ("Aadi Noia", "pp", GeomFromText("LINESTRING(13.800000 39.833333)")),
150 ("Aad La Macta", "pp", GeomFromText("LINESTRING(35.779444 -0.129167)")),
151 ("Aadland", "pp", GeomFromText("LINESTRING(60.366667 5.483333)")),
152 ("Aadliye", "pp", GeomFromText("LINESTRING(33.366667 36.333333)")),
153 ("Aadloun", "pp", GeomFromText("LINESTRING(33.403889 35.273889)")),
154 ("Aadma", "pp", GeomFromText("LINESTRING(58.798333 22.663889)")),
155 ("Aadma Asundus", "pp", GeomFromText("LINESTRING(58.798333 22.663889)")),
156 ("Aadmoun", "pp", GeomFromText("LINESTRING(34.150000 35.650000)")),
157 ("Aadneram", "pp", GeomFromText("LINESTRING(59.016667 6.933333)")),
158 ("Aadneskaar", "pp", GeomFromText("LINESTRING(58.083333 6.983333)")),
159 ("Aadorf", "pp", GeomFromText("LINESTRING(47.483333 8.900000)")),
160 ("Aadorp", "pp", GeomFromText("LINESTRING(52.366667 6.633333)")),
161 ("Aadouane", "pp", GeomFromText("LINESTRING(32.816667 35.983333)")),
162 ("Aadoui", "pp", GeomFromText("LINESTRING(34.450000 35.983333)")),
163 ("Aadouiye", "pp", GeomFromText("LINESTRING(34.583333 36.183333)")),
164 ("Aadouss", "pp", GeomFromText("LINESTRING(33.512500 35.601389)")),
165 ("Aadra", "pp", GeomFromText("LINESTRING(33.616667 36.500000)")),
166 ("Aadzi", "pp", GeomFromText("LINESTRING(38.100000 64.850000)"));
167
168 ALTER TABLE t1 ENABLE KEYS;
169 INSERT INTO t1 (name, kind, line) VALUES ("austria", "pp", GeomFromText('LINESTRING(14.9906 48.9887,14.9946 48.9904,14.9947 48.9916)'));
170 drop table t1;
171
172 CREATE TABLE t1 (st varchar(100));
173 INSERT INTO t1 VALUES ("Fake string");
174 CREATE TABLE t2 (geom GEOMETRY NOT NULL, SPATIAL KEY gk(geom)) row_format=dynamic;
175 --error 1416
176 INSERT IGNORE INTO t2 SELECT GeomFromText(st) FROM t1;
177 drop table t1, t2;
178
179 CREATE TABLE t1 (`geometry` geometry NOT NULL, SPATIAL KEY `gndx` (`geometry`)) row_format=dynamic DEFAULT CHARSET=latin1;
180
181 INSERT INTO t1 (geometry) VALUES
182 (PolygonFromText('POLYGON((-18.6086111000 -66.9327777000, -18.6055555000
183 -66.8158332999, -18.7186111000 -66.8102777000, -18.7211111000 -66.9269443999,
184 -18.6086111000 -66.9327777000))'));
185
186 INSERT INTO t1 (geometry) VALUES
187 (PolygonFromText('POLYGON((-65.7402776999 -96.6686111000, -65.7372222000
188 -96.5516666000, -65.8502777000 -96.5461111000, -65.8527777000 -96.6627777000,
189 -65.7402776999 -96.6686111000))'));
190 check table t1 extended;
191
192 drop table t1;
193
194 #
195 # Bug#17877 - Corrupted spatial index
196 #
197 CREATE TABLE t1 (
198 c1 geometry NOT NULL,
199 SPATIAL KEY i1 (c1)
200 ) row_format=dynamic DEFAULT CHARSET=latin1;
201 INSERT INTO t1 (c1) VALUES (
202 PolygonFromText('POLYGON((-18.6086111000 -66.9327777000,
203 -18.6055555000 -66.8158332999,
204 -18.7186111000 -66.8102777000,
205 -18.7211111000 -66.9269443999,
206 -18.6086111000 -66.9327777000))'));
207 # This showed a missing key.
208 CHECK TABLE t1 EXTENDED;
209 DROP TABLE t1;
210 #
211 CREATE TABLE t1 (
212 c1 geometry NOT NULL,
213 SPATIAL KEY i1 (c1)
214 ) row_format=dynamic DEFAULT CHARSET=latin1;
215 INSERT INTO t1 (c1) VALUES (
216 PolygonFromText('POLYGON((-18.6086111000 -66.9327777000,
217 -18.6055555000 -66.8158332999,
218 -18.7186111000 -66.8102777000,
219 -18.7211111000 -66.9269443999,
220 -18.6086111000 -66.9327777000))'));
221 INSERT INTO t1 (c1) VALUES (
222 PolygonFromText('POLYGON((-65.7402776999 -96.6686111000,
223 -65.7372222000 -96.5516666000,
224 -65.8502777000 -96.5461111000,
225 -65.8527777000 -96.6627777000,
226 -65.7402776999 -96.6686111000))'));
227 # This is the same as the first insert to get a non-unique key.
228 INSERT INTO t1 (c1) VALUES (
229 PolygonFromText('POLYGON((-18.6086111000 -66.9327777000,
230 -18.6055555000 -66.8158332999,
231 -18.7186111000 -66.8102777000,
232 -18.7211111000 -66.9269443999,
233 -18.6086111000 -66.9327777000))'));
234 # This showed (and still shows) OK.
235 CHECK TABLE t1 EXTENDED;
236 DROP TABLE t1;
237
238 #
239 # Bug #21888: Query on GEOMETRY field using PointFromWKB() results in lost connection
240 #
241 CREATE TABLE t1 (foo GEOMETRY NOT NULL, SPATIAL INDEX(foo) ) row_format=dynamic;
242 INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(1,1)));
243 INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(1,0)));
244 INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(0,1)));
245 INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(0,0)));
246 SELECT 1 FROM t1 WHERE foo != PointFromWKB(POINT(0,0));
247 DROP TABLE t1;
248
249 #
250 # Bug#25673 - spatial index corruption, error 126 incorrect key file for table
251 #
252 CREATE TABLE t1 (id bigint(12) unsigned NOT NULL auto_increment,
253 c2 varchar(15) collate utf8_bin default NULL,
254 c1 varchar(15) collate utf8_bin default NULL,
255 c3 varchar(10) collate utf8_bin default NULL,
256 spatial_point point NOT NULL,
257 PRIMARY KEY(id),
258 SPATIAL KEY (spatial_point)
259 )row_format=dynamic DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
260 #
261 INSERT INTO t1 (c2, c1, c3, spatial_point) VALUES
262 ('y', 's', 'j', GeomFromText('POINT(167 74)')),
263 ('r', 'n', 'd', GeomFromText('POINT(215 118)')),
264 ('g', 'n', 'e', GeomFromText('POINT(203 98)')),
265 ('h', 'd', 'd', GeomFromText('POINT(54 193)')),
266 ('r', 'x', 'y', GeomFromText('POINT(47 69)')),
267 ('t', 'q', 'r', GeomFromText('POINT(109 42)')),
268 ('a', 'z', 'd', GeomFromText('POINT(0 154)')),
269 ('x', 'v', 'o', GeomFromText('POINT(174 131)')),
270 ('b', 'r', 'a', GeomFromText('POINT(114 253)')),
271 ('x', 'z', 'i', GeomFromText('POINT(163 21)')),
272 ('w', 'p', 'i', GeomFromText('POINT(42 102)')),
273 ('g', 'j', 'j', GeomFromText('POINT(170 133)')),
274 ('m', 'g', 'n', GeomFromText('POINT(28 22)')),
275 ('b', 'z', 'h', GeomFromText('POINT(174 28)')),
276 ('q', 'k', 'f', GeomFromText('POINT(233 73)')),
277 ('w', 'w', 'a', GeomFromText('POINT(124 200)')),
278 ('t', 'j', 'w', GeomFromText('POINT(252 101)')),
279 ('d', 'r', 'd', GeomFromText('POINT(98 18)')),
280 ('w', 'o', 'y', GeomFromText('POINT(165 31)')),
281 ('y', 'h', 't', GeomFromText('POINT(14 220)')),
282 ('d', 'p', 'u', GeomFromText('POINT(223 196)')),
283 ('g', 'y', 'g', GeomFromText('POINT(207 96)')),
284 ('x', 'm', 'n', GeomFromText('POINT(214 3)')),
285 ('g', 'v', 'e', GeomFromText('POINT(140 205)')),
286 ('g', 'm', 'm', GeomFromText('POINT(10 236)')),
287 ('i', 'r', 'j', GeomFromText('POINT(137 228)')),
288 ('w', 's', 'p', GeomFromText('POINT(115 6)')),
289 ('o', 'n', 'k', GeomFromText('POINT(158 129)')),
290 ('j', 'h', 'l', GeomFromText('POINT(129 72)')),
291 ('f', 'x', 'l', GeomFromText('POINT(139 207)')),
292 ('u', 'd', 'n', GeomFromText('POINT(125 109)')),
293 ('b', 'a', 'z', GeomFromText('POINT(30 32)')),
294 ('m', 'h', 'o', GeomFromText('POINT(251 251)')),
295 ('f', 'r', 'd', GeomFromText('POINT(243 211)')),
296 ('b', 'd', 'r', GeomFromText('POINT(232 80)')),
297 ('g', 'k', 'v', GeomFromText('POINT(15 100)')),
298 ('i', 'f', 'c', GeomFromText('POINT(109 66)')),
299 ('r', 't', 'j', GeomFromText('POINT(178 6)')),
300 ('y', 'n', 'f', GeomFromText('POINT(233 211)')),
301 ('f', 'y', 'm', GeomFromText('POINT(99 16)')),
302 ('z', 'q', 'l', GeomFromText('POINT(39 49)')),
303 ('j', 'c', 'r', GeomFromText('POINT(75 187)')),
304 ('c', 'y', 'y', GeomFromText('POINT(246 253)')),
305 ('w', 'u', 'd', GeomFromText('POINT(56 190)')),
306 ('n', 'q', 'm', GeomFromText('POINT(73 149)')),
307 ('d', 'y', 'a', GeomFromText('POINT(134 6)')),
308 ('z', 's', 'w', GeomFromText('POINT(216 225)')),
309 ('d', 'u', 'k', GeomFromText('POINT(132 70)')),
310 ('f', 'v', 't', GeomFromText('POINT(187 141)')),
311 ('r', 'r', 'a', GeomFromText('POINT(152 39)')),
312 ('y', 'p', 'o', GeomFromText('POINT(45 27)')),
313 ('p', 'n', 'm', GeomFromText('POINT(228 148)')),
314 ('e', 'g', 'e', GeomFromText('POINT(88 81)')),
315 ('m', 'a', 'h', GeomFromText('POINT(35 29)')),
316 ('m', 'h', 'f', GeomFromText('POINT(30 71)')),
317 ('h', 'k', 'i', GeomFromText('POINT(244 78)')),
318 ('z', 'v', 'd', GeomFromText('POINT(241 38)')),
319 ('q', 'l', 'j', GeomFromText('POINT(13 71)')),
320 ('s', 'p', 'g', GeomFromText('POINT(108 38)')),
321 ('q', 's', 'j', GeomFromText('POINT(92 101)')),
322 ('l', 'h', 'g', GeomFromText('POINT(120 78)')),
323 ('w', 't', 'b', GeomFromText('POINT(193 109)')),
324 ('b', 's', 's', GeomFromText('POINT(223 211)')),
325 ('w', 'w', 'y', GeomFromText('POINT(122 42)')),
326 ('q', 'c', 'c', GeomFromText('POINT(104 102)')),
327 ('w', 'g', 'n', GeomFromText('POINT(213 120)')),
328 ('p', 'q', 'a', GeomFromText('POINT(247 148)')),
329 ('c', 'z', 'e', GeomFromText('POINT(18 106)')),
330 ('z', 'u', 'n', GeomFromText('POINT(70 133)')),
331 ('j', 'n', 'x', GeomFromText('POINT(232 13)')),
332 ('e', 'h', 'f', GeomFromText('POINT(22 135)')),
333 ('w', 'l', 'f', GeomFromText('POINT(9 180)')),
334 ('a', 'v', 'q', GeomFromText('POINT(163 228)')),
335 ('i', 'z', 'o', GeomFromText('POINT(180 100)')),
336 ('e', 'c', 'l', GeomFromText('POINT(182 231)')),
337 ('c', 'k', 'o', GeomFromText('POINT(19 60)')),
338 ('q', 'f', 'p', GeomFromText('POINT(79 95)')),
339 ('m', 'd', 'r', GeomFromText('POINT(3 127)')),
340 ('m', 'e', 't', GeomFromText('POINT(136 154)')),
341 ('w', 'w', 'w', GeomFromText('POINT(102 15)')),
342 ('l', 'n', 'q', GeomFromText('POINT(71 196)')),
343 ('p', 'k', 'c', GeomFromText('POINT(47 139)')),
344 ('j', 'o', 'r', GeomFromText('POINT(177 128)')),
345 ('j', 'q', 'a', GeomFromText('POINT(170 6)')),
346 ('b', 'a', 'o', GeomFromText('POINT(63 211)')),
347 ('g', 's', 'o', GeomFromText('POINT(144 251)')),
348 ('w', 'u', 'w', GeomFromText('POINT(221 214)')),
349 ('g', 'a', 'm', GeomFromText('POINT(14 102)')),
350 ('u', 'q', 'z', GeomFromText('POINT(86 200)')),
351 ('k', 'a', 'm', GeomFromText('POINT(144 222)')),
352 ('j', 'u', 'r', GeomFromText('POINT(216 142)')),
353 ('q', 'k', 'v', GeomFromText('POINT(121 236)')),
354 ('p', 'o', 'r', GeomFromText('POINT(108 102)')),
355 ('b', 'd', 'x', GeomFromText('POINT(127 198)')),
356 ('k', 's', 'a', GeomFromText('POINT(2 150)')),
357 ('f', 'm', 'f', GeomFromText('POINT(160 191)')),
358 ('q', 'y', 'x', GeomFromText('POINT(98 111)')),
359 ('o', 'f', 'm', GeomFromText('POINT(232 218)')),
360 ('c', 'w', 'j', GeomFromText('POINT(156 165)')),
361 ('s', 'q', 'v', GeomFromText('POINT(98 161)'));
362 SET @@RAND_SEED1=692635050, @@RAND_SEED2=297339954;
363 DELETE FROM t1 ORDER BY RAND() LIMIT 10;
364 SET @@RAND_SEED1=159925977, @@RAND_SEED2=942570618;
365 DELETE FROM t1 ORDER BY RAND() LIMIT 10;
366 SET @@RAND_SEED1=328169745, @@RAND_SEED2=410451954;
367 DELETE FROM t1 ORDER BY RAND() LIMIT 10;
368 SET @@RAND_SEED1=178507359, @@RAND_SEED2=332493072;
369 DELETE FROM t1 ORDER BY RAND() LIMIT 10;
370 SET @@RAND_SEED1=1034033013, @@RAND_SEED2=558966507;
371 DELETE FROM t1 ORDER BY RAND() LIMIT 10;
372 CHECK TABLE t1 extended;
373 UPDATE t1 set spatial_point=GeomFromText('POINT(230 9)') where c1 like 'y%';
374 UPDATE t1 set spatial_point=GeomFromText('POINT(95 35)') where c1 like 'j%';
375 UPDATE t1 set spatial_point=GeomFromText('POINT(93 99)') where c1 like 'a%';
376 UPDATE t1 set spatial_point=GeomFromText('POINT(19 81)') where c1 like 'r%';
377 UPDATE t1 set spatial_point=GeomFromText('POINT(20 177)') where c1 like 'h%';
378 UPDATE t1 set spatial_point=GeomFromText('POINT(221 193)') where c1 like 'u%';
379 UPDATE t1 set spatial_point=GeomFromText('POINT(195 205)') where c1 like 'd%';
380 UPDATE t1 set spatial_point=GeomFromText('POINT(15 213)') where c1 like 'u%';
381 UPDATE t1 set spatial_point=GeomFromText('POINT(214 63)') where c1 like 'n%';
382 UPDATE t1 set spatial_point=GeomFromText('POINT(243 171)') where c1 like 'c%';
383 UPDATE t1 set spatial_point=GeomFromText('POINT(198 82)') where c1 like 'y%';
384 INSERT INTO t1 (c2, c1, c3, spatial_point) VALUES
385 ('f', 'y', 'p', GeomFromText('POINT(109 235)')),
386 ('b', 'e', 'v', GeomFromText('POINT(20 48)')),
387 ('i', 'u', 'f', GeomFromText('POINT(15 55)')),
388 ('o', 'r', 'z', GeomFromText('POINT(105 64)')),
389 ('a', 'p', 'a', GeomFromText('POINT(142 236)')),
390 ('g', 'i', 'k', GeomFromText('POINT(10 49)')),
391 ('x', 'z', 'x', GeomFromText('POINT(192 200)')),
392 ('c', 'v', 'r', GeomFromText('POINT(94 168)')),
393 ('y', 'z', 'e', GeomFromText('POINT(141 51)')),
394 ('h', 'm', 'd', GeomFromText('POINT(35 251)')),
395 ('v', 'm', 'q', GeomFromText('POINT(44 90)')),
396 ('j', 'l', 'z', GeomFromText('POINT(67 237)')),
397 ('i', 'v', 'a', GeomFromText('POINT(75 14)')),
398 ('b', 'q', 't', GeomFromText('POINT(153 33)')),
399 ('e', 'm', 'a', GeomFromText('POINT(247 49)')),
400 ('l', 'y', 'g', GeomFromText('POINT(56 203)')),
401 ('v', 'o', 'r', GeomFromText('POINT(90 54)')),
402 ('r', 'n', 'd', GeomFromText('POINT(135 83)')),
403 ('j', 't', 'u', GeomFromText('POINT(174 239)')),
404 ('u', 'n', 'g', GeomFromText('POINT(104 191)')),
405 ('p', 'q', 'y', GeomFromText('POINT(63 171)')),
406 ('o', 'q', 'p', GeomFromText('POINT(192 103)')),
407 ('f', 'x', 'e', GeomFromText('POINT(244 30)')),
408 ('n', 'x', 'c', GeomFromText('POINT(92 103)')),
409 ('r', 'q', 'z', GeomFromText('POINT(166 20)')),
410 ('s', 'a', 'j', GeomFromText('POINT(137 205)')),
411 ('z', 't', 't', GeomFromText('POINT(99 134)')),
412 ('o', 'm', 'j', GeomFromText('POINT(217 3)')),
413 ('n', 'h', 'j', GeomFromText('POINT(211 17)')),
414 ('v', 'v', 'a', GeomFromText('POINT(41 137)')),
415 ('q', 'o', 'j', GeomFromText('POINT(5 92)')),
416 ('z', 'y', 'e', GeomFromText('POINT(175 212)')),
417 ('j', 'z', 'h', GeomFromText('POINT(224 194)')),
418 ('a', 'g', 'm', GeomFromText('POINT(31 119)')),
419 ('p', 'c', 'f', GeomFromText('POINT(17 221)')),
420 ('t', 'h', 'k', GeomFromText('POINT(26 203)')),
421 ('u', 'w', 'p', GeomFromText('POINT(47 185)')),
422 ('z', 'a', 'c', GeomFromText('POINT(61 133)')),
423 ('u', 'k', 'a', GeomFromText('POINT(210 115)')),
424 ('k', 'f', 'h', GeomFromText('POINT(125 113)')),
425 ('t', 'v', 'y', GeomFromText('POINT(12 239)')),
426 ('u', 'v', 'd', GeomFromText('POINT(90 24)')),
427 ('m', 'y', 'w', GeomFromText('POINT(25 243)')),
428 ('d', 'n', 'g', GeomFromText('POINT(122 92)')),
429 ('z', 'm', 'f', GeomFromText('POINT(235 110)')),
430 ('q', 'd', 'f', GeomFromText('POINT(233 217)')),
431 ('a', 'v', 'u', GeomFromText('POINT(69 59)')),
432 ('x', 'k', 'p', GeomFromText('POINT(240 14)')),
433 ('i', 'v', 'r', GeomFromText('POINT(154 42)')),
434 ('w', 'h', 'l', GeomFromText('POINT(178 156)')),
435 ('d', 'h', 'n', GeomFromText('POINT(65 157)')),
436 ('c', 'k', 'z', GeomFromText('POINT(62 33)')),
437 ('e', 'l', 'w', GeomFromText('POINT(162 1)')),
438 ('r', 'f', 'i', GeomFromText('POINT(127 71)')),
439 ('q', 'm', 'c', GeomFromText('POINT(63 118)')),
440 ('c', 'h', 'u', GeomFromText('POINT(205 203)')),
441 ('d', 't', 'p', GeomFromText('POINT(234 87)')),
442 ('s', 'g', 'h', GeomFromText('POINT(149 34)')),
443 ('o', 'b', 'q', GeomFromText('POINT(159 179)')),
444 ('k', 'u', 'f', GeomFromText('POINT(202 254)')),
445 ('u', 'f', 'g', GeomFromText('POINT(70 15)')),
446 ('x', 's', 'b', GeomFromText('POINT(25 181)')),
447 ('s', 'c', 'g', GeomFromText('POINT(252 17)')),
448 ('a', 'c', 'f', GeomFromText('POINT(89 67)')),
449 ('r', 'e', 'q', GeomFromText('POINT(55 54)')),
450 ('f', 'i', 'k', GeomFromText('POINT(178 230)')),
451 ('p', 'e', 'l', GeomFromText('POINT(198 28)')),
452 ('w', 'o', 'd', GeomFromText('POINT(204 189)')),
453 ('c', 'a', 'g', GeomFromText('POINT(230 178)')),
454 ('r', 'o', 'e', GeomFromText('POINT(61 116)')),
455 ('w', 'a', 'a', GeomFromText('POINT(178 237)')),
456 ('v', 'd', 'e', GeomFromText('POINT(70 85)')),
457 ('k', 'c', 'e', GeomFromText('POINT(147 118)')),
458 ('d', 'q', 't', GeomFromText('POINT(218 77)')),
459 ('k', 'g', 'f', GeomFromText('POINT(192 113)')),
460 ('w', 'n', 'e', GeomFromText('POINT(92 124)')),
461 ('r', 'm', 'q', GeomFromText('POINT(130 65)')),
462 ('o', 'r', 'r', GeomFromText('POINT(174 233)')),
463 ('k', 'n', 't', GeomFromText('POINT(175 147)')),
464 ('q', 'm', 'r', GeomFromText('POINT(18 208)')),
465 ('l', 'd', 'i', GeomFromText('POINT(13 104)')),
466 ('w', 'o', 'y', GeomFromText('POINT(207 39)')),
467 ('p', 'u', 'o', GeomFromText('POINT(114 31)')),
468 ('y', 'a', 'p', GeomFromText('POINT(106 59)')),
469 ('a', 'x', 'z', GeomFromText('POINT(17 57)')),
470 ('v', 'h', 'x', GeomFromText('POINT(170 13)')),
471 ('t', 's', 'u', GeomFromText('POINT(84 18)')),
472 ('z', 'z', 'f', GeomFromText('POINT(250 197)')),
473 ('l', 'z', 't', GeomFromText('POINT(59 80)')),
474 ('j', 'g', 's', GeomFromText('POINT(54 26)')),
475 ('g', 'v', 'm', GeomFromText('POINT(89 98)')),
476 ('q', 'v', 'b', GeomFromText('POINT(39 240)')),
477 ('x', 'k', 'v', GeomFromText('POINT(246 207)')),
478 ('k', 'u', 'i', GeomFromText('POINT(105 111)')),
479 ('w', 'z', 's', GeomFromText('POINT(235 8)')),
480 ('d', 'd', 'd', GeomFromText('POINT(105 4)')),
481 ('c', 'z', 'q', GeomFromText('POINT(13 140)')),
482 ('m', 'k', 'i', GeomFromText('POINT(208 120)')),
483 ('g', 'a', 'g', GeomFromText('POINT(9 182)')),
484 ('z', 'j', 'r', GeomFromText('POINT(149 153)')),
485 ('h', 'f', 'g', GeomFromText('POINT(81 236)')),
486 ('m', 'e', 'q', GeomFromText('POINT(209 215)')),
487 ('c', 'h', 'y', GeomFromText('POINT(235 70)')),
488 ('i', 'e', 'g', GeomFromText('POINT(138 26)')),
489 ('m', 't', 'u', GeomFromText('POINT(119 237)')),
490 ('o', 'w', 's', GeomFromText('POINT(193 166)')),
491 ('f', 'm', 'q', GeomFromText('POINT(85 96)')),
492 ('x', 'l', 'x', GeomFromText('POINT(58 115)')),
493 ('x', 'q', 'u', GeomFromText('POINT(108 210)')),
494 ('b', 'h', 'i', GeomFromText('POINT(250 139)')),
495 ('y', 'd', 'x', GeomFromText('POINT(199 135)')),
496 ('w', 'h', 'p', GeomFromText('POINT(247 233)')),
497 ('p', 'z', 't', GeomFromText('POINT(148 249)')),
498 ('q', 'a', 'u', GeomFromText('POINT(174 78)')),
499 ('v', 't', 'm', GeomFromText('POINT(70 228)')),
500 ('t', 'n', 'f', GeomFromText('POINT(123 2)')),
501 ('x', 't', 'b', GeomFromText('POINT(35 50)')),
502 ('r', 'j', 'f', GeomFromText('POINT(200 51)')),
503 ('s', 'q', 'o', GeomFromText('POINT(23 184)')),
504 ('u', 'v', 'z', GeomFromText('POINT(7 113)')),
505 ('v', 'u', 'l', GeomFromText('POINT(145 190)')),
506 ('o', 'k', 'i', GeomFromText('POINT(161 122)')),
507 ('l', 'y', 'e', GeomFromText('POINT(17 232)')),
508 ('t', 'b', 'e', GeomFromText('POINT(120 50)')),
509 ('e', 's', 'u', GeomFromText('POINT(254 1)')),
510 ('d', 'd', 'u', GeomFromText('POINT(167 140)')),
511 ('o', 'b', 'x', GeomFromText('POINT(186 237)')),
512 ('m', 's', 's', GeomFromText('POINT(172 149)')),
513 ('t', 'y', 'a', GeomFromText('POINT(149 85)')),
514 ('x', 't', 'r', GeomFromText('POINT(10 165)')),
515 ('g', 'c', 'e', GeomFromText('POINT(95 165)')),
516 ('e', 'e', 'z', GeomFromText('POINT(98 65)')),
517 ('f', 'v', 'i', GeomFromText('POINT(149 144)')),
518 ('o', 'p', 'm', GeomFromText('POINT(233 67)')),
519 ('t', 'u', 'b', GeomFromText('POINT(109 215)')),
520 ('o', 'o', 'b', GeomFromText('POINT(130 48)')),
521 ('e', 'm', 'h', GeomFromText('POINT(88 189)')),
522 ('e', 'v', 'y', GeomFromText('POINT(55 29)')),
523 ('e', 't', 'm', GeomFromText('POINT(129 55)')),
524 ('p', 'p', 'i', GeomFromText('POINT(126 222)')),
525 ('c', 'i', 'c', GeomFromText('POINT(19 158)')),
526 ('c', 'b', 's', GeomFromText('POINT(13 19)')),
527 ('u', 'y', 'a', GeomFromText('POINT(114 5)')),
528 ('a', 'o', 'f', GeomFromText('POINT(227 232)')),
529 ('t', 'c', 'z', GeomFromText('POINT(63 62)')),
530 ('d', 'o', 'k', GeomFromText('POINT(48 228)')),
531 ('x', 'c', 'e', GeomFromText('POINT(204 2)')),
532 ('e', 'e', 'g', GeomFromText('POINT(125 43)')),
533 ('o', 'r', 'f', GeomFromText('POINT(171 140)'));
534 UPDATE t1 set spatial_point=GeomFromText('POINT(163 157)') where c1 like 'w%';
535 UPDATE t1 set spatial_point=GeomFromText('POINT(53 151)') where c1 like 'd%';
536 UPDATE t1 set spatial_point=GeomFromText('POINT(96 183)') where c1 like 'r%';
537 UPDATE t1 set spatial_point=GeomFromText('POINT(57 91)') where c1 like 'q%';
538 UPDATE t1 set spatial_point=GeomFromText('POINT(202 110)') where c1 like 'c%';
539 UPDATE t1 set spatial_point=GeomFromText('POINT(120 137)') where c1 like 'w%';
540 UPDATE t1 set spatial_point=GeomFromText('POINT(207 147)') where c1 like 'c%';
541 UPDATE t1 set spatial_point=GeomFromText('POINT(31 125)') where c1 like 'e%';
542 UPDATE t1 set spatial_point=GeomFromText('POINT(27 36)') where c1 like 'r%';
543 check table t1 extended;
544 INSERT INTO t1 (c2, c1, c3, spatial_point) VALUES
545 ('b', 'c', 'e', GeomFromText('POINT(41 137)')),
546 ('p', 'y', 'k', GeomFromText('POINT(50 22)')),
547 ('s', 'c', 'h', GeomFromText('POINT(208 173)')),
548 ('x', 'u', 'l', GeomFromText('POINT(199 175)')),
549 ('s', 'r', 'h', GeomFromText('POINT(85 192)')),
550 ('j', 'k', 'u', GeomFromText('POINT(18 25)')),
551 ('p', 'w', 'h', GeomFromText('POINT(152 197)')),
552 ('e', 'd', 'c', GeomFromText('POINT(229 3)')),
553 ('o', 'x', 'k', GeomFromText('POINT(187 155)')),
554 ('o', 'b', 'k', GeomFromText('POINT(208 150)')),
555 ('d', 'a', 'j', GeomFromText('POINT(70 87)')),
556 ('f', 'e', 'k', GeomFromText('POINT(156 96)')),
557 ('u', 'y', 'p', GeomFromText('POINT(239 193)')),
558 ('n', 'v', 'p', GeomFromText('POINT(223 98)')),
559 ('z', 'j', 'r', GeomFromText('POINT(87 89)')),
560 ('h', 'x', 'x', GeomFromText('POINT(92 0)')),
561 ('r', 'v', 'r', GeomFromText('POINT(159 139)')),
562 ('v', 'g', 'g', GeomFromText('POINT(16 229)')),
563 ('z', 'k', 'u', GeomFromText('POINT(99 52)')),
564 ('p', 'p', 'o', GeomFromText('POINT(105 125)')),
565 ('w', 'h', 'y', GeomFromText('POINT(105 154)')),
566 ('v', 'y', 'z', GeomFromText('POINT(134 238)')),
567 ('x', 'o', 'o', GeomFromText('POINT(178 88)')),
568 ('z', 'w', 'd', GeomFromText('POINT(123 60)')),
569 ('q', 'f', 'u', GeomFromText('POINT(64 90)')),
570 ('s', 'n', 't', GeomFromText('POINT(50 138)')),
571 ('v', 'p', 't', GeomFromText('POINT(114 91)')),
572 ('a', 'o', 'n', GeomFromText('POINT(78 43)')),
573 ('k', 'u', 'd', GeomFromText('POINT(185 161)')),
574 ('w', 'd', 'n', GeomFromText('POINT(25 92)')),
575 ('k', 'w', 'a', GeomFromText('POINT(59 238)')),
576 ('t', 'c', 'f', GeomFromText('POINT(65 87)')),
577 ('g', 's', 'p', GeomFromText('POINT(238 126)')),
578 ('d', 'n', 'y', GeomFromText('POINT(107 173)')),
579 ('l', 'a', 'w', GeomFromText('POINT(125 152)')),
580 ('m', 'd', 'j', GeomFromText('POINT(146 53)')),
581 ('q', 'm', 'c', GeomFromText('POINT(217 187)')),
582 ('i', 'r', 'r', GeomFromText('POINT(6 113)')),
583 ('e', 'j', 'b', GeomFromText('POINT(37 83)')),
584 ('w', 'w', 'h', GeomFromText('POINT(83 199)')),
585 ('k', 'b', 's', GeomFromText('POINT(170 64)')),
586 ('s', 'b', 'c', GeomFromText('POINT(163 130)')),
587 ('c', 'h', 'a', GeomFromText('POINT(141 3)')),
588 ('k', 'j', 'u', GeomFromText('POINT(143 76)')),
589 ('r', 'h', 'o', GeomFromText('POINT(243 92)')),
590 ('i', 'd', 'b', GeomFromText('POINT(205 13)')),
591 ('r', 'y', 'q', GeomFromText('POINT(138 8)')),
592 ('m', 'o', 'i', GeomFromText('POINT(36 45)')),
593 ('v', 'g', 'm', GeomFromText('POINT(0 40)')),
594 ('f', 'e', 'i', GeomFromText('POINT(76 6)')),
595 ('c', 'q', 'q', GeomFromText('POINT(115 248)')),
596 ('x', 'c', 'i', GeomFromText('POINT(29 74)')),
597 ('l', 's', 't', GeomFromText('POINT(83 18)')),
598 ('t', 't', 'a', GeomFromText('POINT(26 168)')),
599 ('u', 'n', 'x', GeomFromText('POINT(200 110)')),
600 ('j', 'b', 'd', GeomFromText('POINT(216 136)')),
601 ('s', 'p', 'w', GeomFromText('POINT(38 156)')),
602 ('f', 'b', 'v', GeomFromText('POINT(29 186)')),
603 ('v', 'e', 'r', GeomFromText('POINT(149 40)')),
604 ('v', 't', 'm', GeomFromText('POINT(184 24)')),
605 ('y', 'g', 'a', GeomFromText('POINT(219 105)')),
606 ('s', 'f', 'i', GeomFromText('POINT(114 130)')),
607 ('e', 'q', 'h', GeomFromText('POINT(203 135)')),
608 ('h', 'g', 'b', GeomFromText('POINT(9 208)')),
609 ('o', 'l', 'r', GeomFromText('POINT(245 79)')),
610 ('s', 's', 'v', GeomFromText('POINT(238 198)')),
611 ('w', 'w', 'z', GeomFromText('POINT(209 232)')),
612 ('v', 'd', 'n', GeomFromText('POINT(30 193)')),
613 ('q', 'w', 'k', GeomFromText('POINT(133 18)')),
614 ('o', 'h', 'o', GeomFromText('POINT(42 140)')),
615 ('f', 'f', 'h', GeomFromText('POINT(145 1)')),
616 ('u', 's', 'r', GeomFromText('POINT(70 62)')),
617 ('x', 'n', 'q', GeomFromText('POINT(33 86)')),
618 ('u', 'p', 'v', GeomFromText('POINT(232 220)')),
619 ('z', 'e', 'a', GeomFromText('POINT(130 69)')),
620 ('r', 'u', 'z', GeomFromText('POINT(243 241)')),
621 ('b', 'n', 't', GeomFromText('POINT(120 12)')),
622 ('u', 'f', 's', GeomFromText('POINT(190 212)')),
623 ('a', 'd', 'q', GeomFromText('POINT(235 191)')),
624 ('f', 'q', 'm', GeomFromText('POINT(176 2)')),
625 ('n', 'c', 's', GeomFromText('POINT(218 163)')),
626 ('e', 'm', 'h', GeomFromText('POINT(163 108)')),
627 ('c', 'f', 'l', GeomFromText('POINT(220 115)')),
628 ('c', 'v', 'q', GeomFromText('POINT(66 45)')),
629 ('w', 'v', 'x', GeomFromText('POINT(251 220)')),
630 ('f', 'w', 'z', GeomFromText('POINT(146 149)')),
631 ('h', 'n', 'h', GeomFromText('POINT(148 128)')),
632 ('y', 'k', 'v', GeomFromText('POINT(28 110)')),
633 ('c', 'x', 'q', GeomFromText('POINT(13 13)')),
634 ('e', 'd', 's', GeomFromText('POINT(91 190)')),
635 ('c', 'w', 'c', GeomFromText('POINT(10 231)')),
636 ('u', 'j', 'n', GeomFromText('POINT(250 21)')),
637 ('w', 'n', 'x', GeomFromText('POINT(141 69)')),
638 ('f', 'p', 'y', GeomFromText('POINT(228 246)')),
639 ('d', 'q', 'f', GeomFromText('POINT(194 22)')),
640 ('d', 'z', 'l', GeomFromText('POINT(233 181)')),
641 ('c', 'a', 'q', GeomFromText('POINT(183 96)')),
642 ('m', 'i', 'd', GeomFromText('POINT(117 226)')),
643 ('z', 'y', 'y', GeomFromText('POINT(62 81)')),
644 ('g', 'v', 'm', GeomFromText('POINT(66 158)'));
645 check table t1 extended;
646 SET @@RAND_SEED1=481064922, @@RAND_SEED2=438133497;
647 DELETE FROM t1 ORDER BY RAND() LIMIT 10;
648 SET @@RAND_SEED1=280535103, @@RAND_SEED2=444518646;
649 DELETE FROM t1 ORDER BY RAND() LIMIT 10;
650 SET @@RAND_SEED1=1072017234, @@RAND_SEED2=484203885;
651 DELETE FROM t1 ORDER BY RAND() LIMIT 10;
652 SET @@RAND_SEED1=358851897, @@RAND_SEED2=358495224;
653 DELETE FROM t1 ORDER BY RAND() LIMIT 10;
654 SET @@RAND_SEED1=509031459, @@RAND_SEED2=675962925;
655 DELETE FROM t1 ORDER BY RAND() LIMIT 10;
656 UPDATE t1 set spatial_point=GeomFromText('POINT(61 203)') where c1 like 'y%';
657 UPDATE t1 set spatial_point=GeomFromText('POINT(202 194)') where c1 like 'f%';
658 UPDATE t1 set spatial_point=GeomFromText('POINT(228 18)') where c1 like 'h%';
659 UPDATE t1 set spatial_point=GeomFromText('POINT(88 18)') where c1 like 'l%';
660 UPDATE t1 set spatial_point=GeomFromText('POINT(176 94)') where c1 like 'e%';
661 UPDATE t1 set spatial_point=GeomFromText('POINT(44 47)') where c1 like 'g%';
662 UPDATE t1 set spatial_point=GeomFromText('POINT(95 191)') where c1 like 'b%';
663 UPDATE t1 set spatial_point=GeomFromText('POINT(179 218)') where c1 like 'y%';
664 UPDATE t1 set spatial_point=GeomFromText('POINT(239 40)') where c1 like 'g%';
665 UPDATE t1 set spatial_point=GeomFromText('POINT(248 41)') where c1 like 'q%';
666 UPDATE t1 set spatial_point=GeomFromText('POINT(167 82)') where c1 like 't%';
667 UPDATE t1 set spatial_point=GeomFromText('POINT(13 104)') where c1 like 'u%';
668 UPDATE t1 set spatial_point=GeomFromText('POINT(139 84)') where c1 like 'a%';
669 UPDATE t1 set spatial_point=GeomFromText('POINT(145 108)') where c1 like 'p%';
670 UPDATE t1 set spatial_point=GeomFromText('POINT(147 57)') where c1 like 't%';
671 UPDATE t1 set spatial_point=GeomFromText('POINT(217 144)') where c1 like 'n%';
672 UPDATE t1 set spatial_point=GeomFromText('POINT(160 224)') where c1 like 'w%';
673 UPDATE t1 set spatial_point=GeomFromText('POINT(38 28)') where c1 like 'j%';
674 UPDATE t1 set spatial_point=GeomFromText('POINT(104 114)') where c1 like 'q%';
675 UPDATE t1 set spatial_point=GeomFromText('POINT(88 19)') where c1 like 'c%';
676 INSERT INTO t1 (c2, c1, c3, spatial_point) VALUES
677 ('f', 'x', 'p', GeomFromText('POINT(92 181)')),
678 ('s', 'i', 'c', GeomFromText('POINT(49 60)')),
679 ('c', 'c', 'i', GeomFromText('POINT(7 57)')),
680 ('n', 'g', 'k', GeomFromText('POINT(252 105)')),
681 ('g', 'b', 'm', GeomFromText('POINT(180 11)')),
682 ('u', 'l', 'r', GeomFromText('POINT(32 90)')),
683 ('c', 'x', 'e', GeomFromText('POINT(143 24)')),
684 ('x', 'u', 'a', GeomFromText('POINT(123 92)')),
685 ('s', 'b', 'h', GeomFromText('POINT(190 108)')),
686 ('c', 'x', 'b', GeomFromText('POINT(104 100)')),
687 ('i', 'd', 't', GeomFromText('POINT(214 104)')),
688 ('r', 'w', 'g', GeomFromText('POINT(29 67)')),
689 ('b', 'f', 'g', GeomFromText('POINT(149 46)')),
690 ('r', 'r', 'd', GeomFromText('POINT(242 196)')),
691 ('j', 'l', 'a', GeomFromText('POINT(90 196)')),
692 ('e', 't', 'b', GeomFromText('POINT(190 64)')),
693 ('l', 'x', 'w', GeomFromText('POINT(250 73)')),
694 ('q', 'y', 'r', GeomFromText('POINT(120 182)')),
695 ('s', 'j', 'a', GeomFromText('POINT(180 175)')),
696 ('n', 'i', 'y', GeomFromText('POINT(124 136)')),
697 ('s', 'x', 's', GeomFromText('POINT(176 209)')),
698 ('u', 'f', 's', GeomFromText('POINT(215 173)')),
699 ('m', 'j', 'x', GeomFromText('POINT(44 140)')),
700 ('v', 'g', 'x', GeomFromText('POINT(177 233)')),
701 ('u', 't', 'b', GeomFromText('POINT(136 197)')),
702 ('f', 'g', 'b', GeomFromText('POINT(10 8)')),
703 ('v', 'c', 'j', GeomFromText('POINT(13 81)')),
704 ('d', 's', 'q', GeomFromText('POINT(200 100)')),
705 ('a', 'p', 'j', GeomFromText('POINT(33 40)')),
706 ('i', 'c', 'g', GeomFromText('POINT(168 204)')),
707 ('k', 'h', 'i', GeomFromText('POINT(93 243)')),
708 ('s', 'b', 's', GeomFromText('POINT(157 13)')),
709 ('v', 'l', 'l', GeomFromText('POINT(103 6)')),
710 ('r', 'b', 'k', GeomFromText('POINT(244 137)')),
711 ('l', 'd', 'r', GeomFromText('POINT(162 254)')),
712 ('q', 'b', 'z', GeomFromText('POINT(136 246)')),
713 ('x', 'x', 'p', GeomFromText('POINT(120 37)')),
714 ('m', 'e', 'z', GeomFromText('POINT(203 167)')),
715 ('q', 'n', 'p', GeomFromText('POINT(94 119)')),
716 ('b', 'g', 'u', GeomFromText('POINT(93 248)')),
717 ('r', 'v', 'v', GeomFromText('POINT(53 88)')),
718 ('y', 'a', 'i', GeomFromText('POINT(98 219)')),
719 ('a', 's', 'g', GeomFromText('POINT(173 138)')),
720 ('c', 'a', 't', GeomFromText('POINT(235 135)')),
721 ('q', 'm', 'd', GeomFromText('POINT(224 208)')),
722 ('e', 'p', 'k', GeomFromText('POINT(161 238)')),
723 ('n', 'g', 'q', GeomFromText('POINT(35 204)')),
724 ('t', 't', 'x', GeomFromText('POINT(230 178)')),
725 ('w', 'f', 'a', GeomFromText('POINT(150 221)')),
726 ('z', 'm', 'z', GeomFromText('POINT(119 42)')),
727 ('l', 'j', 's', GeomFromText('POINT(97 96)')),
728 ('f', 'z', 'x', GeomFromText('POINT(208 65)')),
729 ('i', 'v', 'c', GeomFromText('POINT(145 79)')),
730 ('l', 'f', 'k', GeomFromText('POINT(83 234)')),
731 ('u', 'a', 's', GeomFromText('POINT(250 49)')),
732 ('o', 'k', 'p', GeomFromText('POINT(46 50)')),
733 ('d', 'e', 'z', GeomFromText('POINT(30 198)')),
734 ('r', 'r', 'l', GeomFromText('POINT(78 189)')),
735 ('y', 'l', 'f', GeomFromText('POINT(188 132)')),
736 ('d', 'q', 'm', GeomFromText('POINT(247 107)')),
737 ('p', 'j', 'n', GeomFromText('POINT(148 227)')),
738 ('b', 'o', 'i', GeomFromText('POINT(172 25)')),
739 ('e', 'v', 'd', GeomFromText('POINT(94 248)')),
740 ('q', 'd', 'f', GeomFromText('POINT(15 29)')),
741 ('w', 'b', 'b', GeomFromText('POINT(74 111)')),
742 ('g', 'q', 'f', GeomFromText('POINT(107 215)')),
743 ('o', 'h', 'r', GeomFromText('POINT(25 168)')),
744 ('u', 't', 'w', GeomFromText('POINT(251 188)')),
745 ('h', 's', 'w', GeomFromText('POINT(254 247)')),
746 ('f', 'f', 'b', GeomFromText('POINT(166 103)'));
747 SET @@RAND_SEED1=866613816, @@RAND_SEED2=92289615;
748 INSERT INTO t1 (c2, c1, c3, spatial_point) VALUES
749 ('l', 'c', 'l', GeomFromText('POINT(202 98)')),
750 ('k', 'c', 'b', GeomFromText('POINT(46 206)')),
751 ('r', 'y', 'm', GeomFromText('POINT(74 140)')),
752 ('y', 'z', 'd', GeomFromText('POINT(200 160)')),
753 ('s', 'y', 's', GeomFromText('POINT(156 205)')),
754 ('u', 'v', 'p', GeomFromText('POINT(86 82)')),
755 ('j', 's', 's', GeomFromText('POINT(91 233)')),
756 ('x', 'j', 'f', GeomFromText('POINT(3 14)')),
757 ('l', 'z', 'v', GeomFromText('POINT(123 156)')),
758 ('h', 'i', 'o', GeomFromText('POINT(145 229)')),
759 ('o', 'r', 'd', GeomFromText('POINT(15 22)')),
760 ('f', 'x', 't', GeomFromText('POINT(21 60)')),
761 ('t', 'g', 'h', GeomFromText('POINT(50 153)')),
762 ('g', 'u', 'b', GeomFromText('POINT(82 85)')),
763 ('v', 'a', 'p', GeomFromText('POINT(231 178)')),
764 ('n', 'v', 'o', GeomFromText('POINT(183 25)')),
765 ('j', 'n', 'm', GeomFromText('POINT(50 144)')),
766 ('e', 'f', 'i', GeomFromText('POINT(46 16)')),
767 ('d', 'w', 'a', GeomFromText('POINT(66 6)')),
768 ('f', 'x', 'a', GeomFromText('POINT(107 197)')),
769 ('m', 'o', 'a', GeomFromText('POINT(142 80)')),
770 ('q', 'l', 'g', GeomFromText('POINT(251 23)')),
771 ('c', 's', 's', GeomFromText('POINT(158 43)')),
772 ('y', 'd', 'o', GeomFromText('POINT(196 228)')),
773 ('d', 'p', 'l', GeomFromText('POINT(107 5)')),
774 ('h', 'a', 'b', GeomFromText('POINT(183 166)')),
775 ('m', 'w', 'p', GeomFromText('POINT(19 59)')),
776 ('b', 'y', 'o', GeomFromText('POINT(178 30)')),
777 ('x', 'w', 'i', GeomFromText('POINT(168 94)')),
778 ('t', 'k', 'z', GeomFromText('POINT(171 5)')),
779 ('r', 'm', 'a', GeomFromText('POINT(222 19)')),
780 ('u', 'v', 'e', GeomFromText('POINT(224 80)')),
781 ('q', 'r', 'k', GeomFromText('POINT(212 218)')),
782 ('d', 'p', 'j', GeomFromText('POINT(169 7)')),
783 ('d', 'r', 'v', GeomFromText('POINT(193 23)')),
784 ('n', 'y', 'y', GeomFromText('POINT(130 178)')),
785 ('m', 'z', 'r', GeomFromText('POINT(81 200)')),
786 ('j', 'e', 'w', GeomFromText('POINT(145 239)')),
787 ('v', 'h', 'x', GeomFromText('POINT(24 105)')),
788 ('z', 'm', 'a', GeomFromText('POINT(175 129)')),
789 ('b', 'c', 'v', GeomFromText('POINT(213 10)')),
790 ('t', 't', 'u', GeomFromText('POINT(2 129)')),
791 ('r', 's', 'v', GeomFromText('POINT(209 192)')),
792 ('x', 'p', 'g', GeomFromText('POINT(43 63)')),
793 ('t', 'e', 'u', GeomFromText('POINT(139 210)')),
794 ('l', 'e', 't', GeomFromText('POINT(245 148)')),
795 ('a', 'i', 'k', GeomFromText('POINT(167 195)')),
796 ('m', 'o', 'h', GeomFromText('POINT(206 120)')),
797 ('g', 'z', 's', GeomFromText('POINT(169 240)')),
798 ('z', 'u', 's', GeomFromText('POINT(202 120)')),
799 ('i', 'b', 'a', GeomFromText('POINT(216 18)')),
800 ('w', 'y', 'g', GeomFromText('POINT(119 236)')),
801 ('h', 'y', 'p', GeomFromText('POINT(161 24)'));
802 UPDATE t1 set spatial_point=GeomFromText('POINT(33 100)') where c1 like 't%';
803 UPDATE t1 set spatial_point=GeomFromText('POINT(41 46)') where c1 like 'f%';
804 CHECK TABLE t1 EXTENDED;
805 DROP TABLE t1;
806
807 #
808 # Bug #30286 spatial index cause corruption and server crash!
809 #
810
811 create table t1 (a geometry not null, spatial index(a)) row_format=dynamic;
812 insert into t1 values (PointFromWKB(POINT(1.1517219314031e+164, 131072)));
813 insert into t1 values (PointFromWKB(POINT(9.1248812352444e+192, 2.9740338169556e+284)));
814 insert into t1 values (PointFromWKB(POINT(4.7783097267365e-299, -0)));
815 insert into t1 values (PointFromWKB(POINT(1.49166814624e-154, 2.0880974297595e-53)));
816 insert into t1 values (PointFromWKB(POINT(4.0917382598702e+149, 1.2024538023802e+111)));
817 insert into t1 values (PointFromWKB(POINT(2.0349165139404e+236, 2.9993936277913e-241)));
818 insert into t1 values (PointFromWKB(POINT(2.5243548967072e-29, 1.2024538023802e+111)));
819 insert into t1 values (PointFromWKB(POINT(0, 6.9835074892995e-251)));
820 insert into t1 values (PointFromWKB(POINT(2.0880974297595e-53, 3.1050361846014e+231)));
821 insert into t1 values (PointFromWKB(POINT(2.8728483499323e-188, 2.4600631144627e+260)));
822 insert into t1 values (PointFromWKB(POINT(3.0517578125e-05, 2.0349165139404e+236)));
823 insert into t1 values (PointFromWKB(POINT(1.1517219314031e+164, 1.1818212630766e-125)));
824 insert into t1 values (PointFromWKB(POINT(2.481040258324e-265, 5.7766220027675e-275)));
825 insert into t1 values (PointFromWKB(POINT(2.0880974297595e-53, 2.5243548967072e-29)));
826 insert into t1 values (PointFromWKB(POINT(5.7766220027675e-275, 9.9464647281957e+86)));
827 insert into t1 values (PointFromWKB(POINT(2.2181357552967e+130, 3.7857669957337e-270)));
828 insert into t1 values (PointFromWKB(POINT(4.5767114681874e-246, 3.6893488147419e+19)));
829 insert into t1 values (PointFromWKB(POINT(4.5767114681874e-246, 3.7537584144024e+255)));
830 insert into t1 values (PointFromWKB(POINT(3.7857669957337e-270, 1.8033161362863e-130)));
831 insert into t1 values (PointFromWKB(POINT(0, 5.8774717541114e-39)));
832 insert into t1 values (PointFromWKB(POINT(1.1517219314031e+164, 2.2761049594727e-159)));
833 insert into t1 values (PointFromWKB(POINT(6.243497100632e+144, 3.7857669957337e-270)));
834 insert into t1 values (PointFromWKB(POINT(3.7857669957337e-270, 2.6355494858076e-82)));
835 insert into t1 values (PointFromWKB(POINT(2.0349165139404e+236, 3.8518598887745e-34)));
836 insert into t1 values (PointFromWKB(POINT(4.6566128730774e-10, 2.0880974297595e-53)));
837 insert into t1 values (PointFromWKB(POINT(2.0880974297595e-53, 1.8827498946116e-183)));
838 insert into t1 values (PointFromWKB(POINT(1.8033161362863e-130, 9.1248812352444e+192)));
839 insert into t1 values (PointFromWKB(POINT(4.7783097267365e-299, 2.2761049594727e-159)));
840 insert into t1 values (PointFromWKB(POINT(1.94906280228e+289, 1.2338789709327e-178)));
841 drop table t1;
842
843 # End of 4.1 tests
844
845 #
846 # bug #21790 (UNKNOWN ERROR on NULLs in RTree)
847 #
848 CREATE TABLE t1(foo GEOMETRY NOT NULL, SPATIAL INDEX(foo) ) row_format=dynamic;
849 --error 1048
850 INSERT INTO t1(foo) VALUES (NULL);
851 --error 1416
852 INSERT IGNORE INTO t1() VALUES ();
853 --error 1416
854 INSERT INTO t1(foo) VALUES ('');
855 DROP TABLE t1;
856
857 #
858 # Bug #23578: Corruption prevents Optimize table from working properly with a
859 # spatial index
860 #
861
862 CREATE TABLE t1 (a INT AUTO_INCREMENT, b POINT NOT NULL, KEY (a), SPATIAL KEY (b)) row_format=dynamic;
863
864 INSERT INTO t1 (b) VALUES (GeomFromText('POINT(1 2)'));
865 INSERT INTO t1 (b) SELECT b FROM t1;
866 INSERT INTO t1 (b) SELECT b FROM t1;
867 INSERT INTO t1 (b) SELECT b FROM t1;
868 INSERT INTO t1 (b) SELECT b FROM t1;
869 INSERT INTO t1 (b) SELECT b FROM t1;
870
871 OPTIMIZE TABLE t1;
872 DROP TABLE t1;
873
874
875 #
876 # Bug #29070: Error in spatial index
877 #
878
879 CREATE TABLE t1 (a INT, b GEOMETRY NOT NULL, SPATIAL KEY b(b)) row_format=dynamic;
880 INSERT INTO t1 VALUES (1, GEOMFROMTEXT('LINESTRING(1102218.456 1,2000000 2)'));
881 INSERT INTO t1 VALUES (2, GEOMFROMTEXT('LINESTRING(1102218.456 1,2000000 2)'));
882
883 # must return the same number as the next select
884 SELECT COUNT(*) FROM t1 WHERE
885 MBRINTERSECTS(b, GEOMFROMTEXT('LINESTRING(1 1,1102219 2)') );
886 SELECT COUNT(*) FROM t1 IGNORE INDEX (b) WHERE
887 MBRINTERSECTS(b, GEOMFROMTEXT('LINESTRING(1 1,1102219 2)') );
888
889 DROP TABLE t1;
890
891 --echo End of 5.0 tests.