summaryrefslogtreecommitdiff
path: root/sql/sql_partition.cc
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2021-07-31 23:19:51 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2021-07-31 23:19:51 +0200
commitae6bdc6769646a09a8d4d08a42a69174ea677768 (patch)
treec80afdd0e3238dc5092fdcb1439f1390f9a9040b /sql/sql_partition.cc
parenta49f5525bbe1bb1f4320bd0db066068a81af62d9 (diff)
parent7841a7eb09208f52fcbab7e80e38c7ca29b1339e (diff)
downloadmariadb-git-ae6bdc6769646a09a8d4d08a42a69174ea677768.tar.gz
Merge branch '10.4' into 10.5
Diffstat (limited to 'sql/sql_partition.cc')
-rw-r--r--sql/sql_partition.cc11
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
{