Commit 30d3df0
committed
Fix incorrect printing of queries with duplicated join names.
Given a query in which multiple JOIN nodes used the same alias
(which'd necessarily be in different sub-SELECTs), ruleutils.c
would assign the JOIN nodes distinct aliases for clarity ...
but then it forgot to print the modified aliases when dumping
the JOIN nodes themselves. This results in a dump/reload hazard
for views, because the emitted query is flat-out incorrect:
Vars will be printed with table names that have no referent.
This has been wrong for a long time, so back-patch to all supported
branches.
Philip Dubé
Discussion: https://postgr.es/m/CY4PR2101MB080246F2955FF58A6ED1FEAC98140@CY4PR2101MB0802.namprd21.prod.outlook.com1 parent 1bbcbfa commit 30d3df0
File tree
3 files changed
+54
-2
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
3 files changed
+54
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10125 | 10125 | | |
10126 | 10126 | | |
10127 | 10127 | | |
| 10128 | + | |
| 10129 | + | |
| 10130 | + | |
| 10131 | + | |
| 10132 | + | |
| 10133 | + | |
| 10134 | + | |
10128 | 10135 | | |
10129 | | - | |
| 10136 | + | |
| 10137 | + | |
10130 | 10138 | | |
10131 | 10139 | | |
10132 | 10140 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
769 | 769 | | |
770 | 770 | | |
771 | 771 | | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
772 | 807 | | |
773 | 808 | | |
774 | 809 | | |
| |||
1721 | 1756 | | |
1722 | 1757 | | |
1723 | 1758 | | |
1724 | | - | |
| 1759 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
319 | 319 | | |
320 | 320 | | |
321 | 321 | | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
322 | 331 | | |
323 | 332 | | |
324 | 333 | | |
| |||
0 commit comments