aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/explain.c
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2009-12-12 00:35:34 +0000
committerRobert Haas <rhaas@postgresql.org>2009-12-12 00:35:34 +0000
commit02490d4692c46bee3e9279e79c5d07c576d2a32c (patch)
tree110854a6ec9e7e61d4c0e846650f0a78694f34a9 /src/backend/commands/explain.c
parent6b45e3b7aaa0a66082f61921e01f6df6e9f9253f (diff)
downloadpostgresql-02490d4692c46bee3e9279e79c5d07c576d2a32c.tar.gz
postgresql-02490d4692c46bee3e9279e79c5d07c576d2a32c.zip
Export ExplainBeginOutput() and ExplainEndOutput() for auto_explain.
Without these functions, anyone outside of explain.c can't actually use ExplainPrintPlan, because the ExplainState won't be initialized properly. The user-visible result of this was a crash when using auto_explain with the JSON output format. Report by Euler Taveira de Oliveira. Analysis by Tom Lane. Patch by me.
Diffstat (limited to 'src/backend/commands/explain.c')
-rw-r--r--src/backend/commands/explain.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c
index 0970723a6de..c34b5751e46 100644
--- a/src/backend/commands/explain.c
+++ b/src/backend/commands/explain.c
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994-5, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/explain.c,v 1.194 2009/12/11 01:33:35 adunstan Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/explain.c,v 1.195 2009/12/12 00:35:33 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
@@ -91,8 +91,6 @@ static void ExplainCloseGroup(const char *objtype, const char *labelname,
bool labeled, ExplainState *es);
static void ExplainDummyGroup(const char *objtype, const char *labelname,
ExplainState *es);
-static void ExplainBeginOutput(ExplainState *es);
-static void ExplainEndOutput(ExplainState *es);
static void ExplainXMLTag(const char *tagname, int flags, ExplainState *es);
static void ExplainJSONLineEnding(ExplainState *es);
static void ExplainYAMLLineStarting(ExplainState *es);
@@ -1791,7 +1789,7 @@ ExplainDummyGroup(const char *objtype, const char *labelname, ExplainState *es)
* This is just enough different from processing a subgroup that we need
* a separate pair of subroutines.
*/
-static void
+void
ExplainBeginOutput(ExplainState *es)
{
switch (es->format)
@@ -1822,7 +1820,7 @@ ExplainBeginOutput(ExplainState *es)
/*
* Emit the end-of-output boilerplate.
*/
-static void
+void
ExplainEndOutput(ExplainState *es)
{
switch (es->format)