|
17 | 17 | * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
|
18 | 18 | * Portions Copyright (c) 1994, Regents of the University of California
|
19 | 19 | *
|
20 |
| - *$PostgreSQL: pgsql/src/backend/parser/analyze.c,v 1.386 2009/01/01 17:23:45 momjian Exp $ |
| 20 | + *$PostgreSQL: pgsql/src/backend/parser/analyze.c,v 1.387 2009/01/08 13:42:33 tgl Exp $ |
21 | 21 | *
|
22 | 22 | *-------------------------------------------------------------------------
|
23 | 23 | */
|
@@ -222,13 +222,17 @@ transformStmt(ParseState *pstate, Node *parseTree)
|
222 | 222 | *Returns true if a snapshot must be set before doing parse analysis
|
223 | 223 | *on the given raw parse tree.
|
224 | 224 | *
|
225 |
| - * Classification here should match transformStmt(). |
| 225 | + * Classification here should match transformStmt(); but we also have to |
| 226 | + * allow a NULL input (for Parse/Bind of an empty query string). |
226 | 227 | */
|
227 | 228 | bool
|
228 | 229 | analyze_requires_snapshot(Node*parseTree)
|
229 | 230 | {
|
230 | 231 | boolresult;
|
231 | 232 |
|
| 233 | +if (parseTree==NULL) |
| 234 | +return false; |
| 235 | + |
232 | 236 | switch (nodeTag(parseTree))
|
233 | 237 | {
|
234 | 238 | /*
|
|