1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-22973 Assertion in compare_record upon multi-update involving versioned table via view

records_are_comparable() requires this condition:

  bitmap_is_subset(table->write_set, table->read_set)

On first iteration vers_update_fields() changes write_set and
read_set. On second iteration the above condition fails.

Added missing read bit for ROW_START. Also reorganized
bitmap_set_bit() so it is called only when needed.
This commit is contained in:
Aleksey Midenkov
2022-03-29 13:44:14 +03:00
parent 58cd2a8ded
commit 1e859d4abc
3 changed files with 28 additions and 3 deletions

View File

@ -410,3 +410,14 @@ select check_row_ts(row_start, row_end) from t1 for system_time all where row_st
check_row_ts(row_start, row_end)
CURRENT ROW
drop table t1;
#
# MDEV-22973 Assertion in compare_record upon multi-update involving versioned table via view
#
create or replace table t1 (a int, primary key (a)) engine=myisam;
insert into t1 values (0);
create or replace table t2 (pk int, b int, primary key (pk), key(b)) engine=innodb with system versioning;
insert into t2 values (1, 0), (2, 0);
create or replace view v as select a, b from t1, t2;
update v set b= null where a = 0 order by b;
drop view v;
drop table t1, t2;

View File

@ -336,4 +336,17 @@ select row_start from t1 into @r;
select check_row_ts(row_start, row_end) from t1 for system_time all where row_start = @r;
drop table t1;
--echo #
--echo # MDEV-22973 Assertion in compare_record upon multi-update involving versioned table via view
--echo #
create or replace table t1 (a int, primary key (a)) engine=myisam;
insert into t1 values (0);
create or replace table t2 (pk int, b int, primary key (pk), key(b)) engine=innodb with system versioning;
insert into t2 values (1, 0), (2, 0);
create or replace view v as select a, b from t1, t2;
update v set b= null where a = 0 order by b;
# cleanup
drop view v;
drop table t1, t2;
source suite/versioning/common_finish.inc;