*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/execJunk.c,v 1.16 1999/02/13 23:15:16 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/execJunk.c,v 1.17 1999/05/17 17:03:10 momjian Exp $
*
*-------------------------------------------------------------------------
*/
*
* The general idea is the following: A target list consists of a list of
* Resdom nodes & expression pairs. Each Resdom node has an attribute
- * called 'resjunk'. If the value of this attribute is 1 then the
+ * called 'resjunk'. If the value of this attribute is true then the
* corresponding attribute is a "junk" attribute.
*
* When we initialize a plan we call 'ExecInitJunkFilter' to create
TargetEntry *tle;
Resdom *resdom,
*cleanResdom;
- int resjunk;
+ bool resjunk;
AttrNumber cleanResno;
AttrNumber *cleanMap;
Size size;
/* ---------------------
* First find the "clean" target list, i.e. all the entries
- * in the original target list which have a zero 'resjunk'
+ * in the original target list which have a false 'resjunk'
* NOTE: make copy of the Resdom nodes, because we have
* to change the 'resno's...
* ---------------------
resdom = rtarget->resdom;
expr = rtarget->expr;
resjunk = resdom->resjunk;
- if (resjunk == 0)
+ if (!resjunk)
{
/*
resdom = tle->resdom;
expr = tle->expr;
resjunk = resdom->resjunk;
- if (resjunk == 0)
+ if (!resjunk)
{
cleanMap[cleanResno - 1] = resdom->resno;
cleanResno++;
Resdom *resdom;
AttrNumber resno;
char *resname;
- int resjunk;
+ bool resjunk;
TupleDesc tupType;
HeapTuple tuple;
resdom = tle->resdom;
resname = resdom->resname;
resjunk = resdom->resjunk;
- if (resjunk != 0 && (strcmp(resname, attrName) == 0))
+ if (resjunk && (strcmp(resname, attrName) == 0))
{
/* We found it ! */
resno = resdom->resno;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/makefuncs.c,v 1.14 1999/05/12 15:01:34 wieck Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/makefuncs.c,v 1.15 1999/05/17 17:03:12 momjian Exp $
*
* NOTES
* Creator functions in POSTGRES 4.2 are generated automatically. Most of
char *resname,
Index reskey,
Oid reskeyop,
- int resjunk)
+ bool resjunk)
{
Resdom *resdom = makeNode(Resdom);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: outfuncs.c,v 1.81 1999/05/12 15:01:34 wieck Exp $
+ * $Id: outfuncs.c,v 1.82 1999/05/17 17:03:13 momjian Exp $
*
* NOTES
* Every (plan) node in POSTGRES has an associated "out" routine which
node->reskey,
node->reskeyop);
- appendStringInfo(str, " :resgroupref %d :resjunk %d",
+ appendStringInfo(str, " :resgroupref %d :resjunk %s ",
node->resgroupref,
- node->resjunk);
+ node->resjunk ? "true" : "false");
}
static void
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.61 1999/05/12 15:01:35 wieck Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.62 1999/05/17 17:03:14 momjian Exp $
*
* NOTES
* Most of the read functions for plan nodes are tested. (In fact, they
token = lsptok(NULL, &length); /* eat :resjunk */
token = lsptok(NULL, &length); /* get resjunk */
- local_node->resjunk = atoi(token);
+ local_node->resjunk = (token[0] == 't') ? true : false;
return local_node;
}
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.52 1999/05/13 07:28:32 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.53 1999/05/17 17:03:15 momjian Exp $
*
*-------------------------------------------------------------------------
*/
resname,
0,
0,
- 1);
+ true);
var = makeVar(rowmark->rti, -1, TIDOID,
-1, 0, rowmark->rti, -1);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/prep/preptlist.c,v 1.19 1999/05/12 15:01:41 wieck Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/prep/preptlist.c,v 1.20 1999/05/17 17:03:18 momjian Exp $
*
*-------------------------------------------------------------------------
*/
"ctid",
0,
0,
- 1);
+ true);
var = makeVar(result_relation, -1, TIDOID, -1, 0, result_relation, -1);
* locks.
*
* So, copy all these entries to the end of the target list and set their
- * 'resjunk' value to 1 to show that these are special attributes and
+ * 'resjunk' value to true to show that these are special attributes and
* have to be treated specially by the executor!
*/
foreach(temp, old_tlist)
{
newresno = (Resdom *) copyObject((Node *) old_tle->resdom);
newresno->resno = length(t_list) + 1;
- newresno->resjunk = 1;
+ newresno->resjunk = true;
new_tl = makeTargetEntry(newresno, old_tle->expr);
t_list = lappend(t_list, new_tl);
}
{
newresno = (Resdom *) copyObject((Node *) old_tle->resdom);
newresno->resno = length(t_list) + 1;
- newresno->resjunk = 1;
+ newresno->resjunk = true;
new_tl = makeTargetEntry(newresno, old_tle->expr);
t_list = lappend(t_list, new_tl);
}
attname,
0,
(Oid) 0,
- 0),
+ false),
(Node *) temp2);
t_list = lappend(t_list, temp3);
break;
attname,
0,
(Oid) 0,
- 0),
+ false),
(Node *) temp_var);
t_list = lappend(t_list, temp_list);
break;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/util/tlist.c,v 1.30 1999/05/12 15:01:44 wieck Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/tlist.c,v 1.31 1999/05/17 17:03:23 momjian Exp $
*
*-------------------------------------------------------------------------
*/
NULL,
(Index) 0,
(Oid) 0,
- 0),
+ false),
(Node *) var);
}
NULL,
(Index) 0,
(Oid) 0,
- 0);
+ false);
last_resdomno++;
new_tlist = lappend(new_tlist, makeTargetEntry(r, (Node *) var));
}
NULL,
(Index) 0,
(Oid) 0,
- 0);
+ false);
last_resdomno++;
tlist = lappend(tlist, makeTargetEntry(r, (Node *) var));
}
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: analyze.c,v 1.105 1999/05/17 04:50:07 tgl Exp $
+ * $Id: analyze.c,v 1.106 1999/05/17 17:03:27 momjian Exp $
*
*-------------------------------------------------------------------------
*/
att[defval[ndef].adnum - 1]->atttypid,
att[defval[ndef].adnum - 1]->atttypmod,
pstrdup(nameout(&(att[defval[ndef].adnum - 1]->attname))),
- 0, 0, 0),
+ 0, 0, false),
(Node *) stringToNode(defval[ndef].adbin));
qry->targetList = lappend(qry->targetList, te);
}
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.32 1999/05/13 14:59:05 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.33 1999/05/17 17:03:32 momjian Exp $
*
*-------------------------------------------------------------------------
*/
case T_Attr:
target_result = MakeTargetEntryIdent(pstate, node,
&((Attr *) node)->relname, NULL,
- ((Attr *) node)->relname, TRUE);
+ ((Attr *) node)->relname, true);
lappend(tlist, target_result);
break;
case T_Ident:
target_result = MakeTargetEntryIdent(pstate, node,
&((Ident *) node)->name, NULL,
- ((Ident *) node)->name, TRUE);
+ ((Ident *) node)->name, true);
lappend(tlist, target_result);
break;
case T_FuncCall:
case T_A_Expr:
- target_result = MakeTargetEntryExpr(pstate, "resjunk", expr, FALSE, TRUE);
+ target_result = MakeTargetEntryExpr(pstate, "resjunk", expr, false, true);
lappend(tlist, target_result);
break;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.43 1999/05/10 00:45:27 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.44 1999/05/17 17:03:33 momjian Exp $
*
*-------------------------------------------------------------------------
*/
get_attname(relid, attno),
0,
(Oid) 0,
- 0);
+ false);
varnode = makeVar(-1, attno, typeid, type_mod, 0, -1, attno);
tle = makeTargetEntry(resnode, (Node *) varnode);
"<noname>",
0,
(Oid) 0,
- 0);
+ false);
varnode = makeVar(-1, 1, typeid, -1, 0, -1, 1);
tle = makeTargetEntry(resnode, (Node *) varnode);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/parse_relation.c,v 1.19 1999/02/23 07:53:01 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/parse_relation.c,v 1.20 1999/05/17 17:03:34 momjian Exp $
*
*-------------------------------------------------------------------------
*/
attrname,
(Index) 0,
(Oid) 0,
- 0);
+ false);
te->expr = (Node *) varnode;
if (te_head == NIL)
te_head = te_tail = lcons(te, NIL);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.36 1999/05/17 04:19:33 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.37 1999/05/17 17:03:35 momjian Exp $
*
*-------------------------------------------------------------------------
*/
char **resname,
char *refname,
char *colname,
- int16 resjunk)
+ bool resjunk)
{
Node *expr = NULL;
Oid attrtype_target;
{
expr = coerce_type(pstate, node, attrtype_id, attrtype_target);
expr = transformExpr(pstate, expr, EXPR_COLUMN_FIRST);
- tent = MakeTargetEntryExpr(pstate, *resname, expr, FALSE, FALSE);
+ tent = MakeTargetEntryExpr(pstate, *resname, expr, false, false);
expr = tent->expr;
}
else
char *colname,
Node *expr,
List *arrayRef,
- int16 resjunk)
+ bool resjunk)
{
Oid type_id,
attrtype;
res->name,
(Index) 0,
(Oid) 0,
- 0);
+ false);
tent = makeNode(TargetEntry);
tent->resdom = resnode;
constval->val.str = save_str;
return MakeTargetEntryExpr(pstate, res->name,
(Node *) make_const(constval),
- NULL, FALSE);
+ NULL, false);
pfree(save_str);
}
else
}
res->name = colname;
return MakeTargetEntryExpr(pstate, res->name, expr,
- res->indirection, FALSE);
+ res->indirection, false);
}
}
resname,
(Index) 0,
(Oid) 0,
- 0);
+ false);
tent = makeNode(TargetEntry);
tent->resdom = resnode;
tent->expr = result;
char *identname;
identname = ((Ident *) res->val)->name;
- tent = MakeTargetEntryIdent(pstate, (Node *) res->val, &res->name, NULL, identname, FALSE);
+ tent = MakeTargetEntryIdent(pstate,
+ (Node *) res->val, &res->name, NULL, identname, false);
break;
}
case T_ParamNo:
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteHandler.c,v 1.41 1999/05/13 07:28:41 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteHandler.c,v 1.42 1999/05/17 17:03:38 momjian Exp $
*
*-------------------------------------------------------------------------
*/
resdom->resname = pstrdup("<noname>");
resdom->reskey = 0;
resdom->reskeyop = 0;
- resdom->resjunk = 0;
+ resdom->resjunk = false;
tle->resdom = resdom;
tle->expr = (Node *)aggref;
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: makefuncs.h,v 1.16 1999/02/13 23:21:38 momjian Exp $
+ * $Id: makefuncs.h,v 1.17 1999/05/17 17:03:42 momjian Exp $
*
*-------------------------------------------------------------------------
*/
char *resname,
Index reskey,
Oid reskeyop,
- int resjunk);
+ bool resjunk);
extern Const *makeConst(Oid consttype,
int constlen,
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: primnodes.h,v 1.26 1999/05/12 15:02:07 wieck Exp $
+ * $Id: primnodes.h,v 1.27 1999/05/17 17:03:44 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* reskey - order of key in a sort (for those > 0)
* reskeyop - sort operator Oid
* resgroupref - set to nonzero if referenced from a group by clause
- * resjunk - set to nonzero to eliminate the attribute
- * from final target list e.g., ctid for replace
- * and delete
+ * resjunk - set to true to eliminate the attribute
+ * from final target list
*
* ----------------
*/
Index reskey;
Oid reskeyop;
Index resgroupref;
- int resjunk;
+ bool resjunk;
} Resdom;
/* -------------
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: parse_target.h,v 1.11 1998/09/01 04:37:39 momjian Exp $
+ * $Id: parse_target.h,v 1.12 1999/05/17 17:03:46 momjian Exp $
*
*-------------------------------------------------------------------------
*/
char **resname,
char *refname,
char *colname,
- int16 resjunk);
+ bool resjunk);
extern Node *CoerceTargetExpr(ParseState *pstate, Node *expr,
Oid type_id, Oid attrtype);
TargetEntry *MakeTargetEntryExpr(ParseState *pstate,
char *colname,
Node *expr,
List *arrayRef,
- int16 resjunk);
+ bool resjunk);
#endif /* PARSE_TARGET_H */
.\" This is -*-nroff-*-
.\" XXX standard disclaimer belongs here....
-.\" $Header: /cvsroot/pgsql/src/man/Attic/explain.l,v 1.11 1999/04/23 21:23:49 momjian Exp $
+.\" $Header: /cvsroot/pgsql/src/man/Attic/explain.l,v 1.12 1999/05/17 17:03:51 momjian Exp $
.TH EXPLAIN SQL 06/12/97 PostgreSQL PostgreSQL
.SH NAME
explain - explains statement execution details
{AGG :cost 0 :size 0 :width 0 :state <> :qptargetlist
({TLE :resdom {RESDOM :resno 1 :restype 700 :restypmod 4 :resname "sum"
- :reskey 0 :reskeyop 0 :resjunk 0}
+ :reskey 0 :reskeyop 0 :resjunk false}
:expr {AGGREG :aggname "sum" :basetype 700 :aggtype 700 :aggno 0
:target {VAR :varno 1 :varattno 1 :vartype 700 :varnoold 1 :varoattno 1}}})
:qpqual <> :lefttree {SEQSCAN :cost 0 :size 0 :width 4 :state <>
:qptargetlist ({TLE :resdom {RESDOM :resno 1 :restype 700 :restypmod 4
- :resname "null" :reskey 0 :reskeyop 0 :resjunk 0}
+ :resname "null" :reskey 0 :reskeyop 0 :resjunk false}
:expr {VAR :varno 1 :varattno 1 :vartype 700 :varnoold 1 :varoattno 1}})
:qpqual <> :lefttree <> :righttree <> :scanrelid 1} :righttree <> :numagg 1 }