Bug #2823 auto_increment bug with (unsigned) bigint
Submitted: 16 Feb 2004 5:30 Modified: 24 Feb 2004 11:10
Reporter: Florent Bourgeois Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.0.16 OS:MacOS (OS X)
Assigned to: CPU Architecture:Any

[16 Feb 2004 5:30] Florent Bourgeois
Description:
The mysql auto_increment value of a second insert is wrong with unsigned bigint fields. The second insert is indeed set as if it was a MAX value.
I have seen similar bugfixs in past reports (#1366, #54) but not exactly the same.

How to repeat:
this is the table :
id - bigint(20) - unsigned - PRI - auto_increment
title - text

when i add an entry, no problem : the "id" is "1"
INSERT INTO mytable title = "test";

the bug appear with the next insert :
the value of the auto_increment field is like the MAX bigint
try with the following syntax :
- INSERT INTO mytable title = "test";
- INSERT INTO mytable id = "NULL", title = "test";

Suggested fix:
do the same but with unsigned int (quite limitative) and it works (but doesn't fix)
[24 Feb 2004 11:10] MySQL Verification Team
Can't repeat it.

It is either a fixed bug or bad build.

mysql> create table test (id bigint(20) auto_increment primary key, title text);
Query OK, 0 rows affected (0.01 sec)

mysql> insert into test set title="test";
Query OK, 1 row affected (0.00 sec)

mysql> insert into test set title="test";
Query OK, 1 row affected (0.01 sec)

mysql> insert into test set id=NULL, title="test";
Query OK, 1 row affected (0.00 sec)

mysql> select * from test;
+----+-------+
| id | title |
+----+-------+
|  1 | test  |
|  2 | test  |
|  3 | test  |
+----+-------+
3 rows in set (0.00 sec)