Details
-
Task
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
Description
from 5.5.44
| gpd | CREATE TABLE `gpd` (
|
`recID` int(11) NOT NULL AUTO_INCREMENT,
|
`sessionID` int(11) DEFAULT NULL,
|
`time` decimal(12,0) DEFAULT NULL,
|
`position` int(11) DEFAULT NULL,
|
`angle` int(11) DEFAULT NULL,
|
`velocity` decimal(12,6) DEFAULT NULL,
|
`acceleration` decimal(12,6) DEFAULT NULL,
|
`forcePlate` decimal(12,6) DEFAULT '0.000000',
|
PRIMARY KEY (`recID`),
|
KEY `sessionID` (`sessionID`)
|
) ENGINE=InnoDB AUTO_INCREMENT=464380557 DEFAULT CHARSET=latin1 |
|
Queries like this should end up as 'Impossible Where' the same as 'WHERE 0' is used. Same with > or < as an operator.
explain SELECT 1 FROM `gpd` WHERE `gpd`.`sessionID` != `gpd`.`sessionID`;
|
+------+-------------+---------------+-------+---------------+-----------+---------+------+-----------+--------------------------+
|
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
|
+------+-------------+---------------+-------+---------------+-----------+---------+------+-----------+--------------------------+
|
| 1 | SIMPLE | gpd | index | NULL | sessionID | 5 | NULL | 461252463 | Using where; Using index |
|
I came across this and was potentially generated from the depths of an ORM (sqlalchemy)