forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitda4ed75
committed
Fix incorrect tests for SRFs in relation_can_be_sorted_early().
Commitfac1b47 thought we could check for set-returning functionsby testing only the top-level node in an expression tree. This iswrong in itself, and to make matters worse it encouraged othersto make the same mistake, by exporting tlist.c's special-purposeIS_SRF_CALL() as a widely-visible macro. I can't find any evidencethat anyone's taken the bait, but it was only a matter of time.Use expression_returns_set() instead, and stuff the IS_SRF_CALL()genie back in its bottle, this time with a warning label. I alsoadded a couple of cross-reference comments.After a fair amount of fooling around, I've despaired of makinga robust test case that exposes the bug reliably, so no test casehere. (Note that the test case added byfac1b47 is itselfbroken, in that it doesn't notice if you remove the code change.The repro given by the bug submitter currently doesn't fail eitherin v15 or HEAD, though I suspect that may indicate an unrelated bug.)Per bug #17564 from Martijn van Oosterhout. Back-patch to v13,as the faulty patch was.Discussion:https://postgr.es/m/17564-c7472c2f90ef2da3@postgresql.org1 parentb2694ae commitda4ed75
File tree
4 files changed
+19
-7
lines changed- src
- backend
- nodes
- optimizer
- path
- util
- include/optimizer
4 files changed
+19
-7
lines changedLines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
742 | 742 |
| |
743 | 743 |
| |
744 | 744 |
| |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
745 | 751 |
| |
746 | 752 |
| |
747 | 753 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1002 | 1002 |
| |
1003 | 1003 |
| |
1004 | 1004 |
| |
1005 |
| - | |
| 1005 | + | |
1006 | 1006 |
| |
1007 | 1007 |
| |
1008 | 1008 |
| |
| |||
1030 | 1030 |
| |
1031 | 1031 |
| |
1032 | 1032 |
| |
1033 |
| - | |
| 1033 | + | |
1034 | 1034 |
| |
1035 | 1035 |
| |
1036 | 1036 |
| |
|
Lines changed: 11 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
21 | 21 |
| |
22 | 22 |
| |
23 | 23 |
| |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
24 | 35 |
| |
25 | 36 |
| |
26 | 37 |
| |
|
Lines changed: 0 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
24 | 24 |
| |
25 | 25 |
| |
26 | 26 |
| |
27 |
| - | |
28 |
| - | |
29 |
| - | |
30 |
| - | |
31 |
| - | |
32 | 27 |
| |
33 | 28 |
| |
34 | 29 |
| |
|
0 commit comments
Comments
(0)