Bug #19281 Partitions: auto_increment=value lost
Submitted: 22 Apr 2006 19:44 Modified: 23 Jun 2006 6:23
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Partitions Severity:S3 (Non-critical)
Version:5.1.10-beta-debug OS:Linux (Linux, SUSE 10.0 / 64-bit)
Assigned to: Mikael Ronström CPU Architecture:Any

[22 Apr 2006 19:44] Peter Gulutzan
Description:
I create a partitioned table with an "auto_increment=100" clause.
I create an index on the table. (If I don't do so, all is well.)
I insert NULL.
I select. Instead of '100' (which I get if I don't partition), I see '1'.

How to repeat:
mysql> create table th (s1 int auto_increment primary key) auto_increment=100 partition by list (s1) (partition p2 values in (1));
Query OK, 0 rows affected (0.01 sec)

mysql> create index ith on th (s1);
Query OK, 0 rows affected (0.37 sec)
Records: 0  Duplicates: 0  Warnings: 0

mysql> insert into th values (null);
Query OK, 1 row affected (0.00 sec)

mysql> select * from th;
+----+
| s1 |
+----+
|  1 |
+----+
1 row in set (0.01 sec)
[24 Apr 2006 14:10] Valeriy Kravchuk
Verified just as described with 5.1.10-BK (ChangeSet@1.2357, 2006-04-23 18:15:41+02:00):

mysql> create table th (s1 int auto_increment primary key) auto_increment=100
    -> partition by list (s1) (partition p2 values in (1));
Query OK, 0 rows affected (0.03 sec)

mysql> create index ith on th (s1);
Query OK, 0 rows affected (0.03 sec)
Records: 0  Duplicates: 0  Warnings: 0

mysql> insert into th values (null);
Query OK, 1 row affected (0.01 sec)

mysql> insert into th values (null);
ERROR 1505 (HY000): Table has no partition for value 2
mysql> select * from th;
+----+
| s1 |
+----+
|  1 |
+----+
1 row in set (0.02 sec)
[15 Jun 2006 16:58] Mikael Ronström
Had to make a proper implementation of the handler method
update_create_info
[20 Jun 2006 8:55] Mikael Ronström
Approved by Sergei Gluhov
[22 Jun 2006 7:23] Mikael Ronström
Patch will appear in 5.1.12
[23 Jun 2006 6:23] 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 bugfix in 5.1.12 changelog; closed.