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/