Hello Sinisa,

Thursday, March 01, 2001, 3:42:46 PM, you wrote:

SM>  > I'm not really shure if this is a bug or correct behavior, but still
SM>  > it leads to toe problems in this case:
SM>  > 
SM>  > insert into g02layers_stat_hits set counter=1, type=1, page_group=1;
SM>  > ERROR 1062: Duplicate entry '4294967295' for key 1
SM>  > 
SM>  > This is quite well result, but if we use replace in this case (which
SM>  > works quite OK then the table has not maximum number of rows:
SM>  > 
SM>  > mysql> replace into g02layers_stat_hits set counter=1, type=1, page_group=1;
SM>  > Query OK, 2 rows affected (0.33 sec)
SM>  > 
SM>  > and in this case the old row with id=4294967295 is destroyed.
SM>  > 
SM>  > There for this works quite nice then the table does not have last_id
SM>  > used:
SM>  > 
SM>  > mysql> replace into g02layers_stat_hits set counter=1, type=1, page_group=1;
SM>  > Query OK, 1 row affected (0.02 sec)
SM>  > 
SM>  > in this case the new ID is generated and everything is just fine :)
SM>  > 


SM> Hi!

SM> Yes, the above is well known behaviour. 

SM> What do you suggest, how should we change that ??

I think in this case, as you allow a replace with an auto increment
value (which is in case EQ to insert as no such value may exist), it
should return a dublicate key error in this case as it was unable to
insert new record to a database, which was expected for it to do.




-- 
Best regards,
 Peter                            mailto:[EMAIL PROTECTED]



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to