forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit075aade
committed
Adjust INCLUDE index truncation comments and code.
Add several assertions that ensure that we're dealing with a pivot tuplewithout non-key attributes where that's expected. Also, remove theassertion within _bt_isequal(), restoring the v10 function signature. Asimilar check will be performed for the page highkey within_bt_moveright() in most cases. Also avoid dropping all objects withinregression tests, to increase pg_dump test coverage for INCLUDE indexes.Rather than using infrastructure that's generally intended to be usedwith reference counted heap tuple descriptors during truncation, use thesame function that was introduced to store flat TupleDescs in sharedmemory (we use a temp palloc'd buffer). This isn't strictly necessary,but seems more future-proof than the old approach. It also lets usavoid including rel.h within indextuple.c, which was arguably amodularity violation. Also, we now call index_deform_tuple() with thetruncated TupleDesc, not the source TupleDesc, since that's more robust,and saves a few cycles.In passing, fix a memory leak by pfree'ing truncated pivot tuple memoryduring CREATE INDEX. Also pfree during a page split, just to beconsistent.Refactor _bt_check_natts() to be more readable.Author: Peter Geoghegan with some editorization by meReviewed by: Alexander Korotkov, Teodor SigaevDiscussion:https://www.postgresql.org/message-id/CAH2-Wz%3DkCWuXeMrBCopC-tFs3FbiVxQNjjgNKdG2sHxZ5k2y3w%40mail.gmail.com1 parent5372c2c commit075aade
File tree
13 files changed
+429
-330
lines changed- contrib/amcheck
- src
- backend/access
- common
- nbtree
- include/access
- test/regress
- expected
- sql
13 files changed
+429
-330
lines changedLines changed: 33 additions & 38 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
698 | 698 |
| |
699 | 699 |
| |
700 | 700 |
| |
| 701 | + | |
| 702 | + | |
| 703 | + | |
701 | 704 |
| |
702 | 705 |
| |
703 | 706 |
| |
| |||
722 | 725 |
| |
723 | 726 |
| |
724 | 727 |
| |
725 |
| - | |
726 |
| - | |
727 |
| - | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
728 | 734 |
| |
729 |
| - | |
730 |
| - | |
731 |
| - | |
732 |
| - | |
733 |
| - | |
734 |
| - | |
| 735 | + | |
| 736 | + | |
735 | 737 |
| |
736 |
| - | |
737 |
| - | |
738 |
| - | |
739 |
| - | |
740 |
| - | |
741 |
| - | |
| 738 | + | |
| 739 | + | |
742 | 740 |
| |
743 |
| - | |
744 |
| - | |
745 |
| - | |
746 |
| - | |
747 |
| - | |
748 |
| - | |
749 |
| - | |
750 |
| - | |
751 |
| - | |
752 |
| - | |
753 |
| - | |
754 |
| - | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
755 | 751 |
| |
756 | 752 |
| |
757 |
| - | |
758 | 753 |
| |
759 | 754 |
| |
760 |
| - | |
761 |
| - | |
| 755 | + | |
| 756 | + | |
762 | 757 |
| |
763 | 758 |
| |
764 | 759 |
| |
| |||
791 | 786 |
| |
792 | 787 |
| |
793 | 788 |
| |
794 |
| - | |
| 789 | + | |
795 | 790 |
| |
796 | 791 |
| |
797 | 792 |
| |
| |||
806 | 801 |
| |
807 | 802 |
| |
808 | 803 |
| |
809 |
| - | |
| 804 | + | |
810 | 805 |
| |
811 | 806 |
| |
812 | 807 |
| |
813 |
| - | |
| 808 | + | |
814 | 809 |
| |
815 | 810 |
| |
816 | 811 |
| |
817 | 812 |
| |
818 | 813 |
| |
819 | 814 |
| |
820 | 815 |
| |
821 |
| - | |
822 |
| - | |
| 816 | + | |
| 817 | + | |
823 | 818 |
| |
824 | 819 |
| |
825 | 820 |
| |
| |||
1430 | 1425 |
| |
1431 | 1426 |
| |
1432 | 1427 |
| |
1433 |
| - | |
1434 |
| - | |
1435 |
| - | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
1436 | 1431 |
| |
1437 | 1432 |
| |
1438 | 1433 |
| |
|
Lines changed: 39 additions & 18 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
19 | 19 |
| |
20 | 20 |
| |
21 | 21 |
| |
22 |
| - | |
23 | 22 |
| |
24 | 23 |
| |
25 | 24 |
| |
| |||
32 | 31 |
| |
33 | 32 |
| |
34 | 33 |
| |
| 34 | + | |
| 35 | + | |
| 36 | + | |
35 | 37 |
| |
36 | 38 |
| |
37 | 39 |
| |
| |||
448 | 450 |
| |
449 | 451 |
| |
450 | 452 |
| |
451 |
| - | |
452 |
| - | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
453 | 468 |
| |
454 | 469 |
| |
455 |
| - | |
456 |
| - | |
| 470 | + | |
| 471 | + | |
457 | 472 |
| |
458 |
| - | |
| 473 | + | |
459 | 474 |
| |
460 | 475 |
| |
461 |
| - | |
| 476 | + | |
462 | 477 |
| |
463 |
| - | |
464 |
| - | |
465 |
| - | |
| 478 | + | |
466 | 479 |
| |
467 |
| - | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
468 | 484 |
| |
469 |
| - | |
470 |
| - | |
471 |
| - | |
472 |
| - | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
473 | 496 |
| |
474 |
| - | |
475 |
| - | |
476 |
| - | |
| 497 | + | |
477 | 498 |
|
0 commit comments
Comments
(0)