[KLUG Members] RE:

Bert Bbbink kalamazoo at dse.nl
Wed Oct 12 04:06:21 EDT 2005


> I just ran into a weird problem updating a MySQL table.
> I'm simply trying to update a single column like this:
>
>  update recorded set hostname = 'pc9h' where hostname = 'pc4h';
>
>And it gives me _random_ duplicate key errors on a column named
"starttime" after updating a few records.

>The column "hostname" is NOT a key (or part of any key).
> "Starttime" is type timestamp, and is the primary key (no dups).
>

I suppose this has to do with the automatic update of the starttime field.
When youre updates are fast enough the timstamp duplicates.
Depending of the mysql version used, table columns can de defaulted to
update the field.

Best way to avoid this is using a slower computer. ;-)


see also: http://dev.mysql.com/doc/mysql/en/timestamp-4-1.html

regards,

Bert.


More information about the Members mailing list