forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commita3d2b1b
committed
Disable anonymous record hash support except in special cases
Commit01e658f added hash support for row types. This also addedsupport for hashing anonymous record types, using the same approachthat the type cache uses for comparison support for record types: Itjust reports that it works, but it might fail at run time if acomponent type doesn't actually support the operation. We get awaywith that for comparison because most types support that. But sometypes don't support hashing, so the current state can result infailures at run time where the planner chooses hashing over sorting,whereas that previously worked if only sorting was an option.We do, however, want the record hashing support for path tracking inrecursive unions, and the SEARCH and CYCLE clauses built on that. Inthat case, hashing is the only plan option. So enable that, thiscommit implements the following approach: The type cache does notreport that hashing is available for the record type. This undoesthat part of01e658f. Instead, callers that require hashing nomatter what can override that result themselves. This patch onlytouches the callers to make the aforementioned recursive query caseswork, namely the parse analysis of unions, as well as the hash_array()function.Reported-by: Sait Talha Nisanci <sait.nisanci@microsoft.com>Bug: #17158Discussion:https://www.postgresql.org/message-id/flat/17158-8a2ba823982537a4%40postgresql.org1 parent98dbef9 commita3d2b1b
File tree
7 files changed
+117
-55
lines changed- src
- backend
- parser
- rewrite
- utils
- adt
- cache
- include/parser
- test/regress
- expected
- sql
7 files changed
+117
-55
lines changedLines changed: 18 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1852 | 1852 |
| |
1853 | 1853 |
| |
1854 | 1854 |
| |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
1855 | 1858 |
| |
1856 | 1859 |
| |
1857 |
| - | |
| 1860 | + | |
1858 | 1861 |
| |
1859 | 1862 |
| |
1860 | 1863 |
| |
| |||
1867 | 1870 |
| |
1868 | 1871 |
| |
1869 | 1872 |
| |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
| 1881 | + | |
1870 | 1882 |
| |
1871 | 1883 |
| |
1872 | 1884 |
| |
| |||
2027 | 2039 |
| |
2028 | 2040 |
| |
2029 | 2041 |
| |
| 2042 | + | |
| 2043 | + | |
2030 | 2044 |
| |
2031 | 2045 |
| |
2032 | 2046 |
| |
| |||
2048 | 2062 |
| |
2049 | 2063 |
| |
2050 | 2064 |
| |
2051 |
| - | |
2052 |
| - | |
2053 |
| - | |
| 2065 | + | |
2054 | 2066 |
| |
2055 | 2067 |
| |
2056 | 2068 |
| |
| |||
2182 | 2194 |
| |
2183 | 2195 |
| |
2184 | 2196 |
| |
| 2197 | + | |
2185 | 2198 |
| |
2186 |
| - | |
| 2199 | + | |
2187 | 2200 |
| |
2188 | 2201 |
| |
2189 | 2202 |
| |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
594 | 594 |
| |
595 | 595 |
| |
596 | 596 |
| |
597 |
| - | |
| 597 | + | |
598 | 598 |
| |
599 | 599 |
| |
600 | 600 |
| |
| |||
603 | 603 |
| |
604 | 604 |
| |
605 | 605 |
| |
606 |
| - | |
| 606 | + | |
607 | 607 |
| |
608 | 608 |
| |
609 | 609 |
| |
610 | 610 |
| |
611 | 611 |
| |
612 | 612 |
| |
613 |
| - | |
| 613 | + | |
614 | 614 |
| |
615 | 615 |
| |
616 | 616 |
| |
|
Lines changed: 35 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
29 | 29 |
| |
30 | 30 |
| |
31 | 31 |
| |
| 32 | + | |
32 | 33 |
| |
33 | 34 |
| |
34 | 35 |
| |
| |||
3973 | 3974 |
| |
3974 | 3975 |
| |
3975 | 3976 |
| |
3976 |
| - | |
| 3977 | + | |
3977 | 3978 |
| |
3978 | 3979 |
| |
3979 | 3980 |
| |
3980 | 3981 |
| |
| 3982 | + | |
| 3983 | + | |
| 3984 | + | |
| 3985 | + | |
| 3986 | + | |
| 3987 | + | |
| 3988 | + | |
| 3989 | + | |
| 3990 | + | |
| 3991 | + | |
| 3992 | + | |
| 3993 | + | |
| 3994 | + | |
| 3995 | + | |
| 3996 | + | |
| 3997 | + | |
| 3998 | + | |
| 3999 | + | |
| 4000 | + | |
| 4001 | + | |
| 4002 | + | |
| 4003 | + | |
| 4004 | + | |
| 4005 | + | |
| 4006 | + | |
| 4007 | + | |
| 4008 | + | |
| 4009 | + | |
| 4010 | + | |
| 4011 | + | |
| 4012 | + | |
| 4013 | + | |
3981 | 4014 |
| |
3982 | 4015 |
| |
| 4016 | + | |
3983 | 4017 |
| |
3984 | 4018 |
| |
3985 | 4019 |
| |
|
Lines changed: 7 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1515 | 1515 |
| |
1516 | 1516 |
| |
1517 | 1517 |
| |
1518 |
| - | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
1519 | 1524 |
| |
1520 | 1525 |
| |
1521 | 1526 |
| |
1522 | 1527 |
| |
1523 |
| - | |
1524 |
| - | |
1525 |
| - | |
| 1528 | + | |
1526 | 1529 |
| |
1527 | 1530 |
| |
1528 | 1531 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
48 | 48 |
| |
49 | 49 |
| |
50 | 50 |
| |
51 |
| - | |
| 51 | + | |
52 | 52 |
| |
53 | 53 |
|
Lines changed: 51 additions & 39 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
648 | 648 |
| |
649 | 649 |
| |
650 | 650 |
| |
651 |
| - | |
652 |
| - | |
653 |
| - | |
654 |
| - | |
655 |
| - | |
656 |
| - | |
657 |
| - | |
658 |
| - | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
659 | 660 |
| |
660 | 661 |
| |
661 | 662 |
| |
662 | 663 |
| |
663 |
| - | |
664 |
| - | |
665 | 664 |
| |
| 665 | + | |
| 666 | + | |
666 | 667 |
| |
667 | 668 |
| |
668 | 669 |
| |
669 | 670 |
| |
670 |
| - | |
671 |
| - | |
672 |
| - | |
673 |
| - | |
674 |
| - | |
675 |
| - | |
676 |
| - | |
677 |
| - | |
678 |
| - | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
679 | 682 |
| |
680 | 683 |
| |
681 | 684 |
| |
| |||
685 | 688 |
| |
686 | 689 |
| |
687 | 690 |
| |
688 |
| - | |
689 |
| - | |
690 |
| - | |
691 |
| - | |
692 |
| - | |
693 |
| - | |
694 |
| - | |
695 |
| - | |
696 |
| - | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
697 | 702 |
| |
698 | 703 |
| |
699 | 704 |
| |
| |||
702 | 707 |
| |
703 | 708 |
| |
704 | 709 |
| |
705 |
| - | |
706 |
| - | |
| 710 | + | |
| 711 | + | |
707 | 712 |
| |
708 | 713 |
| |
709 |
| - | |
710 |
| - | |
711 |
| - | |
712 |
| - | |
713 |
| - | |
714 |
| - | |
715 |
| - | |
716 |
| - | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
717 | 723 |
| |
718 | 724 |
| |
719 |
| - | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
720 | 732 |
| |
721 | 733 |
| |
722 | 734 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
218 | 218 |
| |
219 | 219 |
| |
220 | 220 |
| |
221 |
| - | |
222 |
| - | |
| 221 | + | |
| 222 | + | |
223 | 223 |
| |
224 | 224 |
| |
225 | 225 |
| |
|
0 commit comments
Comments
(0)