Bug #19133 ERROR 1062 (23000): Duplicate entry '127' for key 1

Submitted: 16 Apr 2006 19:51 Modified: 17 Apr 2006 13:07
Reporter: Rajesh Mahajan Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.1.14-Debian_6-log OS:Linux (Debian)
Assigned to: CPU Architecture:Any

[16 Apr 2006 19:51] Rajesh Mahajan
Description:
I m not able to insert a record into admin_log,It is showing duplicate entry of id field 

mysql> select * from admin_log;
+-----+---------------------+--------+---------------------------------+
| id  | time                | aduser | action                          |
+-----+---------------------+--------+---------------------------------+
| 127 | 2006-04-16 10:05:21 | admin1 | gg.com allowd to localok Policy |
+-----+---------------------+--------+---------------------------------+
1 row in set (0.00 sec)

mysql> desc admin_log;
+--------+--------------+------+-----+-------------------+----------------+
| Field  | Type         | Null | Key | Default           | Extra          |
+--------+--------------+------+-----+-------------------+----------------+
| id     | tinyint(4)   |      | PRI | NULL              | auto_increment |
| time   | timestamp    | YES  |     | CURRENT_TIMESTAMP |                |
| aduser | varchar(20)  |      |     |                   |                |
| action | varchar(100) |      |     |                   |                |
+--------+--------------+------+-----+-------------------+----------------+
4 rows in set (0.01 sec)

mysql> insert into admin_log (time,aduser,action) values (NOW(),'admin1','gg.com allowd to localok Policy');
ERROR 1062 (23000): Duplicate entry '127' for key 1
mysql>

How to repeat:
mysql> select * from admin_log;
+-----+---------------------+--------+---------------------------------+
| id  | time                | aduser | action                          |
+-----+---------------------+--------+---------------------------------+
| 127 | 2006-04-16 10:05:21 | admin1 | gg.com allowd to localok Policy |
+-----+---------------------+--------+---------------------------------+
1 row in set (0.00 sec)

mysql> desc admin_log;
+--------+--------------+------+-----+-------------------+----------------+
| Field  | Type         | Null | Key | Default           | Extra          |
+--------+--------------+------+-----+-------------------+----------------+
| id     | tinyint(4)   |      | PRI | NULL              | auto_increment |
| time   | timestamp    | YES  |     | CURRENT_TIMESTAMP |                |
| aduser | varchar(20)  |      |     |                   |                |
| action | varchar(100) |      |     |                   |                |
+--------+--------------+------+-----+-------------------+----------------+
4 rows in set (0.01 sec)

mysql> insert into admin_log (time,aduser,action) values (NOW(),'admin1','gg.com allowd to localok Policy');
ERROR 1062 (23000): Duplicate entry '127' for key 1
[17 Apr 2006 10:23] Hartmut Holzgraefe
We're sorry, but the bug system is not the appropriate forum for 
asking help on using MySQL products. Your problem is not the result 
of a bug.

Support on using our products is available both free in our forums
at http://forums.mysql.com and for a reasonable fee direct from our
skilled support engineers at http://www.mysql.com/support/

Thank you for your interest in MySQL.

Additional info:

Hint: what is the value range for TINYINT?

http://dev.mysql.com/doc/refman/4.1/en/numeric-types.html
[17 Apr 2006 13:07] Rajesh Mahajan
I m very sorry to post my question into this 
Actually this problem related to tinyint field

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.051 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.