postgresql/src/backend/tcop
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
..
dest.c Update copyright for 2014 2014-01-07 16:05:30 -05:00
fastpath.c pgindent run for 9.4 2014-05-06 12:12:18 -04:00
Makefile Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
postgres.c Explicitly support the case that a plancache's raw_parse_tree is NULL. 2014-11-12 15:59:01 -05:00
pquery.c Fix failure to set ActiveSnapshot while rewinding a cursor. 2014-05-07 14:25:11 -04:00
utility.c Explicitly support the case that a plancache's raw_parse_tree is NULL. 2014-11-12 15:59:01 -05:00