Debian Codegraph @

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

raw
1 # Because state.key_root is updated differently between transactional
2 # and non-trans tables, we have several aria-gis-rtree-* tests.
3
4 -- source include/have_maria.inc
5 -- source include/have_geometry.inc
6
7 set default_storage_engine=aria;
8
9 #
10 # test of rtree (using with spatial data)
11 #
12 --disable_warnings
13 DROP TABLE IF EXISTS t1, t2;
14 --enable_warnings
15
16 CREATE TABLE t1 (
17 fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
18 g GEOMETRY NOT NULL,
19 SPATIAL KEY(g)
20 ) transactional=1 row_format=page;
21
22 SHOW CREATE TABLE t1;
23
24 let $1=150;
25 let $2=150;
26 while ($1)
27 {
28 eval INSERT INTO t1 (g) VALUES (GeomFromText('LineString($1 $1, $2 $2)'));
29 dec $1;
30 inc $2;
31 }
32
33 SELECT count(*) FROM t1;
34 EXPLAIN SELECT fid, AsText(g) FROM t1 WHERE Within(g, GeomFromText('Polygon((140 140,160 140,160 160,140 160,140 140))'));
35 SELECT fid, AsText(g) FROM t1 WHERE Within(g, GeomFromText('Polygon((140 140,160 140,160 160,140 160,140 140))'));
36
37 DROP TABLE t1;
38
39 CREATE TABLE t2 (
40 fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
41 g GEOMETRY NOT NULL
42 ) transactional=1 row_format=page;
43
44 let $1=10;
45 while ($1)
46 {
47 let $2=10;
48 while ($2)
49 {
50 eval INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point($1 * 10 - 9, $2 * 10 - 9), Point($1 * 10, $2 * 10))));
51 dec $2;
52 }
53 dec $1;
54 }
55
56 ALTER TABLE t2 ADD SPATIAL KEY(g);
57 SHOW CREATE TABLE t2;
58 SELECT count(*) FROM t2;
59 EXPLAIN SELECT fid, AsText(g) FROM t2 WHERE Within(g,
60 GeomFromText('Polygon((40 40,60 40,60 60,40 60,40 40))'));
61 SELECT fid, AsText(g) FROM t2 WHERE Within(g,
62 GeomFromText('Polygon((40 40,60 40,60 60,40 60,40 40))'));
63
64 let $1=10;
65 while ($1)
66 {
67 let $2=10;
68 while ($2)
69 {
70 eval DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point($1 * 10 - 9, $2 * 10 - 9), Point($1 * 10, $2 * 10)))));
71 SELECT count(*) FROM t2;
72 dec $2;
73 }
74 dec $1;
75 }
76
77 DROP TABLE t2;
78
79 drop table if exists t1;
80 CREATE TABLE t1 (a geometry NOT NULL, SPATIAL (a)) transactional=1 row_format=page;
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 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
108 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
109 INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
110 check table t1;
111 analyze table t1;
112 drop table t1;
113
114 #
115 # The following crashed gis
116 #
117
118 CREATE TABLE t1 (
119 fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
120 g GEOMETRY NOT NULL,
121 SPATIAL KEY(g)
122 ) transactional=1 row_format=page;
123
124 INSERT INTO t1 (g) VALUES (GeomFromText('LineString(1 2, 2 3)')),(GeomFromText('LineString(1 2, 2 4)'));
125 #select * from t1 where g<GeomFromText('LineString(1 2, 2 3)');
126 drop table t1;
127
128 CREATE TABLE t1 (
129 line LINESTRING NOT NULL,
130 kind ENUM('po', 'pp', 'rr', 'dr', 'rd', 'ts', 'cl') NOT NULL DEFAULT 'po',
131 name VARCHAR(32),
132
133 SPATIAL KEY (line)
134
135
136 ) transactional=1 row_format=page;
137
138 ALTER TABLE t1 DISABLE KEYS;
139
140 INSERT INTO t1 (name, kind, line) VALUES
141 ("Aadaouane", "pp", GeomFromText("LINESTRING(32.816667 35.983333)")),
142 ("Aadassiye", "pp", GeomFromText("LINESTRING(35.816667 36.216667)")),
143 ("Aadbel", "pp", GeomFromText("LINESTRING(34.533333 36.100000)")),
144 ("Aadchit", "pp", GeomFromText("LINESTRING(33.347222 35.423611)")),
145 ("Aadchite", "pp", GeomFromText("LINESTRING(33.347222 35.423611)")),
146 ("Aadchit el Qoussair", "pp", GeomFromText("LINESTRING(33.283333 35.483333)")),
147 ("Aaddaye", "pp", GeomFromText("LINESTRING(36.716667 40.833333)")),
148 ("'Aadeissa", "pp", GeomFromText("LINESTRING(32.823889 35.698889)")),
149 ("Aaderup", "pp", GeomFromText("LINESTRING(55.216667 11.766667)")),
150 ("Qalaat Aades", "pp", GeomFromText("LINESTRING(33.503333 35.377500)")),
151 ("A ad'ino", "pp", GeomFromText("LINESTRING(54.812222 38.209167)")),
152 ("Aadi Noia", "pp", GeomFromText("LINESTRING(13.800000 39.833333)")),
153 ("Aad La Macta", "pp", GeomFromText("LINESTRING(35.779444 -0.129167)")),
154 ("Aadland", "pp", GeomFromText("LINESTRING(60.366667 5.483333)")),
155 ("Aadliye", "pp", GeomFromText("LINESTRING(33.366667 36.333333)")),
156 ("Aadloun", "pp", GeomFromText("LINESTRING(33.403889 35.273889)")),
157 ("Aadma", "pp", GeomFromText("LINESTRING(58.798333 22.663889)")),
158 ("Aadma Asundus", "pp", GeomFromText("LINESTRING(58.798333 22.663889)")),
159 ("Aadmoun", "pp", GeomFromText("LINESTRING(34.150000 35.650000)")),
160 ("Aadneram", "pp", GeomFromText("LINESTRING(59.016667 6.933333)")),
161 ("Aadneskaar", "pp", GeomFromText("LINESTRING(58.083333 6.983333)")),
162 ("Aadorf", "pp", GeomFromText("LINESTRING(47.483333 8.900000)")),
163 ("Aadorp", "pp", GeomFromText("LINESTRING(52.366667 6.633333)")),
164 ("Aadouane", "pp", GeomFromText("LINESTRING(32.816667 35.983333)")),
165 ("Aadoui", "pp", GeomFromText("LINESTRING(34.450000 35.983333)")),
166 ("Aadouiye", "pp", GeomFromText("LINESTRING(34.583333 36.183333)")),
167 ("Aadouss", "pp", GeomFromText("LINESTRING(33.512500 35.601389)")),
168 ("Aadra", "pp", GeomFromText("LINESTRING(33.616667 36.500000)")),
169 ("Aadzi", "pp", GeomFromText("LINESTRING(38.100000 64.850000)"));
170
171 ALTER TABLE t1 ENABLE KEYS;
172 INSERT INTO t1 (name, kind, line) VALUES ("austria", "pp", GeomFromText('LINESTRING(14.9906 48.9887,14.9946 48.9904,14.9947 48.9916)'));
173 drop table t1;
174
175 CREATE TABLE t1 (st varchar(100));
176 INSERT INTO t1 VALUES ("Fake string");
177 CREATE TABLE t2 (geom GEOMETRY NOT NULL, SPATIAL KEY gk(geom)) transactional=1 row_format=page;
178 --error 1416
179 INSERT IGNORE INTO t2 SELECT GeomFromText(st) FROM t1;
180 drop table t1, t2;
181
182 CREATE TABLE t1 (`geometry` geometry NOT NULL,SPATIAL KEY `gndx` (`geometry`)) transactional=1 row_format=page DEFAULT CHARSET=latin1;
183
184 INSERT INTO t1 (geometry) VALUES
185 (PolygonFromText('POLYGON((-18.6086111000 -66.9327777000, -18.6055555000
186 -66.8158332999, -18.7186111000 -66.8102777000, -18.7211111000 -66.9269443999,
187 -18.6086111000 -66.9327777000))'));
188
189 INSERT INTO t1 (geometry) VALUES
190 (PolygonFromText('POLYGON((-65.7402776999 -96.6686111000, -65.7372222000
191 -96.5516666000, -65.8502777000 -96.5461111000, -65.8527777000 -96.6627777000,
192 -65.7402776999 -96.6686111000))'));
193 check table t1 extended;
194
195 drop table t1;
196
197 #
198 # Bug#17877 - Corrupted spatial index
199 #
200 CREATE TABLE t1 (
201 c1 geometry NOT NULL,
202 SPATIAL KEY i1 (c1)
203 ) transactional=1 row_format=page DEFAULT CHARSET=latin1;
204 INSERT INTO t1 (c1) VALUES (
205 PolygonFromText('POLYGON((-18.6086111000 -66.9327777000,
206 -18.6055555000 -66.8158332999,
207 -18.7186111000 -66.8102777000,
208 -18.7211111000 -66.9269443999,
209 -18.6086111000 -66.9327777000))'));
210 # This showed a missing key.
211 CHECK TABLE t1 EXTENDED;
212 DROP TABLE t1;
213 #
214 CREATE TABLE t1 (
215 c1 geometry NOT NULL,
216 SPATIAL KEY i1 (c1)
217 ) transactional=1 row_format=page DEFAULT CHARSET=latin1;
218 INSERT INTO t1 (c1) VALUES (
219 PolygonFromText('POLYGON((-18.6086111000 -66.9327777000,
220 -18.6055555000 -66.8158332999,
221 -18.7186111000 -66.8102777000,
222 -18.7211111000 -66.9269443999,
223 -18.6086111000 -66.9327777000))'));
224 INSERT INTO t1 (c1) VALUES (
225 PolygonFromText('POLYGON((-65.7402776999 -96.6686111000,
226 -65.7372222000 -96.5516666000,
227 -65.8502777000 -96.5461111000,
228 -65.8527777000 -96.6627777000,
229 -65.7402776999 -96.6686111000))'));
230 # This is the same as the first insert to get a non-unique key.
231 INSERT INTO t1 (c1) VALUES (
232 PolygonFromText('POLYGON((-18.6086111000 -66.9327777000,
233 -18.6055555000 -66.8158332999,
234 -18.7186111000 -66.8102777000,
235 -18.7211111000 -66.9269443999,
236 -18.6086111000 -66.9327777000))'));
237 # This showed (and still shows) OK.
238 CHECK TABLE t1 EXTENDED;
239 DROP TABLE t1;
240
241 #
242 # Bug #21888: Query on GEOMETRY field using PointFromWKB() results in lost connection
243 #
244 CREATE TABLE t1 (foo GEOMETRY NOT NULL, SPATIAL INDEX(foo) ) transactional=1 row_format=page;
245 INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(1,1)));
246 INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(1,0)));
247 INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(0,1)));
248 INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(0,0)));
249 SELECT 1 FROM t1 WHERE foo != PointFromWKB(POINT(0,0));
250 DROP TABLE t1;
251
252 #
253 # Bug#25673 - spatial index corruption, error 126 incorrect key file for table
254 #
255 CREATE TABLE t1 (id bigint(12) unsigned NOT NULL auto_increment,
256 c2 varchar(15) collate utf8_bin default NULL,
257 c1 varchar(15) collate utf8_bin default NULL,
258 c3 varchar(10) collate utf8_bin default NULL,
259 spatial_point point NOT NULL,
260 PRIMARY KEY(id),
261 SPATIAL KEY (spatial_point)
262 )transactional=1 row_format=page DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
263 #
264 INSERT INTO t1 (c2, c1, c3, spatial_point) VALUES
265 ('y', 's', 'j', GeomFromText('POINT(167 74)')),
266 ('r', 'n', 'd', GeomFromText('POINT(215 118)')),
267 ('g', 'n', 'e', GeomFromText('POINT(203 98)')),
268 ('h', 'd', 'd', GeomFromText('POINT(54 193)')),
269 ('r', 'x', 'y', GeomFromText('POINT(47 69)')),
270 ('t', 'q', 'r', GeomFromText('POINT(109 42)')),
271 ('a', 'z', 'd', GeomFromText('POINT(0 154)')),
272 ('x', 'v', 'o', GeomFromText('POINT(174 131)')),
273 ('b', 'r', 'a', GeomFromText('POINT(114 253)')),
274 ('x', 'z', 'i', GeomFromText('POINT(163 21)')),
275 ('w', 'p', 'i', GeomFromText('POINT(42 102)')),
276 ('g', 'j', 'j', GeomFromText('POINT(170 133)')),
277 ('m', 'g', 'n', GeomFromText('POINT(28 22)')),
278 ('b', 'z', 'h', GeomFromText('POINT(174 28)')),
279 ('q', 'k', 'f', GeomFromText('POINT(233 73)')),
280 ('w', 'w', 'a', GeomFromText('POINT(124 200)')),
281 ('t', 'j', 'w', GeomFromText('POINT(252 101)')),
282 ('d', 'r', 'd', GeomFromText('POINT(98 18)')),
283 ('w', 'o', 'y', GeomFromText('POINT(165 31)')),
284 ('y', 'h', 't', GeomFromText('POINT(14 220)')),
285 ('d', 'p', 'u', GeomFromText('POINT(223 196)')),
286 ('g', 'y', 'g', GeomFromText('POINT(207 96)')),
287 ('x', 'm', 'n', GeomFromText('POINT(214 3)')),
288 ('g', 'v', 'e', GeomFromText('POINT(140 205)')),
289 ('g', 'm', 'm', GeomFromText('POINT(10 236)')),
290 ('i', 'r', 'j', GeomFromText('POINT(137 228)')),
291 ('w', 's', 'p', GeomFromText('POINT(115 6)')),
292 ('o', 'n', 'k', GeomFromText('POINT(158 129)')),
293 ('j', 'h', 'l', GeomFromText('POINT(129 72)')),
294 ('f', 'x', 'l', GeomFromText('POINT(139 207)')),
295 ('u', 'd', 'n', GeomFromText('POINT(125 109)')),
296 ('b', 'a', 'z', GeomFromText('POINT(30 32)')),
297 ('m', 'h', 'o', GeomFromText('POINT(251 251)')),
298 ('f', 'r', 'd', GeomFromText('POINT(243 211)')),
299 ('b', 'd', 'r', GeomFromText('POINT(232 80)')),
300 ('g', 'k', 'v', GeomFromText('POINT(15 100)')),
301 ('i', 'f', 'c', GeomFromText('POINT(109 66)')),
302 ('r', 't', 'j', GeomFromText('POINT(178 6)')),
303 ('y', 'n', 'f', GeomFromText('POINT(233 211)')),
304 ('f', 'y', 'm', GeomFromText('POINT(99 16)')),
305 ('z', 'q', 'l', GeomFromText('POINT(39 49)')),
306 ('j', 'c', 'r', GeomFromText('POINT(75 187)')),
307 ('c', 'y', 'y', GeomFromText('POINT(246 253)')),
308 ('w', 'u', 'd', GeomFromText('POINT(56 190)')),
309 ('n', 'q', 'm', GeomFromText('POINT(73 149)')),
310 ('d', 'y', 'a', GeomFromText('POINT(134 6)')),
311 ('z', 's', 'w', GeomFromText('POINT(216 225)')),
312 ('d', 'u', 'k', GeomFromText('POINT(132 70)')),
313 ('f', 'v', 't', GeomFromText('POINT(187 141)')),
314 ('r', 'r', 'a', GeomFromText('POINT(152 39)')),
315 ('y', 'p', 'o', GeomFromText('POINT(45 27)')),
316 ('p', 'n', 'm', GeomFromText('POINT(228 148)')),
317 ('e', 'g', 'e', GeomFromText('POINT(88 81)')),
318 ('m', 'a', 'h', GeomFromText('POINT(35 29)')),
319 ('m', 'h', 'f', GeomFromText('POINT(30 71)')),
320 ('h', 'k', 'i', GeomFromText('POINT(244 78)')),
321 ('z', 'v', 'd', GeomFromText('POINT(241 38)')),
322 ('q', 'l', 'j', GeomFromText('POINT(13 71)')),
323 ('s', 'p', 'g', GeomFromText('POINT(108 38)')),
324 ('q', 's', 'j', GeomFromText('POINT(92 101)')),
325 ('l', 'h', 'g', GeomFromText('POINT(120 78)')),
326 ('w', 't', 'b', GeomFromText('POINT(193 109)')),
327 ('b', 's', 's', GeomFromText('POINT(223 211)')),
328 ('w', 'w', 'y', GeomFromText('POINT(122 42)')),
329 ('q', 'c', 'c', GeomFromText('POINT(104 102)')),
330 ('w', 'g', 'n', GeomFromText('POINT(213 120)')),
331 ('p', 'q', 'a', GeomFromText('POINT(247 148)')),
332 ('c', 'z', 'e', GeomFromText('POINT(18 106)')),
333 ('z', 'u', 'n', GeomFromText('POINT(70 133)')),
334 ('j', 'n', 'x', GeomFromText('POINT(232 13)')),
335 ('e', 'h', 'f', GeomFromText('POINT(22 135)')),
336 ('w', 'l', 'f', GeomFromText('POINT(9 180)')),
337 ('a', 'v', 'q', GeomFromText('POINT(163 228)')),
338 ('i', 'z', 'o', GeomFromText('POINT(180 100)')),
339 ('e', 'c', 'l', GeomFromText('POINT(182 231)')),
340 ('c', 'k', 'o', GeomFromText('POINT(19 60)')),
341 ('q', 'f', 'p', GeomFromText('POINT(79 95)')),
342 ('m', 'd', 'r', GeomFromText('POINT(3 127)')),
343 ('m', 'e', 't', GeomFromText('POINT(136 154)')),
344 ('w', 'w', 'w', GeomFromText('POINT(102 15)')),
345 ('l', 'n', 'q', GeomFromText('POINT(71 196)')),
346 ('p', 'k', 'c', GeomFromText('POINT(47 139)')),
347 ('j', 'o', 'r', GeomFromText('POINT(177 128)')),
348 ('j', 'q', 'a', GeomFromText('POINT(170 6)')),
349 ('b', 'a', 'o', GeomFromText('POINT(63 211)')),
350 ('g', 's', 'o', GeomFromText('POINT(144 251)')),
351 ('w', 'u', 'w', GeomFromText('POINT(221 214)')),
352 ('g', 'a', 'm', GeomFromText('POINT(14 102)')),
353 ('u', 'q', 'z', GeomFromText('POINT(86 200)')),
354 ('k', 'a', 'm', GeomFromText('POINT(144 222)')),
355 ('j', 'u', 'r', GeomFromText('POINT(216 142)')),
356 ('q', 'k', 'v', GeomFromText('POINT(121 236)')),
357 ('p', 'o', 'r', GeomFromText('POINT(108 102)')),
358 ('b', 'd', 'x', GeomFromText('POINT(127 198)')),
359 ('k', 's', 'a', GeomFromText('POINT(2 150)')),
360 ('f', 'm', 'f', GeomFromText('POINT(160 191)')),
361 ('q', 'y', 'x', GeomFromText('POINT(98 111)')),
362 ('o', 'f', 'm', GeomFromText('POINT(232 218)')),
363 ('c', 'w', 'j', GeomFromText('POINT(156 165)')),
364 ('s', 'q', 'v', GeomFromText('POINT(98 161)'));
365 SET @@RAND_SEED1=692635050, @@RAND_SEED2=297339954;
366 DELETE FROM t1 ORDER BY RAND() LIMIT 10;
367 SET @@RAND_SEED1=159925977, @@RAND_SEED2=942570618;
368 DELETE FROM t1 ORDER BY RAND() LIMIT 10;
369 SET @@RAND_SEED1=328169745, @@RAND_SEED2=410451954;
370 DELETE FROM t1 ORDER BY RAND() LIMIT 10;
371 SET @@RAND_SEED1=178507359, @@RAND_SEED2=332493072;
372 DELETE FROM t1 ORDER BY RAND() LIMIT 10;
373 SET @@RAND_SEED1=1034033013, @@RAND_SEED2=558966507;
374 DELETE FROM t1 ORDER BY RAND() LIMIT 10;
375 UPDATE t1 set spatial_point=GeomFromText('POINT(230 9)') where c1 like 'y%';
376 UPDATE t1 set spatial_point=GeomFromText('POINT(95 35)') where c1 like 'j%';
377 UPDATE t1 set spatial_point=GeomFromText('POINT(93 99)') where c1 like 'a%';
378 UPDATE t1 set spatial_point=GeomFromText('POINT(19 81)') where c1 like 'r%';
379 UPDATE t1 set spatial_point=GeomFromText('POINT(20 177)') where c1 like 'h%';
380 UPDATE t1 set spatial_point=GeomFromText('POINT(221 193)') where c1 like 'u%';
381 UPDATE t1 set spatial_point=GeomFromText('POINT(195 205)') where c1 like 'd%';
382 UPDATE t1 set spatial_point=GeomFromText('POINT(15 213)') where c1 like 'u%';
383 UPDATE t1 set spatial_point=GeomFromText('POINT(214 63)') where c1 like 'n%';
384 UPDATE t1 set spatial_point=GeomFromText('POINT(243 171)') where c1 like 'c%';
385 UPDATE t1 set spatial_point=GeomFromText('POINT(198 82)') where c1 like 'y%';
386 INSERT INTO t1 (c2, c1, c3, spatial_point) VALUES
387 ('f', 'y', 'p', GeomFromText('POINT(109 235)')),
388 ('b', 'e', 'v', GeomFromText('POINT(20 48)')),
389 ('i', 'u', 'f', GeomFromText('POINT(15 55)')),
390 ('o', 'r', 'z', GeomFromText('POINT(105 64)')),
391 ('a', 'p', 'a', GeomFromText('POINT(142 236)')),
392 ('g', 'i', 'k', GeomFromText('POINT(10 49)')),
393 ('x', 'z', 'x', GeomFromText('POINT(192 200)')),
394 ('c', 'v', 'r', GeomFromText('POINT(94 168)')),
395 ('y', 'z', 'e', GeomFromText('POINT(141 51)')),
396 ('h', 'm', 'd', GeomFromText('POINT(35 251)')),
397 ('v', 'm', 'q', GeomFromText('POINT(44 90)')),
398 ('j', 'l', 'z', GeomFromText('POINT(67 237)')),
399 ('i', 'v', 'a', GeomFromText('POINT(75 14)')),
400 ('b', 'q', 't', GeomFromText('POINT(153 33)')),
401 ('e', 'm', 'a', GeomFromText('POINT(247 49)')),
402 ('l', 'y', 'g', GeomFromText('POINT(56 203)')),
403 ('v', 'o', 'r', GeomFromText('POINT(90 54)')),
404 ('r', 'n', 'd', GeomFromText('POINT(135 83)')),
405 ('j', 't', 'u', GeomFromText('POINT(174 239)')),
406 ('u', 'n', 'g', GeomFromText('POINT(104 191)')),
407 ('p', 'q', 'y', GeomFromText('POINT(63 171)')),
408 ('o', 'q', 'p', GeomFromText('POINT(192 103)')),
409 ('f', 'x', 'e', GeomFromText('POINT(244 30)')),
410 ('n', 'x', 'c', GeomFromText('POINT(92 103)')),
411 ('r', 'q', 'z', GeomFromText('POINT(166 20)')),
412 ('s', 'a', 'j', GeomFromText('POINT(137 205)')),
413 ('z', 't', 't', GeomFromText('POINT(99 134)')),
414 ('o', 'm', 'j', GeomFromText('POINT(217 3)')),
415 ('n', 'h', 'j', GeomFromText('POINT(211 17)')),
416 ('v', 'v', 'a', GeomFromText('POINT(41 137)')),
417 ('q', 'o', 'j', GeomFromText('POINT(5 92)')),
418 ('z', 'y', 'e', GeomFromText('POINT(175 212)')),
419 ('j', 'z', 'h', GeomFromText('POINT(224 194)')),
420 ('a', 'g', 'm', GeomFromText('POINT(31 119)')),
421 ('p', 'c', 'f', GeomFromText('POINT(17 221)')),
422 ('t', 'h', 'k', GeomFromText('POINT(26 203)')),
423 ('u', 'w', 'p', GeomFromText('POINT(47 185)')),
424 ('z', 'a', 'c', GeomFromText('POINT(61 133)')),
425 ('u', 'k', 'a', GeomFromText('POINT(210 115)')),
426 ('k', 'f', 'h', GeomFromText('POINT(125 113)')),
427 ('t', 'v', 'y', GeomFromText('POINT(12 239)')),
428 ('u', 'v', 'd', GeomFromText('POINT(90 24)')),
429 ('m', 'y', 'w', GeomFromText('POINT(25 243)')),
430 ('d', 'n', 'g', GeomFromText('POINT(122 92)')),
431 ('z', 'm', 'f', GeomFromText('POINT(235 110)')),
432 ('q', 'd', 'f', GeomFromText('POINT(233 217)')),
433 ('a', 'v', 'u', GeomFromText('POINT(69 59)')),
434 ('x', 'k', 'p', GeomFromText('POINT(240 14)')),
435 ('i', 'v', 'r', GeomFromText('POINT(154 42)')),
436 ('w', 'h', 'l', GeomFromText('POINT(178 156)')),
437 ('d', 'h', 'n', GeomFromText('POINT(65 157)')),
438 ('c', 'k', 'z', GeomFromText('POINT(62 33)')),
439 ('e', 'l', 'w', GeomFromText('POINT(162 1)')),
440 ('r', 'f', 'i', GeomFromText('POINT(127 71)')),
441 ('q', 'm', 'c', GeomFromText('POINT(63 118)')),
442 ('c', 'h', 'u', GeomFromText('POINT(205 203)')),
443 ('d', 't', 'p', GeomFromText('POINT(234 87)')),
444 ('s', 'g', 'h', GeomFromText('POINT(149 34)')),
445 ('o', 'b', 'q', GeomFromText('POINT(159 179)')),
446 ('k', 'u', 'f', GeomFromText('POINT(202 254)')),
447 ('u', 'f', 'g', GeomFromText('POINT(70 15)')),
448 ('x', 's', 'b', GeomFromText('POINT(25 181)')),
449 ('s', 'c', 'g', GeomFromText('POINT(252 17)')),
450 ('a', 'c', 'f', GeomFromText('POINT(89 67)')),
451 ('r', 'e', 'q', GeomFromText('POINT(55 54)')),
452 ('f', 'i', 'k', GeomFromText('POINT(178 230)')),
453 ('p', 'e', 'l', GeomFromText('POINT(198 28)')),
454 ('w', 'o', 'd', GeomFromText('POINT(204 189)')),
455 ('c', 'a', 'g', GeomFromText('POINT(230 178)')),
456 ('r', 'o', 'e', GeomFromText('POINT(61 116)')),
457 ('w', 'a', 'a', GeomFromText('POINT(178 237)')),
458 ('v', 'd', 'e', GeomFromText('POINT(70 85)')),
459 ('k', 'c', 'e', GeomFromText('POINT(147 118)')),
460 ('d', 'q', 't', GeomFromText('POINT(218 77)')),
461 ('k', 'g', 'f', GeomFromText('POINT(192 113)')),
462 ('w', 'n', 'e', GeomFromText('POINT(92 124)')),
463 ('r', 'm', 'q', GeomFromText('POINT(130 65)')),
464 ('o', 'r', 'r', GeomFromText('POINT(174 233)')),
465 ('k', 'n', 't', GeomFromText('POINT(175 147)')),
466 ('q', 'm', 'r', GeomFromText('POINT(18 208)')),
467 ('l', 'd', 'i', GeomFromText('POINT(13 104)')),
468 ('w', 'o', 'y', GeomFromText('POINT(207 39)')),
469 ('p', 'u', 'o', GeomFromText('POINT(114 31)')),
470 ('y', 'a', 'p', GeomFromText('POINT(106 59)')),
471 ('a', 'x', 'z', GeomFromText('POINT(17 57)')),
472 ('v', 'h', 'x', GeomFromText('POINT(170 13)')),
473 ('t', 's', 'u', GeomFromText('POINT(84 18)')),
474 ('z', 'z', 'f', GeomFromText('POINT(250 197)')),
475 ('l', 'z', 't', GeomFromText('POINT(59 80)')),
476 ('j', 'g', 's', GeomFromText('POINT(54 26)')),
477 ('g', 'v', 'm', GeomFromText('POINT(89 98)')),
478 ('q', 'v', 'b', GeomFromText('POINT(39 240)')),
479 ('x', 'k', 'v', GeomFromText('POINT(246 207)')),
480 ('k', 'u', 'i', GeomFromText('POINT(105 111)')),
481 ('w', 'z', 's', GeomFromText('POINT(235 8)')),
482 ('d', 'd', 'd', GeomFromText('POINT(105 4)')),
483 ('c', 'z', 'q', GeomFromText('POINT(13 140)')),
484 ('m', 'k', 'i', GeomFromText('POINT(208 120)')),
485 ('g', 'a', 'g', GeomFromText('POINT(9 182)')),
486 ('z', 'j', 'r', GeomFromText('POINT(149 153)')),
487 ('h', 'f', 'g', GeomFromText('POINT(81 236)')),
488 ('m', 'e', 'q', GeomFromText('POINT(209 215)')),
489 ('c', 'h', 'y', GeomFromText('POINT(235 70)')),
490 ('i', 'e', 'g', GeomFromText('POINT(138 26)')),
491 ('m', 't', 'u', GeomFromText('POINT(119 237)')),
492 ('o', 'w', 's', GeomFromText('POINT(193 166)')),
493 ('f', 'm', 'q', GeomFromText('POINT(85 96)')),
494 ('x', 'l', 'x', GeomFromText('POINT(58 115)')),
495 ('x', 'q', 'u', GeomFromText('POINT(108 210)')),
496 ('b', 'h', 'i', GeomFromText('POINT(250 139)')),
497 ('y', 'd', 'x', GeomFromText('POINT(199 135)')),
498 ('w', 'h', 'p', GeomFromText('POINT(247 233)')),
499 ('p', 'z', 't', GeomFromText('POINT(148 249)')),
500 ('q', 'a', 'u', GeomFromText('POINT(174 78)')),
501 ('v', 't', 'm', GeomFromText('POINT(70 228)')),
502 ('t', 'n', 'f', GeomFromText('POINT(123 2)')),
503 ('x', 't', 'b', GeomFromText('POINT(35 50)')),
504 ('r', 'j', 'f', GeomFromText('POINT(200 51)')),
505 ('s', 'q', 'o', GeomFromText('POINT(23 184)')),
506 ('u', 'v', 'z', GeomFromText('POINT(7 113)')),
507 ('v', 'u', 'l', GeomFromText('POINT(145 190)')),
508 ('o', 'k', 'i', GeomFromText('POINT(161 122)')),
509 ('l', 'y', 'e', GeomFromText('POINT(17 232)')),
510 ('t', 'b', 'e', GeomFromText('POINT(120 50)')),
511 ('e', 's', 'u', GeomFromText('POINT(254 1)')),
512 ('d', 'd', 'u', GeomFromText('POINT(167 140)')),
513 ('o', 'b', 'x', GeomFromText('POINT(186 237)')),
514 ('m', 's', 's', GeomFromText('POINT(172 149)')),
515 ('t', 'y', 'a', GeomFromText('POINT(149 85)')),
516 ('x', 't', 'r', GeomFromText('POINT(10 165)')),
517 ('g', 'c', 'e', GeomFromText('POINT(95 165)')),
518 ('e', 'e', 'z', GeomFromText('POINT(98 65)')),
519 ('f', 'v', 'i', GeomFromText('POINT(149 144)')),
520 ('o', 'p', 'm', GeomFromText('POINT(233 67)')),
521 ('t', 'u', 'b', GeomFromText('POINT(109 215)')),
522 ('o', 'o', 'b', GeomFromText('POINT(130 48)')),
523 ('e', 'm', 'h', GeomFromText('POINT(88 189)')),
524 ('e', 'v', 'y', GeomFromText('POINT(55 29)')),
525 ('e', 't', 'm', GeomFromText('POINT(129 55)')),
526 ('p', 'p', 'i', GeomFromText('POINT(126 222)')),
527 ('c', 'i', 'c', GeomFromText('POINT(19 158)')),
528 ('c', 'b', 's', GeomFromText('POINT(13 19)')),
529 ('u', 'y', 'a', GeomFromText('POINT(114 5)')),
530 ('a', 'o', 'f', GeomFromText('POINT(227 232)')),
531 ('t', 'c', 'z', GeomFromText('POINT(63 62)')),
532 ('d', 'o', 'k', GeomFromText('POINT(48 228)')),
533 ('x', 'c', 'e', GeomFromText('POINT(204 2)')),
534 ('e', 'e', 'g', GeomFromText('POINT(125 43)')),
535 ('o', 'r', 'f', GeomFromText('POINT(171 140)'));
536 UPDATE t1 set spatial_point=GeomFromText('POINT(163 157)') where c1 like 'w%';
537 UPDATE t1 set spatial_point=GeomFromText('POINT(53 151)') where c1 like 'd%';
538 UPDATE t1 set spatial_point=GeomFromText('POINT(96 183)') where c1 like 'r%';
539 UPDATE t1 set spatial_point=GeomFromText('POINT(57 91)') where c1 like 'q%';
540 UPDATE t1 set spatial_point=GeomFromText('POINT(202 110)') where c1 like 'c%';
541 UPDATE t1 set spatial_point=GeomFromText('POINT(120 137)') where c1 like 'w%';
542 UPDATE t1 set spatial_point=GeomFromText('POINT(207 147)') where c1 like 'c%';
543 UPDATE t1 set spatial_point=GeomFromText('POINT(31 125)') where c1 like 'e%';
544 UPDATE t1 set spatial_point=GeomFromText('POINT(27 36)') where c1 like 'r%';
545 INSERT INTO t1 (c2, c1, c3, spatial_point) VALUES
546 ('b', 'c', 'e', GeomFromText('POINT(41 137)')),
547 ('p', 'y', 'k', GeomFromText('POINT(50 22)')),
548 ('s', 'c', 'h', GeomFromText('POINT(208 173)')),
549 ('x', 'u', 'l', GeomFromText('POINT(199 175)')),
550 ('s', 'r', 'h', GeomFromText('POINT(85 192)')),
551 ('j', 'k', 'u', GeomFromText('POINT(18 25)')),
552 ('p', 'w', 'h', GeomFromText('POINT(152 197)')),
553 ('e', 'd', 'c', GeomFromText('POINT(229 3)')),
554 ('o', 'x', 'k', GeomFromText('POINT(187 155)')),
555 ('o', 'b', 'k', GeomFromText('POINT(208 150)')),
556 ('d', 'a', 'j', GeomFromText('POINT(70 87)')),
557 ('f', 'e', 'k', GeomFromText('POINT(156 96)')),
558 ('u', 'y', 'p', GeomFromText('POINT(239 193)')),
559 ('n', 'v', 'p', GeomFromText('POINT(223 98)')),
560 ('z', 'j', 'r', GeomFromText('POINT(87 89)')),
561 ('h', 'x', 'x', GeomFromText('POINT(92 0)')),
562 ('r', 'v', 'r', GeomFromText('POINT(159 139)')),
563 ('v', 'g', 'g', GeomFromText('POINT(16 229)')),
564 ('z', 'k', 'u', GeomFromText('POINT(99 52)')),
565 ('p', 'p', 'o', GeomFromText('POINT(105 125)')),
566 ('w', 'h', 'y', GeomFromText('POINT(105 154)')),
567 ('v', 'y', 'z', GeomFromText('POINT(134 238)')),
568 ('x', 'o', 'o', GeomFromText('POINT(178 88)')),
569 ('z', 'w', 'd', GeomFromText('POINT(123 60)')),
570 ('q', 'f', 'u', GeomFromText('POINT(64 90)')),
571 ('s', 'n', 't', GeomFromText('POINT(50 138)')),
572 ('v', 'p', 't', GeomFromText('POINT(114 91)')),
573 ('a', 'o', 'n', GeomFromText('POINT(78 43)')),
574 ('k', 'u', 'd', GeomFromText('POINT(185 161)')),
575 ('w', 'd', 'n', GeomFromText('POINT(25 92)')),
576 ('k', 'w', 'a', GeomFromText('POINT(59 238)')),
577 ('t', 'c', 'f', GeomFromText('POINT(65 87)')),
578 ('g', 's', 'p', GeomFromText('POINT(238 126)')),
579 ('d', 'n', 'y', GeomFromText('POINT(107 173)')),
580 ('l', 'a', 'w', GeomFromText('POINT(125 152)')),
581 ('m', 'd', 'j', GeomFromText('POINT(146 53)')),
582 ('q', 'm', 'c', GeomFromText('POINT(217 187)')),
583 ('i', 'r', 'r', GeomFromText('POINT(6 113)')),
584 ('e', 'j', 'b', GeomFromText('POINT(37 83)')),
585 ('w', 'w', 'h', GeomFromText('POINT(83 199)')),
586 ('k', 'b', 's', GeomFromText('POINT(170 64)')),
587 ('s', 'b', 'c', GeomFromText('POINT(163 130)')),
588 ('c', 'h', 'a', GeomFromText('POINT(141 3)')),
589 ('k', 'j', 'u', GeomFromText('POINT(143 76)')),
590 ('r', 'h', 'o', GeomFromText('POINT(243 92)')),
591 ('i', 'd', 'b', GeomFromText('POINT(205 13)')),
592 ('r', 'y', 'q', GeomFromText('POINT(138 8)')),
593 ('m', 'o', 'i', GeomFromText('POINT(36 45)')),
594 ('v', 'g', 'm', GeomFromText('POINT(0 40)')),
595 ('f', 'e', 'i', GeomFromText('POINT(76 6)')),
596 ('c', 'q', 'q', GeomFromText('POINT(115 248)')),
597 ('x', 'c', 'i', GeomFromText('POINT(29 74)')),
598 ('l', 's', 't', GeomFromText('POINT(83 18)')),
599 ('t', 't', 'a', GeomFromText('POINT(26 168)')),
600 ('u', 'n', 'x', GeomFromText('POINT(200 110)')),
601 ('j', 'b', 'd', GeomFromText('POINT(216 136)')),
602 ('s', 'p', 'w', GeomFromText('POINT(38 156)')),
603 ('f', 'b', 'v', GeomFromText('POINT(29 186)')),
604 ('v', 'e', 'r', GeomFromText('POINT(149 40)')),
605 ('v', 't', 'm', GeomFromText('POINT(184 24)')),
606 ('y', 'g', 'a', GeomFromText('POINT(219 105)')),
607 ('s', 'f', 'i', GeomFromText('POINT(114 130)')),
608 ('e', 'q', 'h', GeomFromText('POINT(203 135)')),
609 ('h', 'g', 'b', GeomFromText('POINT(9 208)')),
610 ('o', 'l', 'r', GeomFromText('POINT(245 79)')),
611 ('s', 's', 'v', GeomFromText('POINT(238 198)')),
612 ('w', 'w', 'z', GeomFromText('POINT(209 232)')),
613 ('v', 'd', 'n', GeomFromText('POINT(30 193)')),
614 ('q', 'w', 'k', GeomFromText('POINT(133 18)')),
615 ('o', 'h', 'o', GeomFromText('POINT(42 140)')),
616 ('f', 'f', 'h', GeomFromText('POINT(145 1)')),
617 ('u', 's', 'r', GeomFromText('POINT(70 62)')),
618 ('x', 'n', 'q', GeomFromText('POINT(33 86)')),
619 ('u', 'p', 'v', GeomFromText('POINT(232 220)')),
620 ('z', 'e', 'a', GeomFromText('POINT(130 69)')),
621 ('r', 'u', 'z', GeomFromText('POINT(243 241)')),
622 ('b', 'n', 't', GeomFromText('POINT(120 12)')),
623 ('u', 'f', 's', GeomFromText('POINT(190 212)')),
624 ('a', 'd', 'q', GeomFromText('POINT(235 191)')),
625 ('f', 'q', 'm', GeomFromText('POINT(176 2)')),
626 ('n', 'c', 's', GeomFromText('POINT(218 163)')),
627 ('e', 'm', 'h', GeomFromText('POINT(163 108)')),
628 ('c', 'f', 'l', GeomFromText('POINT(220 115)')),
629 ('c', 'v', 'q', GeomFromText('POINT(66 45)')),
630 ('w', 'v', 'x', GeomFromText('POINT(251 220)')),
631 ('f', 'w', 'z', GeomFromText('POINT(146 149)')),
632 ('h', 'n', 'h', GeomFromText('POINT(148 128)')),
633 ('y', 'k', 'v', GeomFromText('POINT(28 110)')),
634 ('c', 'x', 'q', GeomFromText('POINT(13 13)')),
635 ('e', 'd', 's', GeomFromText('POINT(91 190)')),
636 ('c', 'w', 'c', GeomFromText('POINT(10 231)')),
637 ('u', 'j', 'n', GeomFromText('POINT(250 21)')),
638 ('w', 'n', 'x', GeomFromText('POINT(141 69)')),
639 ('f', 'p', 'y', GeomFromText('POINT(228 246)')),
640 ('d', 'q', 'f', GeomFromText('POINT(194 22)')),
641 ('d', 'z', 'l', GeomFromText('POINT(233 181)')),
642 ('c', 'a', 'q', GeomFromText('POINT(183 96)')),
643 ('m', 'i', 'd', GeomFromText('POINT(117 226)')),
644 ('z', 'y', 'y', GeomFromText('POINT(62 81)')),
645 ('g', 'v', 'm', GeomFromText('POINT(66 158)'));
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)) transactional=1 row_format=page;
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) ) transactional=1 row_format=page;
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)) transactional=1 row_format=page;
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)) transactional=1 row_format=page;
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.