forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit02699bc
committed
Fix assert in BRIN build_distances
When brin_minmax_multi_union merges summaries, we may end up with just asingle range after merge_overlapping_ranges. The summaries may containjust 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 tocall build_distances anyway - which is fine, we don't calculate thedistance in this case, except that with asserts this failed due to acheck there are at least two ranges.The assert is unnecessarily strict, so relax it a bit and bail out ifthere's just a single range. The relaxed assert would be enough, butthis way we don't allocate unnecessary memory for distance.Backpatch to 14, where minmax-multi opclasses were introduced.Reported-by: Jaime CasanovaBackpatch-through: 14Discussion:https://postgr.es/m/YzVA55qS0hgz8P3r@ahch-to1 parent7aa81c6 commit02699bc
1 file changed
+5
-1
lines changedLines changed: 5 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1335 | 1335 |
| |
1336 | 1336 |
| |
1337 | 1337 |
| |
1338 |
| - | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
1339 | 1343 |
| |
1340 | 1344 |
| |
1341 | 1345 |
| |
|
0 commit comments
Comments
(0)