diff options
author | Aleksey Midenkov <midenok@gmail.com> | 2022-03-29 13:44:14 +0300 |
---|---|---|
committer | Aleksey Midenkov <midenok@gmail.com> | 2022-03-29 13:44:14 +0300 |
commit | 1e859d4abcfd7e3b2c238e5dc8c909254661082a (patch) | |
tree | 378166da4a872fc8ba387af3ec15bbae7cad9897 /sql/table.cc | |
parent | 58cd2a8dedd78b25ada0996dee2bd3e0520c17b6 (diff) | |
download | mariadb-git-1e859d4abcfd7e3b2c238e5dc8c909254661082a.tar.gz |
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.
Diffstat (limited to 'sql/table.cc')
-rw-r--r-- | sql/table.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sql/table.cc b/sql/table.cc index 7d022ba8ca3..08d91678b25 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -8161,9 +8161,6 @@ void TABLE::evaluate_update_default_function() void TABLE::vers_update_fields() { - bitmap_set_bit(write_set, vers_start_field()->field_index); - bitmap_set_bit(write_set, vers_end_field()->field_index); - if (!vers_write) { file->column_bitmaps_signal(); @@ -8172,17 +8169,21 @@ void TABLE::vers_update_fields() if (versioned(VERS_TIMESTAMP)) { + bitmap_set_bit(write_set, vers_start_field()->field_index); if (vers_start_field()->store_timestamp(in_use->query_start(), in_use->query_start_sec_part())) { DBUG_ASSERT(0); } vers_start_field()->set_has_explicit_value(); + bitmap_set_bit(read_set, vers_start_field()->field_index); } + bitmap_set_bit(write_set, vers_end_field()->field_index); vers_end_field()->set_max(); vers_end_field()->set_has_explicit_value(); bitmap_set_bit(read_set, vers_end_field()->field_index); + file->column_bitmaps_signal(); if (vfield) update_virtual_fields(file, VCOL_UPDATE_FOR_READ); |