Bug #30991 Wrong MBRIntersect results when spatial index is used on sparc
Submitted: 13 Sep 2007 7:31 Modified: 14 Sep 2007 12:05
Reporter: Hartmut Holzgraefe Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: MyISAM storage engine Severity:S2 (Serious)
Version:5.0.45 OS:Solaris (Solaris/Sparc)
Assigned to: CPU Architecture:Any
Tags: gis, spatial

[13 Sep 2007 7:31] Hartmut Holzgraefe
Description:
When using MBRIntersect on Solaris/Sparc a query using a spatial index matches less result rows than a query with a spatial index. On Linux/x86 both queries produce the same result set.

How to repeat:
both queries below should deliver all three test rows,
but on Solaris/Sparc only the one ignoring the index
actually does.

DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
  `g` GEOMETRY NOT NULL default '',
  `id` int(11) NOT NULL auto_increment,
  PRIMARY KEY  (`id`),
  SPATIAL KEY `g` (`g`)
) ENGINE=MyISAM;

INSERT INTO t1 SET g = GeomFromText('LINESTRING(26.59 32.95, 25.84 29.41, 24.96 25.23)');
INSERT INTO t1 SET g = GeomFromText('LINESTRING(56.15 48.95, 54.35 47.00, 62.45 39.75)');
INSERT INTO t1 SET g = GeomFromText('LINESTRING(22.79 17.89, 23.88 18.45, 24.24 18.74)');

SELECT AsText(Envelope(g)), AsText(g)
  FROM t1
 WHERE (MBRIntersects(g,GeomFromText('Polygon((24 18, 24 40, 55 40, 55 18, 24 18))')));

SELECT AsText(Envelope(g)), AsText(g)
  FROM t1 IGNORE INDEX (g)
 WHERE (MBRIntersects(g,GeomFromText('Polygon((24 18, 24 40, 55 40, 55 18, 24 18))')));
[13 Sep 2007 7:35] Hartmut Holzgraefe
Probably related to Bug #30978
[14 Sep 2007 12:05] Hartmut Holzgraefe
Duplicate of Bug #29070, fixed in MySQL 5.0.48