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:29 +0000 (02:19 +0900)
Back-patch to all supported branches.

Per bug #11335 from Haruka Takatsuka

src/backend/tcop/utility.c

index c900c85d81de3eedb88039adf50c92a1cca913a2..b83a7eaac900f188ceb910366f6f9ecadaea4888 100644 (file)
@@ -2429,6 +2429,9 @@ GetCommandLogLevel(Node *parsetree)
 {
    LogStmtLevel lev;
 
+   if (parsetree == NULL)
+       return LOGSTMT_ALL;
+
    switch (nodeTag(parsetree))
    {
            /* raw plannable queries */