Bug #14526 Partitions: indexed searches fail
Submitted: 31 Oct 2005 21:19 Modified: 15 Mar 2006 9:00
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Partitions Severity:S1 (Critical)
Version:5.1.2-alpha-debug OS:Linux (SUSE 10.0)
Assigned to: Jim Winstead CPU Architecture:Any

[31 Oct 2005 21:19] Peter Gulutzan
Description:
After I update a partitioned table, "select ... where indexed_column=value"
fails. It doesn't find rows that clearly exist.

How to repeat:
mysql> create table t2 (s1 int not null auto_increment, key (s1)) partition by list (s1) (partition p1 values in (1),partition p2 values in (2),partition p3 values in (3),partition p4 values in (4));
Query OK, 0 rows affected (0.04 sec)

mysql> insert into t2 values (null),(null),(null);
Query OK, 3 rows affected (0.01 sec)
Records: 3  Duplicates: 0  Warnings: 0

mysql> select * from t2;
+----+
| s1 |
+----+
|  1 |
|  2 |
|  3 |
+----+
3 rows in set (0.00 sec)

mysql> select * from t2 where s1 < 2;
+----+
| s1 |
+----+
|  1 |
+----+
1 row in set (0.00 sec)

mysql> update t2 set s1 = s1 + 1;
Query OK, 3 rows affected (0.00 sec)
Rows matched: 3  Changed: 3 
mysql> select * from t2 where s1 < 3;
+----+
| s1 |
+----+
|  2 |
+----+
1 row in set (0.00 sec)

mysql> select * from t2 where s1 = 2;
Empty set (0.00 sec)
[16 Feb 2006 20:18] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/2748
[13 Mar 2006 19:05] Jim Winstead
Fixed in 5.1.8.
[15 Mar 2006 9:00] Jon Stephens
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

Documented in 5.1.8 changelog. Closed.