summaryrefslogtreecommitdiff
path: root/sql/ha_partition.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/ha_partition.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/ha_partition.cc')
-rw-r--r--sql/ha_partition.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index ad020acf5c4..6f50d078dff 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -5255,8 +5255,7 @@ int ha_partition::index_init(uint inx, bool sorted)
do
{
for (i= 0; i < (*key_info)->user_defined_key_parts; i++)
- bitmap_set_bit(table->read_set,
- (*key_info)->key_part[i].field->field_index);
+ (*key_info)->key_part[i].field->register_field_in_read_map();
} while (*(++key_info));
}
for (i= bitmap_get_first_set(&m_part_info->read_partitions);