summaryrefslogtreecommitdiff
path: root/sql/sp.cc
diff options
context:
space:
mode:
authorunknown <gkodinov/kgeorge@magare.gmz>2007-06-28 16:07:55 +0300
committerunknown <gkodinov/kgeorge@magare.gmz>2007-06-28 16:07:55 +0300
commitba4682ae10648d7341798eb628cfe2c1ce466a89 (patch)
treea2bf9e1b332e76cb81626a4f4952dfcd1f7eed99 /sql/sp.cc
parent28187da7747029ee380b5ddcea84cc0002b4ad5d (diff)
downloadmariadb-git-ba4682ae10648d7341798eb628cfe2c1ce466a89.tar.gz
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. include/my_base.h: Bug #29157: handle the row not updated special return value sql/log_event.cc: Bug #29157: handle the row not updated special return value sql/sp.cc: Bug #29157: handle the row not updated special return value sql/sql_acl.cc: Bug #29157: handle the row not updated special return value sql/sql_insert.cc: Bug #29157: handle the row not updated special return value sql/sql_servers.cc: Bug #29157: handle the row not updated special return value sql/sql_update.cc: Bug #29157: handle the row not updated special return value
Diffstat (limited to 'sql/sp.cc')
-rw-r--r--sql/sp.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/sp.cc b/sql/sp.cc
index 6e890f638d0..75ea9172c90 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -715,8 +715,11 @@ sp_update_routine(THD *thd, int type, sp_name *name, st_sp_chistics *chistics)
table->field[MYSQL_PROC_FIELD_COMMENT]->store(chistics->comment.str,
chistics->comment.length,
system_charset_info);
- if ((table->file->ha_update_row(table->record[1],table->record[0])))
+ if ((ret= table->file->ha_update_row(table->record[1],table->record[0])) &&
+ ret != HA_ERR_RECORD_IS_THE_SAME)
ret= SP_WRITE_ROW_FAILED;
+ else
+ ret= 0;
}
if (ret == SP_OK)