Bug #11599 | I get a Duplicate entry error message even when the key doesn't exist yet | ||
---|---|---|---|
Submitted: | 28 Jun 2005 0:07 | Modified: | 28 Jun 2005 11:09 |
Reporter: | Gavriel Fleischer | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: MyISAM storage engine | Severity: | S2 (Serious) |
Version: | 4.1.11a | OS: | Linux (Linux) |
Assigned to: | CPU Architecture: | Any |
[28 Jun 2005 0:07]
Gavriel Fleischer
[28 Jun 2005 11:03]
Aleksey Kishkin
actualy you have a primary key (according to 'describe')
[28 Jun 2005 11:09]
Aleksey Kishkin
You inserts a value that bigger than 'int' field can fit. and according to documentation (http://dev.mysql.com/doc/mysql/en/numeric-types.html ) the value is clipped to upper endpoint of the range and stores 2147483647 instead. So, if you have to store (say) 3252699955, you must alter table and change type of field to bigint
[28 Jun 2005 19:49]
Gavriel Fleischer
Well I meant "key doesn't exist" is that this key is not in the table yet. And the 2nd comment was helpful! Thanks! Yes, I made the change from INT to INT UNSIGNED, and that was enough!
[19 Sep 2005 19:09]
romain jouin
Globaly, can we say that when we are storing numerical values, there is no point to store it like a 'int' if we are not going to make mathematical operation on this values ? ex : the ip address won't be use to add/divide or other kind of math calculus, will it ? So, one solution is to store the ip like a text field.