1#******************************************************** 2# Bug 17057168 - LARGE PERFORMANCE REGRESSION FOR INNODB 3# GEOMETRY/SPATIAL INDEX LOOKUP 4#******************************************************** 5--source include/have_geometry.inc 6--source include/not_embedded.inc 7--source include/no_valgrind_without_big.inc 8 9CREATE DATABASE geotest; 10use geotest; 11CREATE TABLE tmp (id int unsigned NOT NULL PRIMARY KEY); 12INSERT INTO tmp VALUES (0), (1), (2), (3), (4), (5), (6), (7), (8), (9); 13INSERT INTO tmp SELECT 10+id FROM tmp; 14INSERT INTO tmp SELECT 20+id FROM tmp; 15INSERT INTO tmp SELECT 40+id FROM tmp; 16INSERT INTO tmp SELECT 80+id FROM tmp; 17 18CREATE TABLE t1 (id int unsigned NOT NULL auto_increment PRIMARY KEY, 19location point, INDEX (location)) ENGINE=InnoDB; 20INSERT INTO t1 (location) SELECT POINT(tmp1.id, tmp2.id) FROM tmp tmp1, 21tmp tmp2 ORDER BY tmp1.id, tmp2.id; 22 23#Befor fix, the row number will be the total number of index recs, 24#After fix, the row number will be 1. 25EXPLAIN SELECT id, ST_AsText(location) FROM t1 WHERE location = POINT(1, 262); 27SELECT id, ST_AsText(location) FROM t1 WHERE location = POINT(1, 2); 28 29DROP TABLE t1; 30DROP TABLE tmp; 31 32DROP DATABASE geotest; 33