mirror of
https://github.com/MariaDB/server.git
synced 2025-07-07 03:48:13 +02:00

The sequence that causes the issue:
1. file->row_logging is false because slave-bin was not open;
2. TABLE::mark_columns_per_binlog_row_image() didn't mark column for
read because file->row_logginbg is false. This was implemented in
e53ad95b73
(MDEV-6877);
3. TABLE::update_virtual_fields() didn't update virtual field value
because column is not marked for read;
4. calc_row_difference() sees o_len as UNIV_SQL_NULL, but new row
value is "1". The virtual column is added to update vector;
5. row_upd() tries to update secondary index, but row_upd_sec_step()
doesn't see old value in the index.
The patch does mark_virtual_column_with_deps() via
column_bitmaps_signal() in case of rgi_slave in
mark_columns_per_binlog_row_image() so that non-stored virtual columns
are marked for update in slave thread.
Also fixed column_bitmaps_signal() for partitioning where the signal
did not reach the partition storage engine.
35 lines
897 B
Text
35 lines
897 B
Text
--source include/have_innodb.inc
|
|
--source include/have_partition.inc
|
|
--source include/have_binlog_format_row.inc
|
|
--source include/master-slave.inc
|
|
|
|
--echo #
|
|
--echo # MDEV-33957 UPDATE fails on replica replicating blob virtual column in
|
|
--echo # NOBLOB mode when replica logging is off
|
|
--echo #
|
|
|
|
--connection slave
|
|
select @@log_slave_updates;
|
|
--connection master
|
|
set binlog_row_image= 'NOBLOB';
|
|
create table t (
|
|
c int primary key, d int,
|
|
i blob generated always as (c), key k(i)) engine=innodb;
|
|
insert into t (c) values (1);
|
|
update t set d= 0;
|
|
--sync_slave_with_master
|
|
|
|
--connection master
|
|
drop table t;
|
|
create table t (
|
|
c int primary key, d int,
|
|
i blob generated always as (c), key k(i)) engine=innodb
|
|
partition by key (c) partitions 2;
|
|
insert into t (c) values (1);
|
|
update t set d= 0;
|
|
--sync_slave_with_master
|
|
|
|
--connection master
|
|
drop table t;
|
|
|
|
--source include/rpl_end.inc
|