mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
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.
This commit is contained in:
@@ -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],
|
||||
|
Reference in New Issue
Block a user