summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
authorNikita Malyavin <nikitamalyavin@gmail.com>2021-06-21 17:48:45 +0300
committerNikita Malyavin <nikitamalyavin@gmail.com>2021-07-12 22:00:39 +0300
commit7d9ba57da4843c05a4d11e63159a961c4eb79a04 (patch)
tree9f7d76b7961cfdcbdf9eb877c427d23a6e5e2245 /sql/table.cc
parent0e9ba176bf2ad4d44e62b8f6e4e1916b39c5bf33 (diff)
downloadmariadb-git-7d9ba57da4843c05a4d11e63159a961c4eb79a04.tar.gz
[1/2] MDEV-18166 ASSERT_COLUMN_MARKED_FOR_READ failed on tables with vcols
This is a 10.2+ part of a jira task The two bugs regarding virtual column marking have been fixed: 1. UPDATE of a partitioned table, where the optimizer has chosen a secondary index to make a filesort; 2. INSERT into a table with a nonblob field generated from a blob, with binlog enabled and binlog_row_image=noblob. 3. DELETE from a view on a table with virtual column. Generally the assertion happens from update_virtual_fields() call These bugs are root-caused by missing field marking for dependant fields of a virtual column. Therefore a fix is: mark all the fields involved in the vcol expression by calling field->register_field_in_read_map() instead just setting a single bit. 3 was reproducible only on 10.4+, however the problem might has just been invisible in the earlier versions. The fix is applicable to 10.2-10.3 as well.
Diffstat (limited to 'sql/table.cc')
-rw-r--r--sql/table.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/table.cc b/sql/table.cc
index 1004f583448..2666523f092 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -6717,7 +6717,7 @@ void TABLE::mark_columns_per_binlog_row_image()
if ((my_field->flags & PRI_KEY_FLAG) ||
(my_field->type() != MYSQL_TYPE_BLOB))
{
- bitmap_set_bit(read_set, my_field->field_index);
+ my_field->register_field_in_read_map();
bitmap_set_bit(rpl_write_set, my_field->field_index);
}
}