Fix segmentation fault that an empty prepared statement could cause.
authorFujii Masao
Thu, 4 Sep 2014 17:17:57 +0000 (02:17 +0900)
committerFujii Masao
Thu, 4 Sep 2014 17:19:14 +0000 (02:19 +0900)
Back-patch to all supported branches.

Per bug #11335 from Haruka Takatsuka

src/backend/tcop/utility.c

index 0558ea34b054db356ff081abc0b10d7bb2b0186d..18c74525fa02fc940d6529df5adaa59573545728 100644 (file)
@@ -2452,6 +2452,9 @@ GetCommandLogLevel(Node *parsetree)
 {
    LogStmtLevel lev;
 
+   if (parsetree == NULL)
+       return LOGSTMT_ALL;
+
    switch (nodeTag(parsetree))
    {
            /* raw plannable queries */