summaryrefslogtreecommitdiff
path: root/src/backend/tcop/utility.c
diff options
context:
space:
mode:
authorFujii Masao <fujii@postgresql.org>2014-09-05 02:17:57 +0900
committerFujii Masao <fujii@postgresql.org>2014-09-05 02:19:45 +0900
commit78b1228efeb5d2615f7e844cb4fe8ad8ff335e29 (patch)
tree9a326c0e37e79649ae8cfabf64fd709b0c5c8874 /src/backend/tcop/utility.c
parent9c4b7ed13da24cdb2f977547546bb6be437d1974 (diff)
Fix segmentation fault that an empty prepared statement could cause.
Back-patch to all supported branches. Per bug #11335 from Haruka Takatsuka
Diffstat (limited to 'src/backend/tcop/utility.c')
-rw-r--r--src/backend/tcop/utility.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c
index c76e7bb0fec..81e832506af 100644
--- a/src/backend/tcop/utility.c
+++ b/src/backend/tcop/utility.c
@@ -2184,6 +2184,9 @@ GetCommandLogLevel(Node *parsetree)
{
LogStmtLevel lev;
+ if (parsetree == NULL)
+ return LOGSTMT_ALL;
+
switch (nodeTag(parsetree))
{
/* raw plannable queries */