Skip to content

Commit 585c967

Browse files
committed
Change resjunk to a boolean.
1 parent fd16477 commit 585c967

File tree

17 files changed

+63
-63
lines changed

17 files changed

+63
-63
lines changed

src/backend/executor/execJunk.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/executor/execJunk.c,v 1.16 1999/02/13 23:15:16 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/executor/execJunk.c,v 1.17 1999/05/17 17:03:10 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -36,7 +36,7 @@
3636
*
3737
* The general idea is the following: A target list consists of a list of
3838
* Resdom nodes & expression pairs. Each Resdom node has an attribute
39-
* called 'resjunk'. If the value of this attribute is 1 then the
39+
* called 'resjunk'. If the value of this attribute is true then the
4040
* corresponding attribute is a "junk" attribute.
4141
*
4242
* When we initialize a plan we call 'ExecInitJunkFilter' to create
@@ -73,15 +73,15 @@ ExecInitJunkFilter(List *targetList)
7373
TargetEntry *tle;
7474
Resdom *resdom,
7575
*cleanResdom;
76-
int resjunk;
76+
bool resjunk;
7777
AttrNumber cleanResno;
7878
AttrNumber *cleanMap;
7979
Size size;
8080
Node *expr;
8181

8282
/* ---------------------
8383
* First find the "clean" target list, i.e. all the entries
84-
* in the original target list which have a zero 'resjunk'
84+
* in the original target list which have a false 'resjunk'
8585
* NOTE: make copy of the Resdom nodes, because we have
8686
* to change the 'resno's...
8787
* ---------------------
@@ -98,7 +98,7 @@ ExecInitJunkFilter(List *targetList)
9898
resdom = rtarget->resdom;
9999
expr = rtarget->expr;
100100
resjunk = resdom->resjunk;
101-
if (resjunk == 0)
101+
if (!resjunk)
102102
{
103103

104104
/*
@@ -194,7 +194,7 @@ ExecInitJunkFilter(List *targetList)
194194
resdom = tle->resdom;
195195
expr = tle->expr;
196196
resjunk = resdom->resjunk;
197-
if (resjunk == 0)
197+
if (!resjunk)
198198
{
199199
cleanMap[cleanResno - 1] = resdom->resno;
200200
cleanResno++;
@@ -271,7 +271,7 @@ ExecGetJunkAttribute(JunkFilter *junkfilter,
271271
Resdom *resdom;
272272
AttrNumber resno;
273273
char *resname;
274-
int resjunk;
274+
bool resjunk;
275275
TupleDesc tupType;
276276
HeapTuple tuple;
277277

@@ -290,7 +290,7 @@ ExecGetJunkAttribute(JunkFilter *junkfilter,
290290
resdom = tle->resdom;
291291
resname = resdom->resname;
292292
resjunk = resdom->resjunk;
293-
if (resjunk != 0 && (strcmp(resname, attrName) == 0))
293+
if (resjunk && (strcmp(resname, attrName) == 0))
294294
{
295295
/* We found it ! */
296296
resno = resdom->resno;

src/backend/nodes/makefuncs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/nodes/makefuncs.c,v 1.14 1999/05/12 15:01:34 wieck Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/nodes/makefuncs.c,v 1.15 1999/05/17 17:03:12 momjian Exp $
1111
*
1212
* NOTES
1313
* Creator functions in POSTGRES 4.2 are generated automatically. Most of
@@ -97,7 +97,7 @@ makeResdom(AttrNumber resno,
9797
char *resname,
9898
Index reskey,
9999
Oid reskeyop,
100-
int resjunk)
100+
bool resjunk)
101101
{
102102
Resdom *resdom = makeNode(Resdom);
103103

src/backend/nodes/outfuncs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Copyright (c) 1994, Regents of the University of California
77
*
8-
* $Id: outfuncs.c,v 1.81 1999/05/12 15:01:34 wieck Exp $
8+
* $Id: outfuncs.c,v 1.82 1999/05/17 17:03:13 momjian Exp $
99
*
1010
* NOTES
1111
* Every (plan) node in POSTGRES has an associated "out" routine which
@@ -565,9 +565,9 @@ _outResdom(StringInfo str, Resdom *node)
565565
node->reskey,
566566
node->reskeyop);
567567

