aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/commands')
-rw-r--r--src/backend/commands/explain.c29
-rw-r--r--src/backend/commands/user.c14
-rw-r--r--src/backend/commands/view.c4
3 files changed, 29 insertions, 18 deletions
diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c
index 1a61c684240..5b547adb2f3 100644
--- a/src/backend/commands/explain.c
+++ b/src/backend/commands/explain.c
@@ -1,15 +1,11 @@
-/*-------------------------------------------------------------------------
- *
+/*
* explain.c--
* Explain the query execution plan
*
* Copyright (c) 1994-5, Regents of the University of California
*
+ * $Id: explain.c,v 1.29 1998/12/14 08:11:00 scrappy Exp $
*
- * IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.28 1998/12/14 05:18:43 scrappy Exp $
- *
- *-------------------------------------------------------------------------
*/
#include <stdio.h>
#include <string.h>
@@ -217,7 +213,9 @@ explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es)
{
relation = RelationIdCacheGetRelation((int) lfirst(l));
if (++i > 1)
+ {
appendStringInfo(str, ", ");
+ }
appendStringInfo(str, (RelationGetRelationName(relation))->data);
}
case T_SeqScan:
@@ -239,9 +237,8 @@ explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es)
}
if (es->printCost)
{
- snprintf(buf, 1000, " (cost=%.2f size=%d width=%d)",
+ appendStringInfo(str, " (cost=%.2f size=%d width=%d)",
plan->cost, plan->plan_size, plan->plan_width);
- appendStringInfo(str, buf);
}
appendStringInfo(str, "\n");
@@ -251,14 +248,18 @@ explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es)
List *saved_rtable = es->rtable;
List *lst;
- for (i = 0; i < indent; i++)
+ for (i = 0; i < indent; i++)
+ {
appendStringInfo(str, " ");
+ }
appendStringInfo(str, " InitPlan\n");
foreach(lst, plan->initPlan)
{
es->rtable = ((SubPlan *) lfirst(lst))->rtable;
for (i = 0; i < indent; i++)
+ {
appendStringInfo(str, " ");
+ }
appendStringInfo(str, " -> ");
explain_outNode(str, ((SubPlan *) lfirst(lst))->plan, indent + 2, es);
}
@@ -269,7 +270,9 @@ explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es)
if (outerPlan(plan))
{
for (i = 0; i < indent; i++)
+ {
appendStringInfo(str, " ");
+ }
appendStringInfo(str, " -> ");
explain_outNode(str, outerPlan(plan), indent + 3, es);
}
@@ -278,7 +281,9 @@ explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es)
if (innerPlan(plan))
{
for (i = 0; i < indent; i++)
+ {
appendStringInfo(str, " ");
+ }
appendStringInfo(str, " -> ");
explain_outNode(str, innerPlan(plan), indent + 3, es);
}
@@ -290,13 +295,17 @@ explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es)
List *lst;
for (i = 0; i < indent; i++)
+ {
appendStringInfo(str, " ");
+ }
appendStringInfo(str, " SubPlan\n");
foreach(lst, plan->subPlan)
{
es->rtable = ((SubPlan *) lfirst(lst))->rtable;
for (i = 0; i < indent; i++)
+ {
appendStringInfo(str, " ");
+ }
appendStringInfo(str, " -> ");
explain_outNode(str, ((SubPlan *) lfirst(lst))->plan, indent + 4, es);
}
@@ -327,7 +336,9 @@ explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es)
es->rtable = nth(whichplan, appendplan->unionrtables);
for (i = 0; i < indent; i++)
+ {
appendStringInfo(str, " ");
+ }
appendStringInfo(str, " -> ");
explain_outNode(str, subnode, indent + 4, es);
diff --git a/src/backend/commands/user.c b/src/backend/commands/user.c
index a547156ed73..e0c0e51ea13 100644
--- a/src/backend/commands/user.c
+++ b/src/backend/commands/user.c
@@ -5,11 +5,11 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: user.c,v 1.21 1998/12/14 06:50:18 scrappy Exp $
+ * $Id: user.c,v 1.22 1998/12/14 08:11:00 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
-#include <stdio.h> /* for sprintf() */
+#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -68,7 +68,7 @@ UpdatePgPwdFile(char *sql)
* SEPCHAR character as the delimiter between fields. Then rename the
* file to its final name.
*/
- snprintf(sql, QRY_LENGTH,
+ snprintf(sql, SQL_LENGTH,
"copy %s to '%s' using delimiters %s",
ShadowRelationName, tempname, CRYPT_PWD_FILE_SEPCHAR);
pg_exec_query(sql);
@@ -173,7 +173,7 @@ DefineUser(CreateUserStmt *stmt)
(stmt->createdb && *stmt->createdb) ? ",'t','t'" : ",'f','t'",
(stmt->createuser && *stmt->createuser) ? ",'t','t'" : ",'f','t'",
stmt->password ? stmt->password : "''",
- stmt->validUntil ? stmt->valudUntil : "");
+ stmt->validUntil ? stmt->validUntil : "");
pg_exec_query(sql);
@@ -262,20 +262,20 @@ AlterUser(AlterUserStmt *stmt)
if (stmt->createdb)
{
snprintf(sql, SQL_LENGTH, "%s %susecreatedb='%s'",
- stmt->password ? "," : "",
- *stmt->createdb ? "t" : "f");
+ sql, stmt->password ? "," : "", *stmt->createdb ? "t" : "f");
}
if (stmt->createuser)
{
snprintf(sql, SQL_LENGTH, "%s %susesuper='%s'",
- (stmt->password || stmt->createdb) ? "," : "",
+ sql, (stmt->password || stmt->createdb) ? "," : "",
*stmt->createuser ? "t" : "f");
}
if (stmt->validUntil)
{
snprintf(sql, SQL_LENGTH, "%s %svaluntil='%s'",
+ sql,
(stmt->password || stmt->createdb || stmt->createuser) ? "," : "",
stmt->validUntil);
}
diff --git a/src/backend/commands/view.c b/src/backend/commands/view.c
index 1132b1f02e2..b37acb6d25e 100644
--- a/src/backend/commands/view.c
+++ b/src/backend/commands/view.c
@@ -5,11 +5,11 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: view.c,v 1.28 1998/12/14 06:50:18 scrappy Exp $
+ * $Id: view.c,v 1.29 1998/12/14 08:11:01 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
-#include <stdio.h> /* for sprintf() */
+#include <stdio.h>
#include <string.h>
#include <postgres.h>