mirror of
https://github.com/MariaDB/server.git
synced 2025-07-18 09:18:15 +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.
34 lines
901 B
Text
34 lines
901 B
Text
include/master-slave.inc
|
|
[connection master]
|
|
#
|
|
# MDEV-33957 UPDATE fails on replica replicating blob virtual column in
|
|
# NOBLOB mode when replica logging is off
|
|
#
|
|
connection slave;
|
|
select @@log_slave_updates;
|
|
@@log_slave_updates
|
|
0
|
|
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;
|
|
Warnings:
|
|
Note 1071 Specified key was too long; max key length is 3072 bytes
|
|
insert into t (c) values (1);
|
|
update t set d= 0;
|
|
connection slave;
|
|
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;
|
|
Warnings:
|
|
Note 1071 Specified key was too long; max key length is 3072 bytes
|
|
insert into t (c) values (1);
|
|
update t set d= 0;
|
|
connection slave;
|
|
connection master;
|
|
drop table t;
|
|
include/rpl_end.inc
|