>>>>> "John" == John Birrell <jb@stripped> writes:
create table t1 (id int not null auto_increment primary key, username varchar(32) not
null, unique (username));
insert into t1 values (0,"mysql");
insert into t1 values (0,"mysql ab");
insert into t1 values (0,"mysql a");
insert into t1 values (0,"r1manic");
insert into t1 values (0,"r1man");
>
>> The above worked without any problems.
John> I cut and pasted your test and this is what I got:
mysql> create table t1 (id int not null auto_increment primary key, username
> varchar(32) not null, unique (username));
John> Query OK, 0 rows affected (0.05 sec)
mysql> insert into t1 values (0,"mysql");
John> Query OK, 1 row affected (0.01 sec)
mysql> insert into t1 values (0,"mysql ab");
John> Query OK, 1 row affected (0.00 sec)
mysql> insert into t1 values (0,"mysql a");
John> ERROR 1062: Duplicate entry 'mysql a' for key 2
mysql> insert into t1 values (0,"r1manic");
John> Query OK, 1 row affected (0.00 sec)
mysql> insert into t1 values (0,"r1man");
John> ERROR 1062: Duplicate entry 'r1man' for key 2
mysql>
John> Did you use an embedded server for your test?
No, I used MySQL 3.23; When testing with MySQL 4.0 (not embedded) I
got the same problem.
Actually, after thinking a bit, I do know the problem.
Sergei has been working on speeding up handling of packed keys in
MySQL 4.0 with 50-200 %. Just before going on vacation he did
however introduce a bug in the new code. (The bug also shows up when
running mysql-test-run).
Sergei should come home next week and fixing this will be on top on
his priority list.
Regards,
Monty