*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.161 2004/05/30 23:40:26 neilc Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.162 2004/06/01 03:28:41 tgl Exp $
*
*-------------------------------------------------------------------------
*/
{
CaseExpr *caseexpr = (CaseExpr *) node;
CaseExprState *cstate = makeNode(CaseExprState);
- FastList outlist;
+ List *outlist = NIL;
ListCell *l;
cstate->xprstate.evalfunc = (ExprStateEvalFunc) ExecEvalCase;
cstate->arg = ExecInitExpr(caseexpr->arg, parent);
- FastListInit(&outlist);
foreach(l, caseexpr->args)
{
CaseWhen *when = (CaseWhen *) lfirst(l);
wstate->xprstate.expr = (Expr *) when;
wstate->expr = ExecInitExpr(when->expr, parent);
wstate->result = ExecInitExpr(when->result, parent);
- FastAppend(&outlist, wstate);
+ outlist = lappend(outlist, wstate);
}
- cstate->args = FastListValue(&outlist);
+ cstate->args = outlist;
cstate->defresult = ExecInitExpr(caseexpr->defresult, parent);
state = (ExprState *) cstate;
}
{
ArrayExpr *arrayexpr = (ArrayExpr *) node;
ArrayExprState *astate = makeNode(ArrayExprState);
- FastList outlist;
+ List *outlist = NIL;
ListCell *l;
astate->xprstate.evalfunc = (ExprStateEvalFunc) ExecEvalArray;
- FastListInit(&outlist);
foreach(l, arrayexpr->elements)
{
Expr *e = (Expr *) lfirst(l);
ExprState *estate;
estate = ExecInitExpr(e, parent);
- FastAppend(&outlist, estate);
+ outlist = lappend(outlist, estate);
}
- astate->elements = FastListValue(&outlist);
+ astate->elements = outlist;
/* do one-time catalog lookup for type info */
get_typlenbyvalalign(arrayexpr->element_typeid,
&astate->elemlength,
{
RowExpr *rowexpr = (RowExpr *) node;
RowExprState *rstate = makeNode(RowExprState);
- List *outlist;
+ List *outlist = NIL;
ListCell *l;
rstate->xprstate.evalfunc = (ExprStateEvalFunc) ExecEvalRow;
- outlist = NIL;
foreach(l, rowexpr->args)
{
Expr *e = (Expr *) lfirst(l);
{
CoalesceExpr *coalesceexpr = (CoalesceExpr *) node;
CoalesceExprState *cstate = makeNode(CoalesceExprState);
- FastList outlist;
+ List *outlist = NIL;
ListCell *l;
cstate->xprstate.evalfunc = (ExprStateEvalFunc) ExecEvalCoalesce;
- FastListInit(&outlist);
foreach(l, coalesceexpr->args)
{
Expr *e = (Expr *) lfirst(l);
ExprState *estate;
estate = ExecInitExpr(e, parent);
- FastAppend(&outlist, estate);
+ outlist = lappend(outlist, estate);
}
- cstate->args = FastListValue(&outlist);
+ cstate->args = outlist;
state = (ExprState *) cstate;
}
break;
break;
case T_List:
{
- FastList outlist;
+ List *outlist = NIL;
ListCell *l;
- FastListInit(&outlist);
foreach(l, (List *) node)
{
- FastAppend(&outlist,
- ExecInitExpr((Expr *) lfirst(l),
- parent));
+ outlist = lappend(outlist,
+ ExecInitExpr((Expr *) lfirst(l),
+ parent));
}
/* Don't fall through to the "common" code below */
- return (ExprState *) FastListValue(&outlist);
+ return (ExprState *) outlist;
}
default:
elog(ERROR, "unrecognized node type: %d",
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/parser/parse_target.c,v 1.119 2004/05/30 23:40:35 neilc Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/parse_target.c,v 1.120 2004/06/01 03:28:48 tgl Exp $
*
*-------------------------------------------------------------------------
*/
List *
transformTargetList(ParseState *pstate, List *targetlist)
{
- FastList p_target;
+ List *p_target = NIL;
ListCell *o_target;
- FastListInit(&p_target);
-
foreach(o_target, targetlist)
{
ResTarget *res = (ResTarget *) lfirst(o_target);
* Target item is a single '*', expand all tables
* (e.g., SELECT * FROM emp)
*/
- FastConc(&p_target,
- ExpandAllTables(pstate));
+ p_target = list_concat(p_target,
+ ExpandAllTables(pstate));
}
else
{
rte = addImplicitRTE(pstate, makeRangeVar(schemaname,
relname));
- FastConc(&p_target,
- expandRelAttrs(pstate, rte));
+ p_target = list_concat(p_target,
+ expandRelAttrs(pstate, rte));
}
}
else
{
/* Plain ColumnRef node, treat it as an expression */
- FastAppend(&p_target,
- transformTargetEntry(pstate,
- res->val,
- NULL,
- res->name,
- false));
+ p_target = lappend(p_target,
+ transformTargetEntry(pstate,
+ res->val,
+ NULL,
+ res->name,
+ false));
}
}
else
{
/* Everything else but ColumnRef */
- FastAppend(&p_target,
- transformTargetEntry(pstate,
- res->val,
- NULL,
- res->name,
- false));
+ p_target = lappend(p_target,
+ transformTargetEntry(pstate,
+ res->val,
+ NULL,
+ res->name,
+ false));
}
}
- return FastListValue(&p_target);
+ return p_target;
}