| 1 |
# restart |
| 2 |
create table t1 (c1 int, c2 geometry not null SRID 0, spatial index (c2))engine=innodb; |
| 3 |
create procedure insert_t1(IN total int) |
| 4 |
begin |
| 5 |
declare i int default 1; |
| 6 |
while (i <= total) DO |
| 7 |
insert into t1 values (i, Point(i, i)); |
| 8 |
set i = i + 1; |
| 9 |
end while; |
| 10 |
end| |
| 11 |
create procedure update_t1(IN total int) |
| 12 |
begin |
| 13 |
declare i int default 1; |
| 14 |
while (i <= total) DO |
| 15 |
update t1 set c2 = Point(i + 10000, i + 10000) where c2 = Point(i, i); |
| 16 |
set i = i + 1; |
| 17 |
end while; |
| 18 |
end| |
| 19 |
CALL insert_t1(367); |
| 20 |
COMMIT; |
| 21 |
# Kill and restart |
| 22 |
check table t1; |
| 23 |
Table Op Msg_type Msg_text |
| 24 |
test.t1 check status OK |
| 25 |
drop table t1; |
| 26 |
create table t1 (c1 int, c2 point not null SRID 0, spatial index (c2))engine=innodb; |
| 27 |
CALL insert_t1(367); |
| 28 |
CALL update_t1(367); |
| 29 |
SET @poly1 = ST_GeomFromText('POLYGON((10000 10000, 10000 10350, 10350 10350, 10350 10000, 10000 10000))'); |
| 30 |
delete from t1 where ST_Contains(@poly1, c2); |
| 31 |
COMMIT; |
| 32 |
# Kill and restart |
| 33 |
check table t1; |
| 34 |
Table Op Msg_type Msg_text |
| 35 |
test.t1 check status OK |
| 36 |
select count(*) from t1; |
| 37 |
count(*) |
| 38 |
18 |
| 39 |
select c1, ST_astext(c2) from t1; |
| 40 |
c1 ST_astext(c2) |
| 41 |
350 POINT(10350 10350) |
| 42 |
351 POINT(10351 10351) |
| 43 |
352 POINT(10352 10352) |
| 44 |
353 POINT(10353 10353) |
| 45 |
354 POINT(10354 10354) |
| 46 |
355 POINT(10355 10355) |
| 47 |
356 POINT(10356 10356) |
| 48 |
357 POINT(10357 10357) |
| 49 |
358 POINT(10358 10358) |
| 50 |
359 POINT(10359 10359) |
| 51 |
360 POINT(10360 10360) |
| 52 |
361 POINT(10361 10361) |
| 53 |
362 POINT(10362 10362) |
| 54 |
363 POINT(10363 10363) |
| 55 |
364 POINT(10364 10364) |
| 56 |
365 POINT(10365 10365) |
| 57 |
366 POINT(10366 10366) |
| 58 |
367 POINT(10367 10367) |
| 59 |
drop procedure insert_t1; |
| 60 |
drop procedure update_t1; |
| 61 |
drop table t1; |