Description:
InnoDB returns an error when it tries to use an index with a spatial function. This is a change to the behaviour of the fix for Bug #32125.
How to repeat:
DROP TABLE IF EXISTS test;
CREATE TABLE test (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
foo GEOMETRY NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO test(foo) VALUES(GeomFromText('Polygon((0 0,0 3,3 3,3 0,0 0))'));
SELECT id, AsText(foo) FROM test WHERE Contains(foo,GeomFromText('Polygon((0 0,0 3,3 3,3 0,0 0))'));
ALTER TABLE test ADD INDEX(foo(100));
SELECT id, AsText(foo) FROM test WHERE Contains(foo,GeomFromText('Polygon((0 0,0 3,3 3,3 0,0 0))'));
SELECT id, AsText(foo) FROM test IGNORE INDEX(foo) WHERE Contains(foo,GeomFromText('Polygon((0 0,0 3,3 3,3 0,0 0))'));
Suggested fix:
InnoDB should ignore the index for spatial functions.