postgresql/src/backend
Tom Lane 7b8526e5d6 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
..
access Fix torn-page, unlogged xid and further risks from heap_update(). 2016-07-15 17:49:48 -07:00
bootstrap Fix off-by-one loop count in MapArrayTypeName, and get rid of static array. 2014-12-16 15:35:43 -05:00
catalog Fix multiple minor infelicities in aclchk.c error reports. 2016-06-13 13:53:10 -04:00
commands Don't reset changes_since_analyze after a selective-columns ANALYZE. 2016-06-06 17:44:18 -04:00
executor Fix constant-folding of ROW(...) IS [NOT] NULL with composite fields. 2016-07-26 15:25:02 -04:00
foreign Add GetForeignColumnOptions() to foreign.c, and add some documentation. 2012-03-07 18:20:58 -05:00
lib Remove tabs after spaces in C comments 2014-05-06 11:26:27 -04:00
libpq Distrust external OpenSSL clients; clear err queue 2016-05-07 00:05:39 -04:00
main Make fallback implementation of pg_memory_barrier() work in 9.2 and 9.3. 2016-04-16 10:41:57 -04:00
nodes Avoid core dump in _outPathInfo() for Path without a parent RelOptInfo. 2014-10-17 22:33:10 -04:00
optimizer Fix assorted fallout from IS [NOT] NULL patch. 2016-07-28 16:09:15 -04:00
parser Improve documentation about CREATE TABLE ... LIKE. 2016-07-28 13:26:59 -04:00
po Translation updates 2016-05-09 10:09:45 -04:00
port Improve TranslateSocketError() to handle more Windows error codes. 2016-04-21 16:59:13 -04:00
postmaster Make "postgres -C guc" print "" not "(null)" for null-valued GUCs. 2016-06-22 11:55:35 -04:00
regex Suppress compiler warnings about useless comparison of unsigned to zero. 2016-02-15 17:11:52 -05:00
replication Fix typos 2016-02-29 18:11:58 -03:00
rewrite Improve error message for rejecting RETURNING clauses with dropped columns. 2016-02-29 19:11:59 -05:00
snowball Fix ancient encoding error in hungarian.stop. 2014-06-10 22:48:45 -04:00
storage Fix --disable-spinlocks in 9.2 and 9.3 branches. 2016-04-18 13:19:52 -04:00
tcop Add recursion depth protections to regular expression matching. 2015-10-02 14:51:58 -04:00
tsearch Fix possible use of uninitialised value in ts_headline() 2016-04-08 21:26:12 +03:00
utils Fix assorted fallout from IS [NOT] NULL patch. 2016-07-28 16:09:15 -04:00
.gitignore Add gitignore for mingw/cygwin build outputs 2011-06-09 18:11:47 +02:00
common.mk Call check_keywords.pl in maintainer-check 2012-02-27 13:53:12 +02:00
Makefile AIX: Link the postgres executable with -Wl,-brtllib. 2015-07-15 21:00:31 -04:00
nls.mk Translation updates 2013-02-04 00:01:19 -05:00