From 71aaf52a2f8da334fc0b95c01bdfa8a5e5f602cb Mon Sep 17 00:00:00 2001 From: "gkodinov/kgeorge@magare.gmz" <> Date: Thu, 28 Jun 2007 16:07:55 +0300 Subject: Bug #29157: UPDATE, changed rows incorrect Sometimes the number of really updated rows (with changed column values) cannot be determined at the server level alone (e.g. if the storage engine does not return enough column values to verify that). So the only dependable way in such cases is to let the storage engine return that information if possible. Fixed the bug at server level by providing a way for the storage engine to return information about wether it actually updated the row or the old and the new column values are the same. It can do that by returning HA_ERR_RECORD_IS_THE_SAME in ha_update_row(). Note that each storage engine may choose not to try to return this status code, so this behaviour remains storage engine specific. --- sql/sql_servers.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sql/sql_servers.cc') diff --git a/sql/sql_servers.cc b/sql/sql_servers.cc index 195e6743a72..ac5ea6f4ac4 100644 --- a/sql/sql_servers.cc +++ b/sql/sql_servers.cc @@ -872,11 +872,15 @@ update_server_record(TABLE *table, FOREIGN_SERVER *server) /* ok, so we can update since the record exists in the table */ store_record(table,record[1]); store_server_fields(table, server); - if ((error=table->file->ha_update_row(table->record[1],table->record[0]))) + if ((error=table->file->ha_update_row(table->record[1], + table->record[0])) && + error != HA_ERR_RECORD_IS_THE_SAME) { DBUG_PRINT("info",("problems with ha_update_row %d", error)); goto end; } + else + error= 0; } end: -- cgit v1.2.1