diff options
Diffstat (limited to 'sql/sql_partition.cc')
-rw-r--r-- | sql/sql_partition.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 74f2e1b33f1..114b1a19af7 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -3639,6 +3639,17 @@ uint32 get_partition_id_range_for_endpoint(partition_info *part_info, if (part_func_value >= part_end_val && (loc_part_id < max_partition || !part_info->defined_max_value)) loc_part_id++; + if (part_info->part_type == VERSIONING_PARTITION && + part_func_value < INT_MAX32 && + loc_part_id > part_info->vers_info->hist_part->id) + { + /* + Historical query with AS OF point after the last history partition must + include last history partition because it can be overflown (contain + history rows out of right endpoint). + */ + loc_part_id= part_info->vers_info->hist_part->id; + } } else { |