diff options
author | Tomas Vondra | 2022-12-30 18:44:48 +0000 |
---|---|---|
committer | Tomas Vondra | 2022-12-30 19:49:50 +0000 |
commit | 02699bc1fd3b7fccba2e6b55189a148ef69b8a00 (patch) | |
tree | 7e775da8a089eded9e56d8cd95e3f8696947bc5a /contrib/postgres_fdw/postgres_fdw.c | |
parent | 7aa81c61ec8f68212570192f3088544dbfa43cb9 (diff) |
Fix assert in BRIN build_distances
When brin_minmax_multi_union merges summaries, we may end up with just a
single range after merge_overlapping_ranges. The summaries may contain
just one range each, and they may overlap (or be exactly the same).
With a single range there's no distance to calculate, but we happen to
call build_distances anyway - which is fine, we don't calculate the
distance in this case, except that with asserts this failed due to a
check there are at least two ranges.
The assert is unnecessarily strict, so relax it a bit and bail out if
there's just a single range. The relaxed assert would be enough, but
this way we don't allocate unnecessary memory for distance.
Backpatch to 14, where minmax-multi opclasses were introduced.
Reported-by: Jaime Casanova
Backpatch-through: 14
Discussion: https://postgr.es/m/YzVA55qS0hgz8P3r@ahch-to
Diffstat (limited to 'contrib/postgres_fdw/postgres_fdw.c')
0 files changed, 0 insertions, 0 deletions