1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-10 17:42:29 +03:00

Small code cleanups,formatting.

This commit is contained in:
Bruce Momjian
2001-05-18 21:24:20 +00:00
parent 27b0e8c0b0
commit dc0ff5c67a
8 changed files with 33 additions and 35 deletions

View File

@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.185 2001/05/09 21:10:39 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.186 2001/05/18 21:24:19 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -232,6 +232,7 @@ transformStmt(ParseState *pstate, Node *parseTree)
(SelectStmt *) parseTree);
break;
default:
/*
@@ -1224,7 +1225,7 @@ transformCreateStmt(ParseState *pstate, CreateStmt *stmt)
break;
}
}
if (!found)
if (!found)
break;
}
if (!found)
@@ -1261,16 +1262,16 @@ transformCreateStmt(ParseState *pstate, CreateStmt *stmt)
pkattr->isRel = false;
fkconstraint->pk_attrs = lappend(fkconstraint->pk_attrs, pkattr);
foreach (findattr, stmt->tableElts) {
col=lfirst(findattr);
if (strcmp(col->colname, ielem->name)==0) {
col=lfirst(findattr);
if (strcmp(col->colname, ielem->name)==0) {
char *buff=TypeNameToInternalName(col->typename);
Oid type=typenameTypeId(buff);
if (!OidIsValid(type)) {
elog(ERROR, "Unable to lookup type %s", col->typename->name);
}
pktypoid[attnum++]=type; /* need to convert typename */
break;
}
if (!OidIsValid(type)) {
elog(ERROR, "Unable to lookup type %s", col->typename->name);
}
pktypoid[attnum++]=type; /* need to convert typename */
break;
}
}
}
}
@@ -1959,8 +1960,7 @@ transformSelectStmt(ParseState *pstate, SelectStmt *stmt)
* The tree of set operations is converted into the setOperations field of
* the top-level Query.
*/
static Query *
transformSetOperationStmt(ParseState *pstate, SelectStmt *stmt)
static Query *transformSetOperationStmt(ParseState *pstate, SelectStmt *stmt)
{
Query *qry = makeNode(Query);
SelectStmt *leftmostSelect;

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.79 2001/03/22 06:16:16 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.80 2001/05/18 21:24:19 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -843,7 +843,7 @@ findTargetlistEntry(ParseState *pstate, Node *node, List *tlist, int clause)
* an expression.
*----------
*/
if (IsA(node, Ident) &&((Ident *) node)->indirection == NIL)
if (IsA(node, Ident) && ((Ident *) node)->indirection == NIL)
{
char *name = ((Ident *) node)->name;

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.92 2001/03/22 03:59:41 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.93 2001/05/18 21:24:19 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -573,7 +573,7 @@ transformIdent(ParseState *pstate, Ident *ident, int precedence)
* appear
*/
if (ident->indirection == NIL &&
refnameRangeOrJoinEntry(pstate, ident->name, &sublevels_up) != NULL)
refnameRangeOrJoinEntry(pstate, ident->name, &sublevels_up) != NULL)
{
ident->isRel = TRUE;
result = (Node *) ident;

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.102 2001/04/18 22:25:31 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.103 2001/05/18 21:24:19 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -287,7 +287,7 @@ ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs,
if (nargs == 1 && !must_be_agg)
{
/* Is it a plain Relation name from the parser? */
if (IsA(first_arg, Ident) &&((Ident *) first_arg)->isRel)
if (IsA(first_arg, Ident) && ((Ident *) first_arg)->isRel)
{
Ident *ident = (Ident *) first_arg;
@@ -347,7 +347,7 @@ ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs,
if (nargs != 1)
elog(ERROR, "Aggregate functions may only have one parameter");
/* Agg's argument can't be a relation name, either */
if (IsA(first_arg, Ident) &&((Ident *) first_arg)->isRel)
if (IsA(first_arg, Ident) && ((Ident *) first_arg)->isRel)
elog(ERROR, "Aggregate functions cannot be applied to relation names");
could_be_agg = true;
}
@@ -355,7 +355,7 @@ ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs,
{
/* Try to parse as an aggregate if above-mentioned checks are OK */
could_be_agg = (nargs == 1) &&
!(IsA(first_arg, Ident) &&((Ident *) first_arg)->isRel);
!(IsA(first_arg, Ident) && ((Ident *) first_arg)->isRel);
}
if (could_be_agg)
@@ -434,7 +434,7 @@ ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs,
{
Node *arg = lfirst(i);
if (IsA(arg, Ident) &&((Ident *) arg)->isRel)
if (IsA(arg, Ident) && ((Ident *) arg)->isRel)
{
RangeTblEntry *rte;
int vnum;