568-
appendStringInfo(str, " :resgroupref %d :resjunk %d",
568+
appendStringInfo(str, " :resgroupref %d :resjunk %s ",
569569
node->resgroupref,
570-
node->resjunk);
570+
node->resjunk ? "true" : "false");
571571
}
572572

573573
static void

src/backend/nodes/readfuncs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.61 1999/05/12 15:01:35 wieck Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.62 1999/05/17 17:03:14 momjian Exp $
1111
*
1212
* NOTES
1313
* Most of the read functions for plan nodes are tested. (In fact, they
@@ -751,7 +751,7 @@ _readResdom()
751751

752752
token = lsptok(NULL, &length); /* eat :resjunk */
753753
token = lsptok(NULL, &length); /* get resjunk */
754-
local_node->resjunk = atoi(token);
754+
local_node->resjunk = (token[0] == 't') ? true : false;
755755

756756
return local_node;
757757
}

src/backend/optimizer/plan/planner.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.52 1999/05/13 07:28:32 tgl Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.53 1999/05/17 17:03:15 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -168,7 +168,7 @@ union_planner(Query *parse)
168168
resname,
169169
0,
170170
0,
171-
1);
171+
true);
172172

173173
var = makeVar(rowmark->rti, -1, TIDOID,
174174
-1, 0, rowmark->rti, -1);

src/backend/optimizer/prep/preptlist.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/preptlist.c,v 1.19 1999/05/12 15:01:41 wieck Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/preptlist.c,v 1.20 1999/05/17 17:03:18 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -106,7 +106,7 @@ preprocess_targetlist(List *tlist,
106106
"ctid",
107107
0,
108108
0,
109-
1);
109+
true);
110110

111111
var = makeVar(result_relation, -1, TIDOID, -1, 0, result_relation, -1);
112112

@@ -211,7 +211,7 @@ replace_matching_resname(List *new_tlist, List *old_tlist)
211211
* locks.
212212
*
213213
* So, copy all these entries to the end of the target list and set their
214-
* 'resjunk' value to 1 to show that these are special attributes and
214+
* 'resjunk' value to true to show that these are special attributes and
215215
* have to be treated specially by the executor!
216216
*/
217217
foreach(temp, old_tlist)
@@ -225,7 +225,7 @@ replace_matching_resname(List *new_tlist, List *old_tlist)
225225
{
226226
newresno = (Resdom *) copyObject((Node *) old_tle->resdom);
227227
newresno->resno = length(t_list) + 1;
228-
newresno->resjunk = 1;
228+
newresno->resjunk = true;
229229
new_tl = makeTargetEntry(newresno, old_tle->expr);
230230
t_list = lappend(t_list, new_tl);
231231
}
@@ -267,7 +267,7 @@ replace_matching_resname(List *new_tlist, List *old_tlist)
267267
{
268268
newresno = (Resdom *) copyObject((Node *) old_tle->resdom);
269269
newresno->resno = length(t_list) + 1;
270-
newresno->resjunk = 1;
270+
newresno->resjunk = true;
271271
new_tl = makeTargetEntry(newresno, old_tle->expr);
272272
t_list = lappend(t_list, new_tl);
273273
}
@@ -338,7 +338,7 @@ new_relation_targetlist(Oid relid, Index rt_index, NodeTag node_type)
338338
attname,
339339
0,
340340
(Oid) 0,
341-
0),
341+
false),
342342
(Node *) temp2);
343343
t_list = lappend(t_list, temp3);
344344
break;
@@ -358,7 +358,7 @@ new_relation_targetlist(Oid relid, Index rt_index, NodeTag node_type)
358358
attname,
359359
0,
360360
(Oid) 0,
361-
0),
361+
false),
362362
(Node *) temp_var);
363363
t_list = lappend(t_list, temp_list);
364364
break;

