1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-22247 History partition overflow leads to wrong SELECT result

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).

Move left point back to hist_part->id in that case.
This commit is contained in:
Aleksey Midenkov
2021-07-06 01:02:10 +03:00
parent e09e304b78
commit 07fade6d18
3 changed files with 53 additions and 0 deletions

View File

@ -3737,6 +3737,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
{