postgresql/src
Tom Lane 9492cf86e4 Fix assorted fallout from IS [NOT] NULL patch.
Commits 4452000f3 et al established semantics for NullTest.argisrow that
are a bit different from its initial conception: rather than being merely
a cache of whether we've determined the input to have composite type,
the flag now has the further meaning that we should apply field-by-field
testing as per the standard's definition of IS [NOT] NULL.  If argisrow
is false and yet the input has composite type, the construct instead has
the semantics of IS [NOT] DISTINCT FROM NULL.  Update the comments in
primnodes.h to clarify this, and fix ruleutils.c and deparse.c to print
such cases correctly.  In the case of ruleutils.c, this merely results in
cosmetic changes in EXPLAIN output, since the case can't currently arise
in stored rules.  However, it represents a live bug for deparse.c, which
would formerly have sent a remote query that had semantics different
from the local behavior.  (From the user's standpoint, this means that
testing a remote nested-composite column for null-ness could have had
unexpected recursive behavior much like that fixed in 4452000f3.)

In a related but somewhat independent fix, make plancat.c set argisrow
to false in all NullTest expressions constructed to represent "attnotnull"
constructs.  Since attnotnull is actually enforced as a simple null-value
check, this is a more accurate representation of the semantics; we were
previously overpromising what it meant for composite columns, which might
possibly lead to incorrect planner optimizations.  (It seems that what the
SQL spec expects a NOT NULL constraint to mean is an IS NOT NULL test, so
arguably we are violating the spec and should fix attnotnull to do the
other thing.  If we ever do, this part should get reverted.)

Back-patch, same as the previous commit.

Discussion: <10682.1469566308@sss.pgh.pa.us>
2016-07-28 16:09:15 -04:00
..
backend Fix assorted fallout from IS [NOT] NULL patch. 2016-07-28 16:09:15 -04:00
bin Register atexit hook only once in pg_upgrade. 2016-07-28 11:39:10 -04:00
common pgindent run for 9.6 2016-06-09 18:02:36 -04:00
fe_utils Fix comment. 2016-05-15 17:04:01 -04:00
include Fix assorted fallout from IS [NOT] NULL patch. 2016-07-28 16:09:15 -04:00
interfaces Translation updates 2016-07-18 12:07:49 -04:00
makefiles Fix typos in comments and doc 2016-01-28 16:47:36 +09:00
pl Make pltcl regression tests safe for Danish locale. 2016-07-21 14:24:07 -04:00
port pgindent run for 9.6 2016-06-09 18:02:36 -04:00
template Remove some remains from Alpha support removal 2015-10-29 16:40:14 -04:00
test Fix assorted fallout from IS [NOT] NULL patch. 2016-07-28 16:09:15 -04:00
timezone Reduce stack space consumption in tzload(). 2016-07-07 11:28:17 -04:00
tools Establish conventions about global object names used in regression tests. 2016-07-17 18:42:43 -04: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 Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Create src/fe_utils/, and move stuff into there from pg_dump's dumputils. 2016-03-24 15:55:57 -04:00
Makefile.global.in Provide and use a makefile target to build all generated headers. 2016-07-01 15:09:02 -04:00
Makefile.shlib Make the AIX case of Makefile.shlib safe for parallel make. 2016-07-23 20:30:03 -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