Commit 3d99a81
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 ddc053d commit 3d99a81
File tree
3 files changed
+55
-2
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
3 files changed
+55
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10309 | 10309 | | |
10310 | 10310 | | |
10311 | 10311 | | |
| 10312 | + | |
| 10313 | + | |
| 10314 | + | |
| 10315 | + | |
| 10316 | + | |
| 10317 | + | |
| 10318 | + | |
10312 | 10319 | | |
10313 | | - | |
| 10320 | + | |
| 10321 | + | |
10314 | 10322 | | |
10315 | 10323 | | |
10316 | 10324 | | |
| |||
| 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 | | |
| |||
1747 | 1782 | | |
1748 | 1783 | | |
1749 | 1784 | | |
1750 | | - | |
| 1785 | + | |
1751 | 1786 | | |
1752 | 1787 | | |
1753 | 1788 | | |
| |||
1771 | 1806 | | |
1772 | 1807 | | |
1773 | 1808 | | |
| 1809 | + | |
1774 | 1810 | | |
1775 | 1811 | | |
1776 | 1812 | | |
| |||
| 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