src/backend/optimizer/util/tlist.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/tlist.c,v 1.30 1999/05/12 15:01:44 wieck Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/tlist.c,v 1.31 1999/05/17 17:03:23 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -138,7 +138,7 @@ create_tl_element(Var *var, int resdomno)
138138
NULL,
139139
(Index) 0,
140140
(Oid) 0,
141-
0),
141+
false),
142142
(Node *) var);
143143
}
144144

@@ -379,7 +379,7 @@ flatten_tlist(List *tlist)
379379
NULL,
380380
(Index) 0,
381381
(Oid) 0,
382-
0);
382+
false);
383383
last_resdomno++;
384384
new_tlist = lappend(new_tlist, makeTargetEntry(r, (Node *) var));
385385
}
@@ -573,7 +573,7 @@ AddGroupAttrToTlist(List *tlist, List *grpCl)
573573
NULL,
574574
(Index) 0,
575575
(Oid) 0,
576-
0);
576+
false);
577577
last_resdomno++;
578578
tlist = lappend(tlist, makeTargetEntry(r, (Node *) var));
579579
}

src/backend/parser/analyze.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Copyright (c) 1994, Regents of the University of California
77
*
8-
* $Id: analyze.c,v 1.105 1999/05/17 04:50:07 tgl Exp $
8+
* $Id: analyze.c,v 1.106 1999/05/17 17:03:27 momjian Exp $
99
*
1010
*-------------------------------------------------------------------------
1111
*/
@@ -338,7 +338,7 @@ transformInsertStmt(ParseState *pstate, InsertStmt *stmt)
338338
att[defval[ndef].adnum - 1]->atttypid,
339339
att[defval[ndef].adnum - 1]->atttypmod,
340340
pstrdup(nameout(&(att[defval[ndef].adnum - 1]->attname))),
341-
0, 0, 0),
341+
0, 0, false),
342342
(Node *) stringToNode(defval[ndef].adbin));
343343
qry->targetList = lappend(qry->targetList, te);
344344
}

src/backend/parser/parse_clause.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.32 1999/05/13 14:59:05 thomas Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.33 1999/05/17 17:03:32 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -495,14 +495,14 @@ findTargetlistEntry(ParseState *pstate, Node *node, List *tlist, int clause)
495495
case T_Attr:
496496
target_result = MakeTargetEntryIdent(pstate, node,
497497
&((Attr *) node)->relname, NULL,
498-
((Attr *) node)->relname, TRUE);
498+
((Attr *) node)->relname, true);
499499
lappend(tlist, target_result);
500500
break;
501501

502502
case T_Ident:
503503
target_result = MakeTargetEntryIdent(pstate, node,
504504
&((Ident *) node)->name, NULL,
505-
((Ident *) node)->name, TRUE);
505+
((Ident *) node)->name, true);
506506
lappend(tlist, target_result);
507507
break;
508508

@@ -517,7 +517,7 @@ findTargetlistEntry(ParseState *pstate, Node *node, List *tlist, int clause)
517517

518518
case T_FuncCall:
519519
case T_A_Expr:
520-
target_result = MakeTargetEntryExpr(pstate, "resjunk", expr, FALSE, TRUE);
520+
target_result = MakeTargetEntryExpr(pstate, "resjunk", expr, false, true);
521521
lappend(tlist, target_result);
522522
break;
523523

src/backend/parser/parse_func.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.43 1999/05/10 00:45:27 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.44 1999/05/17 17:03:33 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -1352,7 +1352,7 @@ setup_tlist(char *attname, Oid relid)
13521352
get_attname(relid, attno),
13531353
0,
13541354
(Oid) 0,
1355-
0);
1355+
false);
13561356
varnode = makeVar(-1, attno, typeid, type_mod, 0, -1, attno);
13571357

13581358
tle = makeTargetEntry(resnode, (Node *) varnode);
@@ -1377,7 +1377,7 @@ setup_base_tlist(Oid typeid)
13771377
"<noname>",
13781378
0,
13791379
(Oid) 0,
1380-
0);
1380+
false);
13811381
varnode = makeVar(-1, 1, typeid, -1, 0, -1, 1);
13821382
tle = makeTargetEntry(resnode, (Node *) varnode);
13831383

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy