List:General Discussion« Previous MessageNext Message »
From:Ian Simpson Date:January 22 2009 9:10am
Subject:Re: [MySQL] Re: REPOST: ON DUPLICATE failure
View as plain text  
The reporting of two rows thing is to do with how MySQL handles
INSERT ... ON DUPLICATE KEY UPDATE ... statements; it will report 1 row
if it inserts, and 2 rows if it finds a duplicate key and has to update
as well.

Just after the first code box.

On Wed, 2009-01-21 at 21:44 -0700, Ashley M. Kirchner wrote:
> Michael Dykman wrote:
> > It
> > worked fine as you wrote it on my v5.0.45, although it reported 2 rows
> > affected on each subsequent run of the insert statement.  I thought
> > this odd as I only ran the same statement repeatedly  leaving me with
> > one row ever, but the value updated just fine.
> >   
>     I noticed that too.  It reports 2 rows, but there's only 1.  That 
> was my first indication that something's awry.  But then when I tried it 
> on 5.1.30, it did the same thing, 2 rows.  But at least it DID update on 
> 5.1.30, but not on 5.0.37.
Ian Simpson
System Administrator

REPOST: ON DUPLICATE failureAshley M. Kirchner22 Jan
  • Re: REPOST: ON DUPLICATE failureMichael Dykman22 Jan
    • Re: [MySQL] Re: REPOST: ON DUPLICATE failureAshley M. Kirchner22 Jan
      • Re: [MySQL] Re: REPOST: ON DUPLICATE failureIan Simpson22 Jan