aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/explain.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/commands/explain.c')
-rw-r--r--src/backend/commands/explain.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c
index 6745b4f1f38..a26579270c9 100644
--- a/src/backend/commands/explain.c
+++ b/src/backend/commands/explain.c
@@ -4,7 +4,7 @@
*
* Copyright (c) 1994-5, Regents of the University of California
*
- * $Id: explain.c,v 1.34 1999/04/23 21:23:48 momjian Exp $
+ * $Id: explain.c,v 1.35 1999/04/25 03:19:09 tgl Exp $
*
*/
#include <stdio.h>
@@ -350,18 +350,13 @@ explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es)
static char *
Explain_PlanToString(Plan *plan, ExplainState *es)
{
- StringInfo str;
- char *s;
+ StringInfoData str;
- if (plan == NULL)
- return "";
- Assert(plan != NULL);
- str = makeStringInfo();
- explain_outNode(str, plan, 0, es);
- s = str->data;
- pfree(str);
-
- return s;
+ /* see stringinfo.h for an explanation of this maneuver */
+ initStringInfo(&str);
+ if (plan != NULL)
+ explain_outNode(&str, plan, 0, es);
+ return str.data;
}
/*