diff options
author | evgen@moonbone.local <> | 2007-07-08 18:13:04 +0400 |
---|---|---|
committer | evgen@moonbone.local <> | 2007-07-08 18:13:04 +0400 |
commit | 42d1e3c4574c375e6f10fb1b1c5c0122689cd25e (patch) | |
tree | 968b112408e96c5789fa4ab8b7b036239e61e1f2 /sql/sql_insert.cc | |
parent | 23a30b0c0aea7e7c2365cb375da85ccaaf362e07 (diff) | |
download | mariadb-git-42d1e3c4574c375e6f10fb1b1c5c0122689cd25e.tar.gz |
Bug#29310: An InnoDB table was updated when the data wasn't actually changed.
When a table is being updated it has two set of fields - fields required for
checks of conditions and fields to be updated. A storage engine is allowed
not to retrieve columns marked for update. Due to this fact records can't
be compared to see whether the data has been changed or not. This makes the
server always update records independently of data change.
Now when an auto-updatable timestamp field is present and server sees that
a table handle isn't going to retrieve write-only fields then all of such
fields are marked as to be read to force the handler to retrieve them.
Diffstat (limited to 'sql/sql_insert.cc')
-rw-r--r-- | sql/sql_insert.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index eeac5e7c4fe..7717d2c92c1 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1419,7 +1419,8 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info) goto before_trg_err; table->file->restore_auto_increment(prev_insert_id); - if ((table->file->ha_table_flags() & HA_PARTIAL_COLUMN_READ) || + if ((table->file->ha_table_flags() & HA_PARTIAL_COLUMN_READ && + !bitmap_is_subset(table->write_set, table->read_set)) || compare_record(table)) { if ((error=table->file->ha_update_row(table->record[1], |