diff options
author | Marc G. Fournier <scrappy@hub.org> | 1998-12-14 05:19:16 +0000 |
---|---|---|
committer | Marc G. Fournier <scrappy@hub.org> | 1998-12-14 05:19:16 +0000 |
commit | 7c3b7d27446cbe7e4d1ccf6f51caf2d38f55916c (patch) | |
tree | 77cf346913929743b747b012d14780fb369d7041 /src/backend/commands/explain.c | |
parent | f722af618a5d6cedb0e083397f6efcec2e07b0c8 (diff) | |
download | postgresql-7c3b7d27446cbe7e4d1ccf6f51caf2d38f55916c.tar.gz postgresql-7c3b7d27446cbe7e4d1ccf6f51caf2d38f55916c.zip |
Initial attempt to clean up the code...
Switch sprintf() to snprintf()
Remove any/all #if 0 -or- #ifdef NOT_USED -or- #ifdef FALSE sections of
code
Diffstat (limited to 'src/backend/commands/explain.c')
-rw-r--r-- | src/backend/commands/explain.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c index 2f08297d069..1a61c684240 100644 --- a/src/backend/commands/explain.c +++ b/src/backend/commands/explain.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.27 1998/11/22 10:48:34 vadim Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.28 1998/12/14 05:18:43 scrappy Exp $ * *------------------------------------------------------------------------- */ @@ -146,11 +146,11 @@ ExplainOneQuery(Query *query, bool verbose, CommandDest dest) static void explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es) { - List *l; + List *l; Relation relation; - char *pname; - char buf[1000]; - int i; + char *pname, + buf[1000]; + int i; if (plan == NULL) { @@ -207,11 +207,6 @@ explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es) break; } -#if 0 - for (i = 0; i < indent; i++) - appendStringInfo(str, " "); -#endif - appendStringInfo(str, pname); switch (nodeTag(plan)) { @@ -233,7 +228,7 @@ explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es) appendStringInfo(str, " on "); if (strcmp(rte->refname, rte->relname) != 0) { - sprintf(buf, "%s ", rte->relname); + snprintf(buf, 1000, "%s ", rte->relname); appendStringInfo(str, buf); } appendStringInfo(str, rte->refname); @@ -244,7 +239,7 @@ explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es) } if (es->printCost) { - sprintf(buf, " (cost=%.2f size=%d width=%d)", + snprintf(buf, 1000, " (cost=%.2f size=%d width=%d)", plan->cost, plan->plan_size, plan->plan_width); appendStringInfo(str, buf); } |