aboutsummaryrefslogtreecommitdiff
path: root/src/backend/optimizer
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2003-02-09 06:56:28 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2003-02-09 06:56:28 +0000
commit39b7ec330923b5a2746720101fbd83c1dd418aea (patch)
tree42cce57b7c823f65091b5e10c434a494716e0f82 /src/backend/optimizer
parent3646ab58b435e53dabd863d11b052e03220bb964 (diff)
downloadpostgresql-39b7ec330923b5a2746720101fbd83c1dd418aea.tar.gz
postgresql-39b7ec330923b5a2746720101fbd83c1dd418aea.zip
Create a distinction between Lists of integers and Lists of OIDs, to get
rid of the assumption that sizeof(Oid)==sizeof(int). This is one small step towards someday supporting 8-byte OIDs. For the moment, it doesn't do much except get rid of a lot of unsightly casts.
Diffstat (limited to 'src/backend/optimizer')
-rw-r--r--src/backend/optimizer/plan/createplan.c4
-rw-r--r--src/backend/optimizer/plan/subselect.c6
-rw-r--r--src/backend/optimizer/prep/prepunion.c28
-rw-r--r--src/backend/optimizer/util/clauses.c12
-rw-r--r--src/backend/optimizer/util/plancat.c8
5 files changed, 29 insertions, 29 deletions
diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c
index 8bb651ae5cc..87cfb1d8525 100644
--- a/src/backend/optimizer/plan/createplan.c
+++ b/src/backend/optimizer/plan/createplan.c
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.135 2003/02/08 20:20:54 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.136 2003/02/09 06:56:27 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -658,7 +658,7 @@ create_indexscan_plan(Query *root,
{
IndexOptInfo *index = (IndexOptInfo *) lfirst(ixinfo);
- indexids = lappendi(indexids, index->indexoid);
+ indexids = lappendo(indexids, index->indexoid);
}
/*
diff --git a/src/backend/optimizer/plan/subselect.c b/src/backend/optimizer/plan/subselect.c
index d28a6674764..fc428977c33 100644
--- a/src/backend/optimizer/plan/subselect.c
+++ b/src/backend/optimizer/plan/subselect.c
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/subselect.c,v 1.71 2003/02/09 00:30:39 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/subselect.c,v 1.72 2003/02/09 06:56:27 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -458,7 +458,7 @@ convert_sublink_opers(List *lefthand, List *operOids,
foreach(lst, operOids)
{
- Oid opid = (Oid) lfirsti(lst);
+ Oid opid = lfirsto(lst);
Node *leftop = lfirst(lefthand);
TargetEntry *te = lfirst(targetlist);
Node *rightop;
@@ -577,7 +577,7 @@ subplan_is_hashable(SubLink *slink, SubPlan *node)
*/
foreach(opids, slink->operOids)
{
- Oid opid = (Oid) lfirsti(opids);
+ Oid opid = lfirsto(opids);
HeapTuple tup;
Form_pg_operator optup;
diff --git a/src/backend/optimizer/prep/prepunion.c b/src/backend/optimizer/prep/prepunion.c
index 2ee7ede1834..0f63d2306c7 100644
--- a/src/backend/optimizer/prep/prepunion.c
+++ b/src/backend/optimizer/prep/prepunion.c
@@ -14,7 +14,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.89 2003/02/08 20:20:55 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.90 2003/02/09 06:56:27 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -111,7 +111,7 @@ plan_set_operations(Query *parse)
* recurse_set_operations
* Recursively handle one step in a tree of set operations
*
- * colTypes: integer list of type OIDs of expected output columns
+ * colTypes: list of type OIDs of expected output columns
* junkOK: if true, child resjunk columns may be left in the result
* flag: if >= 0, add a resjunk output column indicating value of flag
* refnames_tlist: targetlist to take column names from
@@ -330,7 +330,7 @@ recurse_union_children(Node *setOp, Query *parse,
if (op->op == top_union->op &&
(op->all == top_union->all || op->all) &&
- equali(op->colTypes, top_union->colTypes))
+ equalo(op->colTypes, top_union->colTypes))
{
/* Same UNION, so fold children into parent's subplan list */
return nconc(recurse_union_children(op->larg, parse,
@@ -380,7 +380,7 @@ generate_setop_tlist(List *colTypes, int flag,
foreach(i, colTypes)
{
- Oid colType = (Oid) lfirsti(i);
+ Oid colType = lfirsto(i);
TargetEntry *inputtle = (TargetEntry *) lfirst(input_tlist);
TargetEntry *reftle = (TargetEntry *) lfirst(refnames_tlist);
int32 colTypmod;
@@ -500,7 +500,7 @@ generate_append_tlist(List *colTypes, bool flag,
if (subtle->resdom->resjunk)
continue;
Assert(curColType != NIL);
- if (subtle->resdom->restype == (Oid) lfirsti(curColType))
+ if (subtle->resdom->restype == lfirsto(curColType))
{
/* If first subplan, copy the typmod; else compare */
if (planl == input_plans)
@@ -525,7 +525,7 @@ generate_append_tlist(List *colTypes, bool flag,
colindex = 0;
foreach(curColType, colTypes)
{
- Oid colType = (Oid) lfirsti(curColType);
+ Oid colType = lfirsto(curColType);
int32 colTypmod = colTypmods[colindex++];
TargetEntry *reftle = (TargetEntry *) lfirst(refnames_tlist);
@@ -591,7 +591,7 @@ tlist_same_datatypes(List *tlist, List *colTypes, bool junkOK)
{
if (colTypes == NIL)
return false;
- if (tle->resdom->restype != (Oid) lfirsti(colTypes))
+ if (tle->resdom->restype != lfirsto(colTypes))
return false;
colTypes = lnext(colTypes);
}
@@ -604,14 +604,14 @@ tlist_same_datatypes(List *tlist, List *colTypes, bool junkOK)
/*
* find_all_inheritors -
- * Returns an integer list of relation OIDs including the given rel plus
+ * Returns a list of relation OIDs including the given rel plus
* all relations that inherit from it, directly or indirectly.
*/
List *
find_all_inheritors(Oid parentrel)
{
List *examined_relids = NIL;
- List *unexamined_relids = makeListi1(parentrel);
+ List *unexamined_relids = makeListo1(parentrel);
/*
* While the queue of unexamined relids is nonempty, remove the first
@@ -620,11 +620,11 @@ find_all_inheritors(Oid parentrel)
*/
while (unexamined_relids != NIL)
{
- Oid currentrel = lfirsti(unexamined_relids);
+ Oid currentrel = lfirsto(unexamined_relids);
List *currentchildren;
unexamined_relids = lnext(unexamined_relids);
- examined_relids = lappendi(examined_relids, currentrel);
+ examined_relids = lappendo(examined_relids, currentrel);
currentchildren = find_inheritance_children(currentrel);
/*
@@ -634,8 +634,8 @@ find_all_inheritors(Oid parentrel)
* into an infinite loop, though theoretically there can't be any
* cycles in the inheritance graph anyway.)
*/
- currentchildren = set_differencei(currentchildren, examined_relids);
- unexamined_relids = set_unioni(unexamined_relids, currentchildren);
+ currentchildren = set_differenceo(currentchildren, examined_relids);
+ unexamined_relids = set_uniono(unexamined_relids, currentchildren);
}
return examined_relids;
@@ -702,7 +702,7 @@ expand_inherted_rtentry(Query *parse, Index rti, bool dup_parent)
foreach(l, inhOIDs)
{
- Oid childOID = (Oid) lfirsti(l);
+ Oid childOID = lfirsto(l);
RangeTblEntry *childrte;
Index childRTindex;
diff --git a/src/backend/optimizer/util/clauses.c b/src/backend/optimizer/util/clauses.c
index bd5706b5e21..71b5909d207 100644
--- a/src/backend/optimizer/util/clauses.c
+++ b/src/backend/optimizer/util/clauses.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.128 2003/02/08 20:20:55 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.129 2003/02/09 06:56:27 tgl Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -566,7 +566,7 @@ contain_mutable_functions_walker(Node *node, void *context)
foreach(opid, sublink->operOids)
{
- if (op_volatile((Oid) lfirsti(opid)) != PROVOLATILE_IMMUTABLE)
+ if (op_volatile(lfirsto(opid)) != PROVOLATILE_IMMUTABLE)
return true;
}
/* else fall through to check args */
@@ -633,7 +633,7 @@ contain_volatile_functions_walker(Node *node, void *context)
foreach(opid, sublink->operOids)
{
- if (op_volatile((Oid) lfirsti(opid)) == PROVOLATILE_VOLATILE)
+ if (op_volatile(lfirsto(opid)) == PROVOLATILE_VOLATILE)
return true;
}
/* else fall through to check args */
@@ -718,7 +718,7 @@ contain_nonstrict_functions_walker(Node *node, void *context)
foreach(opid, sublink->operOids)
{
- if (!op_strict((Oid) lfirsti(opid)))
+ if (!op_strict(lfirsto(opid)))
return true;
}
/* else fall through to check args */
@@ -1679,7 +1679,7 @@ inline_function(Oid funcid, List *args, HeapTuple func_tuple,
return NULL;
/* Check for recursive function, and give up trying to expand if so */
- if (intMember(funcid, active_fns))
+ if (oidMember(funcid, active_fns))
return NULL;
/* Check permission to call function (fail later, if not) */
@@ -1824,7 +1824,7 @@ inline_function(Oid funcid, List *args, HeapTuple func_tuple,
* add the current function to the context list of active functions.
*/
newexpr = eval_const_expressions_mutator(newexpr,
- lconsi(funcid, active_fns));
+ lconso(funcid, active_fns));
return (Expr *) newexpr;
diff --git a/src/backend/optimizer/util/plancat.c b/src/backend/optimizer/util/plancat.c
index 1f62a45648a..029ddae189c 100644
--- a/src/backend/optimizer/util/plancat.c
+++ b/src/backend/optimizer/util/plancat.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/util/plancat.c,v 1.78 2003/02/08 20:20:55 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/plancat.c,v 1.79 2003/02/09 06:56:27 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -98,7 +98,7 @@ get_relation_info(Oid relationObjectId, RelOptInfo *rel)
foreach(indexoidscan, indexoidlist)
{
- Oid indexoid = lfirsti(indexoidscan);
+ Oid indexoid = lfirsto(indexoidscan);
Relation indexRelation;
Form_pg_index index;
IndexOptInfo *info;
@@ -270,7 +270,7 @@ join_selectivity(Query *root,
/*
* find_inheritance_children
*
- * Returns an integer list containing the OIDs of all relations which
+ * Returns a list containing the OIDs of all relations which
* inherit *directly* from the relation with OID 'inhparent'.
*
* XXX might be a good idea to create an index on pg_inherits' inhparent
@@ -305,7 +305,7 @@ find_inheritance_children(Oid inhparent)
while ((inheritsTuple = heap_getnext(scan, ForwardScanDirection)) != NULL)
{
inhrelid = ((Form_pg_inherits) GETSTRUCT(inheritsTuple))->inhrelid;
- list = lappendi(list, inhrelid);
+ list = lappendo(list, inhrelid);
}
heap_endscan(scan);
heap_close(relation, AccessShareLock);