forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitda8f3eb
committed
Don't convert Consts into Vars during setrefs.c processing.
While converting expressions in an upper-level plan node so that theyreference Vars and expressions provided by the input plan node(s),don't convert plain Const items, even if there happens to be a matchingConst in the input. It's silly to do so because a Var is more expensive toexecute than a Const. Moreover, converting can fool ExecCheckPlanOutput'scheck that an insert or update query inserts nulls into dropped columns,leading to "query provides a value for a dropped column" errors duringINSERT or UPDATE on a table with a dropped column. We could solve thisby making that check more complicated, but I don't see the point; this fixshould save a marginal number of cycles, and it also makes for less messyEXPLAIN output, as shown by the ensuing regression test result changes.Per report from Pavel Hanák. I have not incorporated a test case basedon that example, as there doesn't seem to be a simple way of checkingthis in isolation without making a bunch of assumptions about otherplanner and SQL-function behavior.Back-patch to 9.6. This setrefs.c behavior exists much further back,but there is not currently reason to think that it causes problemsbefore 9.6.Discussion: <83shraampf.fsf@is-it.eu>1 parent00a8685 commitda8f3eb
File tree
3 files changed
+28
-5
lines changed- contrib/postgres_fdw/expected
- src
- backend/optimizer/plan
- test/regress/expected
3 files changed
+28
-5
lines changedLines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2447 | 2447 |
| |
2448 | 2448 |
| |
2449 | 2449 |
| |
2450 |
| - | |
| 2450 | + | |
2451 | 2451 |
| |
2452 | 2452 |
| |
2453 |
| - | |
| 2453 | + | |
2454 | 2454 |
| |
2455 | 2455 |
| |
2456 | 2456 |
| |
| |||
2499 | 2499 |
| |
2500 | 2500 |
| |
2501 | 2501 |
| |
2502 |
| - | |
| 2502 | + | |
2503 | 2503 |
| |
2504 | 2504 |
| |
2505 | 2505 |
| |
| |||
3139 | 3139 |
| |
3140 | 3140 |
| |
3141 | 3141 |
| |
3142 |
| - | |
| 3142 | + | |
3143 | 3143 |
| |
3144 | 3144 |
| |
3145 | 3145 |
| |
|
Lines changed: 23 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1823 | 1823 |
| |
1824 | 1824 |
| |
1825 | 1825 |
| |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
1826 | 1839 |
| |
1827 | 1840 |
| |
1828 | 1841 |
| |
| |||
2010 | 2023 |
| |
2011 | 2024 |
| |
2012 | 2025 |
| |
| 2026 | + | |
| 2027 | + | |
| 2028 | + | |
| 2029 | + | |
| 2030 | + | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
2013 | 2036 |
| |
2014 | 2037 |
| |
2015 | 2038 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1426 | 1426 |
| |
1427 | 1427 |
| |
1428 | 1428 |
| |
1429 |
| - | |
| 1429 | + | |
1430 | 1430 |
| |
1431 | 1431 |
| |
1432 | 1432 |
| |
|
0 commit comments
Comments
(0)