diff options
author | Tom Lane | 2009-01-08 13:42:33 +0000 |
---|---|---|
committer | Tom Lane | 2009-01-08 13:42:33 +0000 |
commit | 0fda77fb81e17f4139447f1733a408067b0da8aa (patch) | |
tree | 430c702e855a769c63af4760c90ad41a12a90da1 | |
parent | 60eab2f46ac78690ebe76077fe08b0c6c83b7274 (diff) |
Defend against null input in analyze_requires_snapshot(), per report
from Rushabh Lathia.
-rw-r--r-- | src/backend/parser/analyze.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c index eca385c77e..7dc2d1f324 100644 --- a/src/backend/parser/analyze.c +++ b/src/backend/parser/analyze.c @@ -222,13 +222,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)) { /* |