forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitc7be3c0
committed
Make left-join removal safe under -DREALLOCATE_BITMAPSETS.
The initial building of RestrictInfos and SpecialJoinInfos tends tocreate structures that share relid sets (such as syn_lefthand andouter_relids). There's nothing wrong with that in itself, but whenwe modify those relid sets during join removal, we have to be surenot to corrupt the values that other structures are pointing at.remove_rel_from_query() was careless about this. It accidentallyworked anyway because (1) we'd never be reducing the sets to empty,so they wouldn't get pfree'd; and (2) the in-place modification is thesame one that we did or will apply to the other struct's relid set,so that there wasn't visible corruption at the end of the process.While there's no live bug in a standard build, of course this is waytoo fragile to accept going forward. (Maybe we should back-patchthis change too for safety, but I've refrained for now.)This bug was exposed by the recent invention of REALLOCATE_BITMAPSETS.Commite047783 had installed a fix, but that went away with thereversion of SJE, so now we need to fix it again.David Rowley and Tom LaneDiscussion:https://postgr.es/m/CACJufxFVQmr4=JWHAOSLuKA5Zy9H26nY6tVrRFBOekHoALyCkQ@mail.gmail.com1 parente2d5508 commitc7be3c0
1 file changed
+16
-2
lines changedLines changed: 16 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
390 | 390 |
| |
391 | 391 |
| |
392 | 392 |
| |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
393 | 404 |
| |
394 | 405 |
| |
395 | 406 |
| |
| |||
551 | 562 |
| |
552 | 563 |
| |
553 | 564 |
| |
554 |
| - | |
555 |
| - | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
556 | 570 |
| |
557 | 571 |
| |
558 | 572 |
| |
|
0 commit comments
Comments
(0)