List:Commits« Previous MessageNext Message »
From:Martin Skold Date:October 15 2009 12:37pm
Subject:bzr commit into mysql-5.1-telco-6.3 branch (Martin.Skold:3107) Bug#47955
View as plain text  
#At file:///home/marty/MySQL/mysql-5.1-telco-6.3/

 3107 Martin Skold	2009-10-15
      Bug#47955 UPDATEs using indexes that modify no rows return incorrect found rows: when we could not compare records we have to check with handler and assume found rows == updated rows
      modified:
        sql/sql_update.cc

=== modified file 'sql/sql_update.cc'
--- a/sql/sql_update.cc	2009-10-15 08:28:50 +0000
+++ b/sql/sql_update.cc	2009-10-15 12:37:53 +0000
@@ -860,6 +860,19 @@ int mysql_update(THD *thd,
     */
     table->file->info(HA_STATUS_WRITTEN_ROWS);
     updated= table->file->stats.rows_updated;
+    /*
+      If we could compare the records then the records were
+      either found by reading the table or they were
+      constructed from the WHERE clause. In this case the
+      handler might not have been called to perform the update.
+      If we could not compare the records then the read was skipped
+      and we could not create a record to compare with from the
+      WHERE clause. In this case we cannot use the calculated value
+      of found, instead the number if found records must equal to number
+      of updated records.
+     */
+    if (!can_compare_record)
+      found= updated;
   }
 
   /* If LAST_INSERT_ID(X) was used, report X */

Thread
bzr commit into mysql-5.1-telco-6.3 branch (Martin.Skold:3107) Bug#47955Martin Skold15 Oct