12 messages in com.mysql.lists.perlRe: update query returns wrong number...
FromSent OnAttachments
Dave Dyer15 Sep 2004 16:29 
Jochen Wiedmann15 Sep 2004 17:00 
Rudy Lippan15 Sep 2004 17:22 
Dave Dyer15 Sep 2004 18:00 
Jochen Wiedmann15 Sep 2004 18:17 
Dave Dyer15 Sep 2004 18:23 
Rudy Lippan15 Sep 2004 18:29 
Rudy Lippan15 Sep 2004 18:51 
Dave Dyer15 Sep 2004 19:05 
Dave Dyer15 Sep 2004 19:07 
Rudy Lippan15 Sep 2004 19:15 
Vladimir V. Kolpakov15 Sep 2004 22:25 
Subject:Re: update query returns wrong number of rows affected
From:Dave Dyer (ddy@real-me.net)
Date:09/15/2004 06:00:58 PM
List:com.mysql.lists.perl

At 05:00 PM 9/15/2004, Jochen Wiedmann wrote:

Dave Dyer wrote:

For some UPDATE queries (possibly those involving joins?), the number of rows reported for the query is the number of rows processed, rather than the number of rows actually changed.

What does the distinction between "affected" and "matched" mean? Is it, that
some rows already had the new value? If so, I would think that I would indeed
want to see the value "matched", because the typical use case is I can see is
comparing the number of rows against 0.

The case in point, I'm merging two databases and all the rows are usually the same. I'm interested in the exceptions; and to me "affected rows" means changed rows.

Maybe it's always been this way, but the C api makes the number of changed rows easily available, I find it very useful.