diff options
author | Aleksey Midenkov <midenok@gmail.com> | 2019-07-16 19:40:38 +0300 |
---|---|---|
committer | Aleksey Midenkov <midenok@gmail.com> | 2019-08-11 12:32:08 +0300 |
commit | 98758b52b3a3b0ede3cb8f93bcada5e5af51254b (patch) | |
tree | f5f839c1099927689b2136da520a14eef844cce4 /sql/ha_partition.cc | |
parent | cdbac54df0bd857a053decd66b6067abf15a6801 (diff) | |
download | mariadb-git-98758b52b3a3b0ede3cb8f93bcada5e5af51254b.tar.gz |
MDEV-20068 History partition rotation is not done under LOCK TABLES
Wrong value F_WRLCK for thr_lock_type.
Diffstat (limited to 'sql/ha_partition.cc')
-rw-r--r-- | sql/ha_partition.cc | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index ce0f430147a..125669a403d 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -4093,8 +4093,21 @@ int ha_partition::start_stmt(THD *thd, thr_lock_type lock_type) /* Add partition to be called in reset(). */ bitmap_set_bit(&m_partitions_to_reset, i); } - if (lock_type == F_WRLCK && m_part_info->part_expr) - m_part_info->part_expr->walk(&Item::register_field_in_read_map, 1, 0); + switch (lock_type) + { + case TL_WRITE_ALLOW_WRITE: + case TL_WRITE_CONCURRENT_INSERT: + case TL_WRITE_DELAYED: + case TL_WRITE_DEFAULT: + case TL_WRITE_LOW_PRIORITY: + case TL_WRITE: + case TL_WRITE_ONLY: + if (m_part_info->part_expr) + m_part_info->part_expr->walk(&Item::register_field_in_read_map, 1, 0); + if (m_part_info->part_type == VERSIONING_PARTITION) + m_part_info->vers_set_hist_part(thd); + default:; + } DBUG_RETURN(error); } |