From: Date: March 14 2005 5:07pm Subject: bk commit into 4.1 tree (ramil:1.2112) BUG#8489 List-Archive: http://lists.mysql.com/internals/23004 X-Bug: 8489 Message-Id: <200503141607.j2EG71B4036565@gw.mysql.r18.ru> Below is the list of changes that have just been committed into a local 4.1 repository of ram. When ram does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet 1.2112 05/03/14 20:06:56 ramil@stripped +3 -0 a fix (bug #8489: Strange auto_increment behaviour with HEAP table). sql/ha_heap.cc 1.50 05/03/14 20:06:52 ramil@stripped +1 -1 a fix (bug #8489: Strange auto_increment behaviour with HEAP table). Should check here for primary_key too as we can have auto_increment field as a part of other keys. mysql-test/t/heap.test 1.20 05/03/14 20:06:52 ramil@stripped +17 -0 a fix (bug #8489: Strange auto_increment behaviour with HEAP table). mysql-test/r/heap.result 1.28 05/03/14 20:06:52 ramil@stripped +21 -0 a fix (bug #8489: Strange auto_increment behaviour with HEAP table). # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: ramil # Host: gw.mysql.r18.ru # Root: /usr/home/ram/work/4.1 --- 1.49/sql/ha_heap.cc 2005-02-09 00:44:49 +04:00 +++ 1.50/sql/ha_heap.cc 2005-03-14 20:06:52 +04:00 @@ -506,7 +506,7 @@ seg->null_bit= 0; seg->null_pos= 0; } - if (field->flags & AUTO_INCREMENT_FLAG) + if (field->flags & AUTO_INCREMENT_FLAG && table_arg->primary_key == key) { auto_key= key + 1; auto_key_type= field->key_type(); --- 1.27/mysql-test/r/heap.result 2004-12-02 15:06:11 +04:00 +++ 1.28/mysql-test/r/heap.result 2005-03-14 20:06:52 +04:00 @@ -249,3 +249,24 @@ 3 2 drop table t1; +create table t1 (a bigint unsigned auto_increment primary key, b int, +key (b, a)) engine=heap; +insert t1 (b) values (1); +insert t1 (b) values (1); +insert t1 (b) values (1); +insert t1 (b) values (1); +insert t1 (b) values (1); +insert t1 (b) values (1); +insert t1 (b) values (1); +insert t1 (b) values (1); +select * from t1; +a b +1 1 +2 1 +3 1 +4 1 +5 1 +6 1 +7 1 +8 1 +drop table t1; --- 1.19/mysql-test/t/heap.test 2004-12-02 15:06:11 +04:00 +++ 1.20/mysql-test/t/heap.test 2005-03-14 20:06:52 +04:00 @@ -195,3 +195,20 @@ insert into t1 values ('2'), ('3'); select * from t1; drop table t1; + +# +# Bug #8489: Strange auto_increment behaviour +# + +create table t1 (a bigint unsigned auto_increment primary key, b int, + key (b, a)) engine=heap; +insert t1 (b) values (1); +insert t1 (b) values (1); +insert t1 (b) values (1); +insert t1 (b) values (1); +insert t1 (b) values (1); +insert t1 (b) values (1); +insert t1 (b) values (1); +insert t1 (b) values (1); +select * from t1; +drop table t1;