List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:July 1 1999 6:41pm
Subject:Re: bug!!!!
View as plain text  
At 6:28 PM +0000 7/1/1999, mslade@stripped wrote:
>>Description:
>replace can remove a row
>>How-To-Repeat:
>do this:
>CREATE TABLE test (
>  id1 int(11) DEFAULT '0' NOT NULL,
>  id2 int(11) DEFAULT '0' NOT NULL,
>  PRIMARY KEY (id1),
>  UNIQUE id2 (id2)
>);
>INSERT INTO test VALUES(1,1);
>INSERT INTO test VALUES(1,2);
>
>"select * from test;" for visual aid, then:
>REPLACE INTO test VALUES(1,2);
>"select * from test;" again.
>);
>>Fix:
>dunno.
>

REPLACE doesn't remove any row.  The table only has one row
to begin with since your second INSERT statement fails!
It duplicates the id1 value of the first inserted row,
and id1 is a PRIMARY key.

--
Paul DuBois, paul@stripped
Northern League Chronicles: http://www.snake.net/nl/
Thread
bug!!!!mslade1 Jul
  • RE: bug!!!!Jay Miller1 Jul
  • Re: bug!!!!Paul DuBois1 Jul
  • Re: bug!!!!Andrew Moody1 Jul
RE: bug!!!!Darren L Sweeney1 Jul
  • Re: bug!!!!Micksa) Slade1 Jul
RE: bug!!!!Darren L Sweeney1 Jul