aboutsummaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2009-01-30 16:59:16 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2009-01-30 16:59:16 +0000
commite06e3d38103274388a05ee3bcbea584ff9cacb22 (patch)
tree8ea74517cf872497533a594b402e2d804808b651 /src/backend
parentfbb70ccd6072604f76423e1c8be9e842231a1d50 (diff)
downloadpostgresql-e06e3d38103274388a05ee3bcbea584ff9cacb22.tar.gz
postgresql-e06e3d38103274388a05ee3bcbea584ff9cacb22.zip
Defend against null input in analyze_requires_snapshot(), per report
from Rushabh Lathia. Back-patch of patch of 2009-01-08. This is necessary in 8.3, as reported by Bjorn Munch. It's not currently necessary in 8.2, AFAICS, but seems best to include it there too.
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/parser/analyze.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c
index 226f7c76339..65de8610179 100644
--- a/src/backend/parser/analyze.c
+++ b/src/backend/parser/analyze.c
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/parser/analyze.c,v 1.353.2.2 2008/12/13 02:00:52 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/analyze.c,v 1.353.2.3 2009/01/30 16:59:16 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -437,13 +437,17 @@ transformStmt(ParseState *pstate, Node *parseTree,
* Returns true if a snapshot must be set before doing parse analysis
* on the given raw parse tree.
*
- * Classification here should match transformStmt().
+ * Classification here should match transformStmt(); but we also have to
+ * allow a NULL input (for Parse/Bind of an empty query string).
*/
bool
analyze_requires_snapshot(Node *parseTree)
{
bool result;
+ if (parseTree == NULL)
+ return false;
+
switch (nodeTag(parseTree))
{
/*