Bug #11521 | Negative integer keys incorrectly substituted for 0 during range analysis. | ||
---|---|---|---|
Submitted: | 23 Jun 2005 6:35 | Modified: | 15 Dec 2009 16:57 |
Reporter: | Timour Katchaounov | Email Updates: | |
Status: | Can't repeat | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S2 (Serious) |
Version: | 4.1 and 5.x | OS: | Any (all) |
Assigned to: | CPU Architecture: | Any |
[23 Jun 2005 6:35]
Timour Katchaounov
[15 Dec 2009 16:57]
Valeriy Kravchuk
I can not repeat this with current 5.0 from bzr: 77-52-7-73:5.0 openxs$ bin/mysql -uroot test Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.0.89-debug Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> drop table t2; Query OK, 0 rows affected (0.00 sec) mysql> create table t2 (a tinyint unsigned); Query OK, 0 rows affected (0.00 sec) mysql> create index t2i on t2(a); Query OK, 0 rows affected (0.05 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql> insert into t2 values (0), (254), (255); Query OK, 3 rows affected (0.04 sec) Records: 3 Duplicates: 0 Warnings: 0 mysql> mysql> explain select * from t2 where a > -1; +----+-------------+-------+-------+---------------+------+---------+------+------+--------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+-------+---------------+------+---------+------+------+--------------------------+ | 1 | SIMPLE | t2 | index | t2i | t2i | 2 | NULL | 3 | Using where; Using index | +----+-------------+-------+-------+---------------+------+---------+------+------+--------------------------+ 1 row in set (0.06 sec) mysql> select * from t2 where a > -1; +------+ | a | +------+ | 0 | | 254 | | 255 | +------+ 3 rows in set (0.00 sec) So, the bug was fixed somehow already.