postgresql/src
Tom Lane da8f3ebf30 Don't convert Consts into Vars during setrefs.c processing.
While converting expressions in an upper-level plan node so that they
reference Vars and expressions provided by the input plan node(s),
don't convert plain Const items, even if there happens to be a matching
Const in the input.  It's silly to do so because a Var is more expensive to
execute than a Const.  Moreover, converting can fool ExecCheckPlanOutput's
check that an insert or update query inserts nulls into dropped columns,
leading to "query provides a value for a dropped column" errors during
INSERT or UPDATE on a table with a dropped column.  We could solve this
by making that check more complicated, but I don't see the point; this fix
should save a marginal number of cycles, and it also makes for less messy
EXPLAIN output, as shown by the ensuing regression test result changes.

Per report from Pavel Hanák.  I have not incorporated a test case based
on that example, as there doesn't seem to be a simple way of checking
this in isolation without making a bunch of assumptions about other
planner 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 problems
before 9.6.

Discussion: <83shraampf.fsf@is-it.eu>
2016-11-02 14:32:13 -04:00
..
backend Don't convert Consts into Vars during setrefs.c processing. 2016-11-02 14:32:13 -04:00
bin Fix memory leak in tar file padding 2016-10-30 14:10:39 +01:00
common Rename "pg_xlog" directory to "pg_wal". 2016-10-20 11:32:18 -04:00
fe_utils Teach appendShellString() to not quote strings containing "-". 2016-09-06 14:53:31 -04:00
include Remove declarations for pq_putmessage_hook and pq_flush_hook. 2016-10-31 09:14:46 -04:00
interfaces Remove a comment which is now incorrect. 2016-10-20 10:24:51 -04:00
makefiles Remove "sco" and "unixware" ports. 2016-10-11 11:26:04 -04:00
pl Add function name to PyArg_ParseTuple() 2016-10-27 15:41:29 -04:00
port Remove invitation to report a bug about unknown encoding 2016-10-27 18:43:46 -04:00
template Remove "sco" and "unixware" ports. 2016-10-11 11:26:04 -04:00
test Don't convert Consts into Vars during setrefs.c processing. 2016-11-02 14:32:13 -04:00
timezone Fix not-HAVE_SYMLINK code in zic.c. 2016-10-26 13:40:41 -04:00
tools Revert "Replace PostmasterRandom() with a stronger way of generating randomness." 2016-10-18 16:28:23 +03:00
tutorial Update copyright for 2016 2016-01-02 13:33:40 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
DEVELOPERS
Makefile Install TAP test infrastructure so it's available for extension testing. 2016-09-23 15:50:00 -04:00
Makefile.global.in Remove "sco" and "unixware" ports. 2016-10-11 11:26:04 -04:00
Makefile.shlib Remove "sco" and "unixware" ports. 2016-10-11 11:26:04 -04:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00