postgresql/src/backend
Tom Lane c2b4ed19f6 Explicitly support the case that a plancache's raw_parse_tree is NULL.
This only happens if a client issues a Parse message with an empty query
string, which is a bit odd; but since it is explicitly called out as legal
by our FE/BE protocol spec, we'd probably better continue to allow it.

Fix by adding tests everywhere that the raw_parse_tree field is passed to
functions that don't or shouldn't accept NULL.  Also make it clear in the
relevant comments that NULL is an expected case.

This reverts commits a73c9dbab0 and
2e9650cbcf, which fixed specific crash
symptoms by hacking things at what now seems to be the wrong end, ie the
callee functions.  Making the callees allow NULL is superficially more
robust, but it's not always true that there is a defensible thing for the
callee to do in such cases.  The caller has more context and is better
able to decide what the empty-query case ought to do.

Per followup discussion of bug #11335.  Back-patch to 9.2.  The code
before that is sufficiently different that it would require development
of a separate patch, which doesn't seem worthwhile for what is believed
to be an essentially cosmetic change.
2014-11-12 15:58:44 -05:00
..
access Prevent the unnecessary creation of .ready file for the timeline history file. 2014-11-06 21:25:18 +09:00
bootstrap Revert "Fix bogus %name-prefix option syntax in all our Bison files." 2014-05-28 19:28:37 -04:00
catalog Fix dependency searching for case where column is visited before table. 2014-11-11 17:00:21 -05:00
commands Drop no-longer-needed buffers during ALTER DATABASE SET TABLESPACE. 2014-11-04 13:24:14 -05:00
executor Explicitly support the case that a plancache's raw_parse_tree is NULL. 2014-11-12 15:58:44 -05:00
foreign Arrange to cache FdwRoutine structs in foreign tables' relcache entries. 2013-03-06 23:48:09 -05:00
lib Remove tabs after spaces in C comments 2014-05-06 11:26:28 -04:00
libpq Remove tabs after spaces in C comments 2014-05-06 11:26:28 -04:00
main Remove tabs after spaces in C comments 2014-05-06 11:26:28 -04:00
nodes Avoid core dump in _outPathInfo() for Path without a parent RelOptInfo. 2014-10-17 22:33:07 -04:00
optimizer Improve planning of btree index scans using ScalarArrayOpExpr quals. 2014-10-26 16:12:29 -04:00
parser Explicitly support the case that a plancache's raw_parse_tree is NULL. 2014-11-12 15:58:44 -05:00
po Translation updates 2014-07-21 01:04:46 -04:00
port Fix spinlock implementation for some !solaris sparc platforms. 2014-09-09 23:37:33 +02:00
postmaster Don't balance vacuum cost delay when per-table settings are in effect 2014-10-03 13:01:27 -03:00
regex Fix incorrect search for "x?" style matches in creviterdissect(). 2014-09-23 20:25:36 -04:00
replication Fix VPATH builds of the replication parser from git for some !gcc compilers. 2014-09-25 15:23:17 +02:00
rewrite Add some errdetail to checkRuleResultList(). 2014-07-02 14:20:34 -04:00
snowball Fix ancient encoding error in hungarian.stop. 2014-06-10 22:48:39 -04:00
storage Flush unlogged table's buffers when copying or moving databases. 2014-10-20 23:45:31 +02:00
tcop Explicitly support the case that a plancache's raw_parse_tree is NULL. 2014-11-12 15:58:44 -05:00
tsearch Cope with more than 64K phrases in a thesaurus dictionary. 2014-11-06 20:52:52 -05:00
utils Explicitly support the case that a plancache's raw_parse_tree is NULL. 2014-11-12 15:58:44 -05: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 Move relpath() to libpgcommon 2013-02-21 22:46:17 -03:00
nls.mk Add libpgcommon to backend gettext source files 2013-10-21 06:20:05 -04:00