Commit e858312
committed
Fix netmask handling in inet_minmax_multi_ops
When calculating distance in brin_minmax_multi_distance_inet(), the
netmask was applied incorrectly. This results in (seemingly) incorrect
ordering of values, triggering an assert.
For builds without asserts this is mostly harmless - we may merge other
ranges, possibly resulting in slightly less efficient index. But it's
still correct and the greedy algorithm doesn't guarantee optimality
anyway.
Backpatch to 14, where minmax-multi indexes were introduced.
Reported by Dmitry Dolgov, investigation and fix by me.
Reported-by: Dmitry Dolgov
Backpatch-through: 14
Discussion: https://postgr.es/m/17774-c6f3e36dd4471e67@postgresql.org1 parent 0b51d42 commit e858312
File tree
3 files changed
+15
-2
lines changed- src
- backend/access/brin
- test/regress
- expected
- sql
3 files changed
+15
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2364 | 2364 | | |
2365 | 2365 | | |
2366 | 2366 | | |
2367 | | - | |
| 2367 | + | |
2368 | 2368 | | |
2369 | 2369 | | |
2370 | 2370 | | |
2371 | 2371 | | |
2372 | 2372 | | |
2373 | 2373 | | |
2374 | | - | |
| 2374 | + | |
2375 | 2375 | | |
2376 | 2376 | | |
2377 | 2377 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
354 | 360 | | |
355 | 361 | | |
356 | 362 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
360 | 367 | | |
361 | 368 | | |
362 | 369 | | |
| |||
0 commit comments