summaryrefslogtreecommitdiff
path: root/sql/sql_update.cc
diff options
context:
space:
mode:
authorAlexey Kopytov <Alexey.Kopytov@Sun.com>2010-04-30 00:33:06 +0400
committerAlexey Kopytov <Alexey.Kopytov@Sun.com>2010-04-30 00:33:06 +0400
commit85ed11c60d569a54a32cce1588594ee18c43e40a (patch)
treea2457e79f43173dfb97236266c5bb7a47fdbf65f /sql/sql_update.cc
parent21b8741b57204f784633c6337f9abacaa59ff3e2 (diff)
parent2303a8c6e4dd94eb6b682c61e0ff333c21b188b2 (diff)
downloadmariadb-git-85ed11c60d569a54a32cce1588594ee18c43e40a.tar.gz
Manual merge of mysql-5.1-bugteam to mysql-trunk-merge.
Conflicts: Text conflict in configure.in Text conflict in dbug/dbug.c Text conflict in mysql-test/r/ps.result Text conflict in mysql-test/t/ps.test Text conflict in sql/CMakeLists.txt Text conflict in sql/ha_ndbcluster.cc Text conflict in sql/mysqld.cc Text conflict in sql/sql_plugin.cc Text conflict in sql/sql_table.cc
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r--sql/sql_update.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 41737b33fb6..a4c7d665b8a 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -1337,6 +1337,16 @@ int multi_update::prepare(List<Item> &not_used_values,
{
table->read_set= &table->def_read_set;
bitmap_union(table->read_set, &table->tmp_set);
+ /*
+ If a timestamp field settable on UPDATE is present then to avoid wrong
+ update force the table handler to retrieve write-only fields to be able
+ to compare records and detect data change.
+ */
+ if (table->file->ha_table_flags() & HA_PARTIAL_COLUMN_READ &&
+ table->timestamp_field &&
+ (table->timestamp_field_type == TIMESTAMP_AUTO_SET_ON_UPDATE ||
+ table->timestamp_field_type == TIMESTAMP_AUTO_SET_ON_BOTH))
+ bitmap_union(table->read_set, table->write_set);
}
}