Details
Description
DROP TABLE IF EXISTS t1; CREATE TABLE t1 (a GEOMETRY NOT NULL, SPATIAL KEY(a)) ENGINE=MyISAM; INSERT INTO t1 VALUES (Point(1,1)),(Point(2,2)),(Point(3,3)); EXPLAIN SELECT * FROM t1 WHERE CONTAINS(a,1);
returns
+------+-------------+-------+------+---------------+------+---------+------+------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +------+-------------+-------+------+---------------+------+---------+------+------+-------------+ | 1 | SIMPLE | t1 | ALL | a | NULL | NULL | NULL | 3 | Using where | +------+-------------+-------+------+---------------+------+---------+------+------+-------------+
This is wrong. CONTAINS() and other spatial relations should report "Impossible WHERE" on attempt to use non-geometry values. There is no a need to do the full table scan, the result will be empty set anyway.
Gliffy Diagrams
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions