forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitf10f0ae
committed
Replace RelationOpenSmgr() with RelationGetSmgr().
The idea behind this patch is to design out bugs like the one fixedby commit9d52311. Previously, once one did RelationOpenSmgr(rel),it was considered okay to access rel->rd_smgr directly for somenot-very-clear interval. But since that pointer will be cleared byrelcache flushes, we had bugs arising from overreliance on a previousRelationOpenSmgr call still being effective.Now, very little code except that in rel.h and relcache.c should evertouch the rd_smgr field directly. The normal coding rule is to useRelationGetSmgr(rel) and not expect the result to be valid for longerthan one smgr function call. There are a couple of places where usingthe function every single time seemed like overkill, but they are nowannotated with large warning comments.Amul Sul, after an idea of mine.Discussion:https://postgr.es/m/CANiYTQsU7yMFpQYnv=BrcRVqK_3U3mtAzAsJCaqtzsDHfsUbdQ@mail.gmail.com1 parent5b60cf3 commitf10f0ae
File tree
21 files changed
+165
-166
lines changed- contrib
- amcheck
- bloom
- pg_prewarm
- pg_visibility
- src
- backend
- access
- gist
- hash
- heap
- nbtree
- spgist
- table
- catalog
- commands
- storage
- buffer
- freespace
- include/utils
21 files changed
+165
-166
lines changedLines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
301 | 301 |
| |
302 | 302 |
| |
303 | 303 |
| |
304 |
| - | |
305 |
| - | |
| 304 | + | |
306 | 305 |
| |
307 | 306 |
| |
308 | 307 |
| |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
177 | 177 |
| |
178 | 178 |
| |
179 | 179 |
| |
180 |
| - | |
| 180 | + | |
181 | 181 |
| |
182 |
| - | |
| 182 | + | |
183 | 183 |
| |
184 | 184 |
| |
185 | 185 |
| |
186 | 186 |
| |
187 | 187 |
| |
188 | 188 |
| |
189 | 189 |
| |
190 |
| - | |
| 190 | + | |
191 | 191 |
| |
192 | 192 |
| |
193 | 193 |
| |
|
Lines changed: 1 addition & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
514 | 514 |
| |
515 | 515 |
| |
516 | 516 |
| |
517 |
| - | |
518 |
| - | |
519 | 517 |
| |
520 | 518 |
| |
521 | 519 |
| |
522 | 520 |
| |
523 | 521 |
| |
524 | 522 |
| |
525 |
| - | |
| 523 | + | |
526 | 524 |
| |
527 | 525 |
| |
528 | 526 |
| |
|
Lines changed: 2 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
109 | 109 |
| |
110 | 110 |
| |
111 | 111 |
| |
112 |
| - | |
113 |
| - | |
| 112 | + | |
114 | 113 |
| |
115 | 114 |
| |
116 | 115 |
| |
| |||
178 | 177 |
| |
179 | 178 |
| |
180 | 179 |
| |
181 |
| - | |
| 180 | + | |
182 | 181 |
| |
183 | 182 |
| |
184 | 183 |
| |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
391 | 391 |
| |
392 | 392 |
| |
393 | 393 |
| |
394 |
| - | |
395 |
| - | |
| 394 | + | |
| 395 | + | |
396 | 396 |
| |
397 | 397 |
| |
398 | 398 |
| |
399 | 399 |
| |
400 | 400 |
| |
401 |
| - | |
| 401 | + | |
402 | 402 |
| |
403 | 403 |
| |
404 | 404 |
| |
|
Lines changed: 6 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
409 | 409 |
| |
410 | 410 |
| |
411 | 411 |
| |
412 |
| - | |
413 |
| - | |
| 412 | + | |
414 | 413 |
| |
415 | 414 |
| |
416 | 415 |
| |
| |||
450 | 449 |
| |
451 | 450 |
| |
452 | 451 |
| |
453 |
| - | |
454 | 452 |
| |
455 | 453 |
| |
456 |
| - | |
| 454 | + | |
457 | 455 |
| |
458 | 456 |
| |
459 | 457 |
| |
| |||
562 | 560 |
| |
563 | 561 |
| |
564 | 562 |
| |
565 |
| - | |
566 |
| - | |
567 | 563 |
| |
568 | 564 |
| |
569 | 565 |
| |
| |||
575 | 571 |
| |
576 | 572 |
| |
577 | 573 |
| |
578 |
| - | |
| 574 | + | |
| 575 | + | |
579 | 576 |
| |
580 | 577 |
| |
581 | 578 |
| |
| |||
860 | 857 |
| |
861 | 858 |
| |
862 | 859 |
| |
863 |
| - | |
| 860 | + | |
| 861 | + | |
864 | 862 |
| |
865 | 863 |
| |
866 | 864 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1024 | 1024 |
| |
1025 | 1025 |
| |
1026 | 1026 |
| |
1027 |
| - | |
1028 | 1027 |
| |
1029 |
| - | |
| 1028 | + | |
| 1029 | + | |
1030 | 1030 |
| |
1031 | 1031 |
| |
1032 | 1032 |
| |
|
Lines changed: 3 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
625 | 625 |
| |
626 | 626 |
| |
627 | 627 |
| |
628 |
| - | |
629 | 628 |
| |
630 | 629 |
| |
631 | 630 |
| |
| |||
645 | 644 |
| |
646 | 645 |
| |
647 | 646 |
| |
648 |
| - | |
| 647 | + | |
649 | 648 |
| |
650 | 649 |
| |
651 | 650 |
| |
652 | 651 |
| |
653 | 652 |
| |
654 | 653 |
| |
655 |
| - | |
| 654 | + | |
656 | 655 |
| |
657 | 656 |
| |
658 | 657 |
| |
| |||
664 | 663 |
| |
665 | 664 |
| |
666 | 665 |
| |
667 |
| - | |
| 666 | + | |
668 | 667 |
| |
669 | 668 |
| |
670 | 669 |
| |
|
Lines changed: 4 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
326 | 326 |
| |
327 | 327 |
| |
328 | 328 |
| |
329 |
| - | |
330 |
| - | |
331 |
| - | |
| 329 | + | |
| 330 | + | |
332 | 331 |
| |
333 | 332 |
| |
334 | 333 |
| |
| |||
339 | 338 |
| |
340 | 339 |
| |
341 | 340 |
| |
342 |
| - | |
343 |
| - | |
344 |
| - | |
345 |
| - | |
346 |
| - | |
| 341 | + | |
347 | 342 |
| |
348 | 343 |
| |
349 | 344 |
| |
| |||
695 | 690 |
| |
696 | 691 |
| |
697 | 692 |
| |
698 |
| - | |
699 |
| - | |
700 | 693 |
| |
701 | 694 |
| |
702 |
| - | |
| 695 | + | |
703 | 696 |
| |
704 | 697 |
| |
705 | 698 |
| |
|
Lines changed: 27 additions & 26 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
455 | 455 |
| |
456 | 456 |
| |
457 | 457 |
| |
458 |
| - | |
459 |
| - | |
460 | 458 |
| |
461 | 459 |
| |
462 | 460 |
| |
463 | 461 |
| |
464 |
| - | |
| 462 | + | |
465 | 463 |
| |
466 | 464 |
| |
467 | 465 |
| |
| |||
528 | 526 |
| |
529 | 527 |
| |
530 | 528 |
| |
531 |
| - | |
| 529 | + | |
532 | 530 |
| |
533 | 531 |
| |
534 | 532 |
| |
| |||
547 | 545 |
| |
548 | 546 |
| |
549 | 547 |
| |
| 548 | + | |
550 | 549 |
| |
551 | 550 |
| |
552 |
| - | |
553 |
| - | |
554 |
| - | |
555 |
| - | |
556 |
| - | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
557 | 554 |
| |
558 |
| - | |
| 555 | + | |
559 | 556 |
| |
560 | 557 |
| |
561 | 558 |
| |
562 | 559 |
| |
563 | 560 |
| |
564 |
| - | |
| 561 | + | |
565 | 562 |
| |
566 |
| - | |
567 |
| - | |
| 563 | + | |
| 564 | + | |
568 | 565 |
| |
569 |
| - | |
| 566 | + | |
570 | 567 |
| |
571 | 568 |
| |
572 | 569 |
| |
573 |
| - | |
| 570 | + | |
574 | 571 |
| |
575 | 572 |
| |
576 | 573 |
| |
| |||
618 | 615 |
| |
619 | 616 |
| |
620 | 617 |
| |
| 618 | + | |
621 | 619 |
| |
622 | 620 |
| |
623 | 621 |
| |
| |||
633 | 631 |
| |
634 | 632 |
| |
635 | 633 |
| |
636 |
| - | |
637 |
| - | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
638 | 640 |
| |
639 | 641 |
| |
640 | 642 |
| |
641 | 643 |
| |
642 | 644 |
| |
643 |
| - | |
644 |
| - | |
645 |
| - | |
646 |
| - | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
647 | 649 |
| |
648 | 650 |
| |
649 |
| - | |
650 |
| - | |
| 651 | + | |
| 652 | + | |
651 | 653 |
| |
652 | 654 |
| |
653 | 655 |
| |
654 | 656 |
| |
655 | 657 |
| |
656 | 658 |
| |
657 |
| - | |
658 |
| - | |
| 659 | + | |
659 | 660 |
| |
660 | 661 |
| |
661 | 662 |
| |
| |||
666 | 667 |
| |
667 | 668 |
| |
668 | 669 |
| |
669 |
| - | |
| 670 | + | |
670 | 671 |
| |
671 | 672 |
| |
672 | 673 |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
163 | 163 |
| |
164 | 164 |
| |
165 | 165 |
| |
166 |
| - | |
| 166 | + | |
167 | 167 |
| |
168 |
| - | |
| 168 | + | |
169 | 169 |
| |
170 | 170 |
| |
171 | 171 |
| |
172 | 172 |
| |
173 | 173 |
| |
174 | 174 |
| |
175 | 175 |
| |
176 |
| - | |
| 176 | + | |
177 | 177 |
| |
178 | 178 |
| |
179 | 179 |
| |
|
0 commit comments
Comments
(0)