postgresql/src/backend
Tom Lane 677708032c 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:59:01 -05:00
..
access Add GUC and storage parameter to set the maximum size of GIN pending list. 2014-11-11 21:08:21 +09:00
bootstrap Revert "Fix bogus %name-prefix option syntax in all our Bison files." 2014-05-28 19:21:01 -04:00
catalog Fix dependency searching for case where column is visited before table. 2014-11-11 17:00:11 -05:00
commands Use just one database connection in the "tablespace" test. 2014-11-12 07:33:17 -05:00
executor Explicitly support the case that a plancache's raw_parse_tree is NULL. 2014-11-12 15:59:01 -05:00
foreign Implement IMPORT FOREIGN SCHEMA. 2014-07-10 15:01:43 -04:00
lib pgindent run for 9.4 2014-05-06 12:12:18 -04:00
libpq Message improvements 2014-11-11 20:02:30 -05:00
main Add a basic atomic ops API abstracting away platform/architecture details. 2014-09-25 23:49:05 +02:00
nodes Introduce custom path and scan providers. 2014-11-07 17:34:36 -05:00
optimizer Introduce custom path and scan providers. 2014-11-07 17:34:36 -05:00
parser Explicitly support the case that a plancache's raw_parse_tree is NULL. 2014-11-12 15:59:01 -05:00
po Translation updates 2014-10-05 23:23:50 -04:00
port Add a basic atomic ops API abstracting away platform/architecture details. 2014-09-25 23:49:05 +02:00
postmaster Eliminate one background-worker-related flag variable. 2014-10-04 21:25:41 -04:00
regex Fix incorrect search for "x?" style matches in creviterdissect(). 2014-09-23 20:26:14 -04:00
replication Fix several weaknesses in slot and logical replication on-disk serialization. 2014-11-12 18:52:49 +01:00
rewrite Implement SKIP LOCKED for row-level locks 2014-10-07 17:23:34 -03:00
snowball Finish adding file version information to installed Windows binaries. 2014-08-18 22:59:53 -04:00
storage BRIN: Block Range Indexes 2014-11-07 16:38:14 -03:00
tcop Explicitly support the case that a plancache's raw_parse_tree is NULL. 2014-11-12 15:59:01 -05:00
tsearch Cope with more than 64K phrases in a thesaurus dictionary. 2014-11-06 20:52:40 -05:00
utils Explicitly support the case that a plancache's raw_parse_tree is NULL. 2014-11-12 15:59:01 -05:00
.gitignore Add gitignore for mingw/cygwin build outputs 2011-06-09 18:11:47 +02:00
Makefile Get rid of use of dlltool in Mingw builds. 2014-02-11 12:56:20 -05:00
common.mk Remove maintainer-check target, fold into normal build 2013-10-10 20:11:56 -04:00
nls.mk Add libpgcommon to backend gettext source files 2013-10-19 13:49:05 -04:00