Bug #32100 | contains, intersects functions never return. Query disconnects or times out. | ||
---|---|---|---|
Submitted: | 5 Nov 2007 10:43 | Modified: | 22 Nov 2007 17:04 |
Reporter: | John Powell | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: MyISAM storage engine | Severity: | S4 (Feature request) |
Version: | Ver 8.42 Distrib 5.1.20-beta | OS: | Linux |
Assigned to: | Alexey Botchkov | CPU Architecture: | Any |
Tags: | contains, gis, intersects |
[5 Nov 2007 10:43]
John Powell
[22 Nov 2007 17:04]
Alexey Botchkov
John, thanks for the testcase!
[23 Nov 2007 10:55]
Lenz Grimmer
Patch is available from here: http://mysql.bkbits.net:8080/mysql-5.1-wl1326/?PAGE=gnupatch&REV=1.2573.25.2
[24 Apr 2008 16:05]
Monty Muth
This bug is also in 5.1.23-gis. I abort the testcase after 15 minutes on a Intel Dual Core - 2GHz - win32. In which version is this fixed? The Link to the Patch don't work.
[7 Jul 2009 11:18]
Lenz Grimmer
Verified as fixed with a recent 5.1 snapshot build: mysql> DELIMITER $$ mysql> mysql> DROP PROCEDURE IF EXISTS `gml`.`testGeom`$$ Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> CREATE DEFINER=`root`@`localhost` PROCEDURE `testGeom`(numGeoms int, circ lePoints int) -> BEGIN -> declare counter, circlecount int; -> declare g varchar(15000); -> -> declare x, y, width, cx, cy, radians real; -> declare line geometry; -> declare len int; -> set g=''; -> -> set cy=0;set cx=0; -> -> drop table if exists coords; -> create table coords(geom geometry not null, spatial index (geom)); -> -> set counter=0; -> set circlecount=0; -> set radians=2*PI()/circlePoints; -> -> while counter<numGeoms do -> set width=rand()*100; -> set cx=rand()*100; -> set cy=rand()*100; -> -> while circlecount<circlePoints do -> set x=cos(circleCount*radians)*width+cx; -> set y=sin(circleCount*radians)*width+cy; -> set g=concat(x, ' ', y, ', ',g); -> set circlecount=circlecount+1; -> end while; -> -> set len=length(g)-2; -> set g=substring(g,1,len); -> set g=concat('LINESTRING(',g,')'); -> -> insert into coords values(geomfromtext(g)); -> -> set circlecount=0; -> set counter=counter+1; -> set g=''; -> -> end while; -> END$$ Query OK, 0 rows affected (0.05 sec) mysql> DELIMITER ; mysql> call testGeom(10000,100); Query OK, 1 row affected, 1 warning (18.62 sec) mysql> set @g=geomfromtext('POLYGON((-20 -20, -10 -20, -10 -10, -20 -10, -20 -20 ))'); Query OK, 0 rows affected (0.01 sec) mysql> select count(*) from coords where mbrintersects(@g, geom); +----------+ | count(*) | +----------+ | 2424 | +----------+ 1 row in set (0.76 sec) mysql> select count(*) from coords where intersects(@g, geom); +----------+ | count(*) | +----------+ | 653 | +----------+ 1 row in set (0.09 sec)