mariadb/storage/innobase/handler
Kristian Nielsen ccee665272 MDEV-38734: Virtual columns wrongly included in binlog_row_image=MINIMAL
The original symptom of this was an assertion 'marked_for_read()' failing in
RBR with unique blobs and binlog_row_image=MINIMAL. The problem was that the
hidden DB_ROW_HASH_1 virtual column was included in the after-image of the
update, but the underlying blob column was not being updated, so it was not
in the read_set/write_set.

It seems clearly wrong to include the DB_ROW_HASH_1 in the after-image when
the underlying blob isn't even being updated. The cause of this is the
following commit:

Author: Monty <monty@mariadb.org>
Date:   Wed May 23 22:42:29 2018 +0300

    MDEV-15243 Crash with virtual fields and row based binary logging

That patch removed a check for if the underlying fields of a virtual column
were being updated, and just added them unconditionally. This seems wrong.

So revert that part of the commit, restoring the logic to only add a virtual
column if any underlying field is actually in the write_set.

Also fix a typo in that commit where a code reformat accidentally reversed a
condition.

Also fix an assertion when InnoDB goes to update secondary indexes: If any
part of the primary key is being updated, then add all virtual columns that
are part of secondary indexes to the read_set.

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2026-02-03 12:51:19 +01:00
..
ha_innodb.cc MDEV-38734: Virtual columns wrongly included in binlog_row_image=MINIMAL 2026-02-03 12:51:19 +01:00
ha_innodb.h MDEV-37152: Remove many calls to _current_thd() 2025-09-29 14:35:02 +03:00
handler0alter.cc MDEV-37152: Remove many calls to _current_thd() 2025-09-29 14:35:02 +03:00
i_s.cc MDEV-37152: Remove many calls to _current_thd() 2025-09-29 14:35:02 +03:00
i_s.h Merge 10.5 into 10.6 2021-08-23 11:21:33 +03:00
innodb_binlog.cc Binlog-in-engine: Additional test coverage 2026-01-22 19:48:21 +01:00