summaryrefslogtreecommitdiff
path: root/src/backend/utils/cache
diff options
context:
space:
mode:
authorBruce Momjian2009-06-11 14:49:15 +0000
committerBruce Momjian2009-06-11 14:49:15 +0000
commitd7471402794266078953f1bd113dab4913d631a1 (patch)
tree618e392a84eaf837e00bf78f8694097b78fec227 /src/backend/utils/cache
parent4e86efb4e51b66ef57b3fe6f28576de23a1bf1c6 (diff)
8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list
provided by Andrew.
Diffstat (limited to 'src/backend/utils/cache')
-rw-r--r--src/backend/utils/cache/catcache.c12
-rw-r--r--src/backend/utils/cache/inval.c20
-rw-r--r--src/backend/utils/cache/lsyscache.c4
-rw-r--r--src/backend/utils/cache/plancache.c20
-rw-r--r--src/backend/utils/cache/relcache.c19
-rw-r--r--src/backend/utils/cache/syscache.c14
6 files changed, 51 insertions, 38 deletions
diff --git a/src/backend/utils/cache/catcache.c b/src/backend/utils/cache/catcache.c
index a29c5c91aa9..6fd672435fe 100644
--- a/src/backend/utils/cache/catcache.c
+++ b/src/backend/utils/cache/catcache.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/cache/catcache.c,v 1.146 2009/01/01 17:23:50 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/cache/catcache.c,v 1.147 2009/06/11 14:49:05 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -104,30 +104,37 @@ GetCCHashEqFuncs(Oid keytype, PGFunction *hashfunc, RegProcedure *eqfunc)
{
case BOOLOID:
*hashfunc = hashchar;
+
*eqfunc = F_BOOLEQ;
break;
case CHAROID:
*hashfunc = hashchar;
+
*eqfunc = F_CHAREQ;
break;
case NAMEOID:
*hashfunc = hashname;
+
*eqfunc = F_NAMEEQ;
break;
case INT2OID:
*hashfunc = hashint2;
+
*eqfunc = F_INT2EQ;
break;
case INT2VECTOROID:
*hashfunc = hashint2vector;
+
*eqfunc = F_INT2VECTOREQ;
break;
case INT4OID:
*hashfunc = hashint4;
+
*eqfunc = F_INT4EQ;
break;
case TEXTOID:
*hashfunc = hashtext;
+
*eqfunc = F_TEXTEQ;
break;
case OIDOID:
@@ -140,15 +147,18 @@ GetCCHashEqFuncs(Oid keytype, PGFunction *hashfunc, RegProcedure *eqfunc)
case REGCONFIGOID:
case REGDICTIONARYOID:
*hashfunc = hashoid;
+
*eqfunc = F_OIDEQ;
break;
case OIDVECTOROID:
*hashfunc = hashoidvector;
+
*eqfunc = F_OIDVECTOREQ;
break;
default:
elog(FATAL, "type %u not supported as catcache key", keytype);
*hashfunc = NULL; /* keep compiler quiet */
+
*eqfunc = InvalidOid;
break;
}
diff --git a/src/backend/utils/cache/inval.c b/src/backend/utils/cache/inval.c
index 398eb39dc58..5fac924207d 100644
--- a/src/backend/utils/cache/inval.c
+++ b/src/backend/utils/cache/inval.c
@@ -80,7 +80,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/cache/inval.c,v 1.88 2009/01/01 17:23:50 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/cache/inval.c,v 1.89 2009/06/11 14:49:05 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -403,7 +403,7 @@ ProcessInvalidationMessages(InvalidationListHeader *hdr,
*/
static void
ProcessInvalidationMessagesMulti(InvalidationListHeader *hdr,
- void (*func) (const SharedInvalidationMessage *msgs, int n))
+ void (*func) (const SharedInvalidationMessage *msgs, int n))
{
ProcessMessageListMulti(hdr->cclist, func(msgs, n));
ProcessMessageListMulti(hdr->rclist, func(msgs, n));
@@ -442,9 +442,9 @@ RegisterRelcacheInvalidation(Oid dbId, Oid relId)
/*
* Most of the time, relcache invalidation is associated with system
- * catalog updates, but there are a few cases where it isn't. Quick
- * hack to ensure that the next CommandCounterIncrement() will think
- * that we need to do CommandEndInvalidationMessages().
+ * catalog updates, but there are a few cases where it isn't. Quick hack
+ * to ensure that the next CommandCounterIncrement() will think that we
+ * need to do CommandEndInvalidationMessages().
*/
(void) GetCurrentCommandId(true);
@@ -1015,7 +1015,7 @@ CommandEndInvalidationMessages(void)
* Prepare for invalidation messages for nontransactional updates.
*
* A nontransactional invalidation is one that must be sent whether or not
- * the current transaction eventually commits. We arrange for all invals
+ * the current transaction eventually commits. We arrange for all invals
* queued between this call and EndNonTransactionalInvalidation() to be sent
* immediately when the latter is called.
*
@@ -1069,10 +1069,10 @@ EndNonTransactionalInvalidation(void)
Assert(transInvalInfo->PriorCmdInvalidMsgs.rclist == NULL);
/*
- * At present, this function is only used for CTID-changing updates;
- * since the relcache init file doesn't store any tuple CTIDs, we
- * don't have to invalidate it. That might not be true forever
- * though, in which case we'd need code similar to AtEOXact_Inval.
+ * At present, this function is only used for CTID-changing updates; since
+ * the relcache init file doesn't store any tuple CTIDs, we don't have to
+ * invalidate it. That might not be true forever though, in which case
+ * we'd need code similar to AtEOXact_Inval.
*/
/* Send out the invals */
diff --git a/src/backend/utils/cache/lsyscache.c b/src/backend/utils/cache/lsyscache.c
index b3ec6ad3410..8247516bd14 100644
--- a/src/backend/utils/cache/lsyscache.c
+++ b/src/backend/utils/cache/lsyscache.c
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/cache/lsyscache.c,v 1.161 2009/01/01 17:23:50 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/cache/lsyscache.c,v 1.162 2009/06/11 14:49:05 momjian Exp $
*
* NOTES
* Eventually, the index information should go through here, too.
@@ -239,6 +239,7 @@ get_compare_function_for_ordering_op(Oid opno, Oid *cmpfunc, bool *reverse)
opcintype,
opcintype,
BTORDER_PROC);
+
if (!OidIsValid(*cmpfunc)) /* should not happen */
elog(ERROR, "missing support function %d(%u,%u) in opfamily %u",
BTORDER_PROC, opcintype, opcintype, opfamily);
@@ -248,6 +249,7 @@ get_compare_function_for_ordering_op(Oid opno, Oid *cmpfunc, bool *reverse)
/* ensure outputs are set on failure */
*cmpfunc = InvalidOid;
+
*reverse = false;
return false;
}
diff --git a/src/backend/utils/cache/plancache.c b/src/backend/utils/cache/plancache.c
index 6c0f90f1adb..437b7d1114e 100644
--- a/src/backend/utils/cache/plancache.c
+++ b/src/backend/utils/cache/plancache.c
@@ -12,7 +12,7 @@
*
* The plan cache manager itself is principally responsible for tracking
* whether cached plans should be invalidated because of schema changes in
- * the objects they depend on. When (and if) the next demand for a cached
+ * the objects they depend on. When (and if) the next demand for a cached
* plan occurs, the query will be replanned. Note that this could result
* in an error, for example if a column referenced by the query is no
* longer present. The creator of a cached plan can specify whether it
@@ -21,7 +21,7 @@
* caller to notice changes and cope with them.
*
* Currently, we track exactly the dependencies of plans on relations and
- * user-defined functions. On relcache invalidation events or pg_proc
+ * user-defined functions. On relcache invalidation events or pg_proc
* syscache invalidation events, we invalidate just those plans that depend
* on the particular object being modified. (Note: this scheme assumes
* that any table modification that requires replanning will generate a
@@ -35,7 +35,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/cache/plancache.c,v 1.26 2009/01/01 17:23:50 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/cache/plancache.c,v 1.27 2009/06/11 14:49:05 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -120,7 +120,7 @@ CreateCachedPlan(Node *raw_parse_tree,
MemoryContext source_context;
MemoryContext oldcxt;
- Assert(query_string != NULL); /* required as of 8.4 */
+ Assert(query_string != NULL); /* required as of 8.4 */
/*
* Make a dedicated memory context for the CachedPlanSource and its
@@ -220,7 +220,7 @@ FastCreateCachedPlan(Node *raw_parse_tree,
OverrideSearchPath *search_path;
MemoryContext oldcxt;
- Assert(query_string != NULL); /* required as of 8.4 */
+ Assert(query_string != NULL); /* required as of 8.4 */
/*
* Fetch current search_path into given context, but do any recalculation
@@ -475,8 +475,8 @@ RevalidateCachedPlan(CachedPlanSource *plansource, bool useResOwner)
/*
* If a snapshot is already set (the normal case), we can just use
- * that for parsing/planning. But if it isn't, install one. Note:
- * no point in checking whether parse analysis requires a snapshot;
+ * that for parsing/planning. But if it isn't, install one. Note: no
+ * point in checking whether parse analysis requires a snapshot;
* utility commands don't have invalidatable plans, so we'd not get
* here for such a command.
*/
@@ -609,8 +609,8 @@ CachedPlanIsValid(CachedPlanSource *plansource)
Assert(plan->refcount > 0);
/*
- * Although we don't want to acquire locks here, it still seems
- * useful to check for expiration of a transient plan.
+ * Although we don't want to acquire locks here, it still seems useful
+ * to check for expiration of a transient plan.
*/
if (TransactionIdIsValid(plan->saved_xmin) &&
!TransactionIdEquals(plan->saved_xmin, TransactionXmin))
@@ -990,7 +990,7 @@ PlanCacheFuncCallback(Datum arg, int cacheid, ItemPointer tuplePtr)
{
/* Invalidate the plan! */
plan->dead = true;
- break; /* out of invalItems scan */
+ break; /* out of invalItems scan */
}
}
if (plan->dead)
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c
index ae6fcea7e67..775865d5696 100644
--- a/src/backend/utils/cache/relcache.c
+++ b/src/backend/utils/cache/relcache.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.286 2009/03/31 22:12:48 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.287 2009/06/11 14:49:05 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1129,7 +1129,7 @@ IndexSupportInitialize(oidvector *indclass,
* Note there is no provision for flushing the cache. This is OK at the
* moment because there is no way to ALTER any interesting properties of an
* existing opclass --- all you can do is drop it, which will result in
- * a useless but harmless dead entry in the cache. To support altering
+ * a useless but harmless dead entry in the cache. To support altering
* opclass membership (not the same as opfamily membership!), we'd need to
* be able to flush this cache as well as the contents of relcache entries
* for indexes.
@@ -1196,10 +1196,10 @@ LookupOpclassInfo(Oid operatorClassOid,
/*
* When testing for cache-flush hazards, we intentionally disable the
- * operator class cache and force reloading of the info on each call.
- * This is helpful because we want to test the case where a cache flush
- * occurs while we are loading the info, and it's very hard to provoke
- * that if this happens only once per opclass per backend.
+ * operator class cache and force reloading of the info on each call. This
+ * is helpful because we want to test the case where a cache flush occurs
+ * while we are loading the info, and it's very hard to provoke that if
+ * this happens only once per opclass per backend.
*/
#if defined(CLOBBER_CACHE_ALWAYS)
opcentry->valid = false;
@@ -1402,8 +1402,8 @@ formrdesc(const char *relationName, Oid relationReltype,
relation->rd_rel->relisshared = false;
/*
- * Likewise, we must know if a relation is temp ... but formrdesc is
- * not used for any temp relations.
+ * Likewise, we must know if a relation is temp ... but formrdesc is not
+ * used for any temp relations.
*/
relation->rd_rel->relistemp = false;
@@ -1657,6 +1657,7 @@ RelationReloadIndexInfo(Relation relation)
heap_freetuple(pg_class_tuple);
/* We must recalculate physical address in case it changed */
RelationInitPhysicalAddr(relation);
+
/*
* Must reset targblock, fsm_nblocks and vm_nblocks in case rel was
* truncated
@@ -2792,7 +2793,7 @@ AttrDefaultFetch(Relation relation)
RelationGetRelationName(relation));
else
attrdef[i].adbin = MemoryContextStrdup(CacheMemoryContext,
- TextDatumGetCString(val));
+ TextDatumGetCString(val));
break;
}
diff --git a/src/backend/utils/cache/syscache.c b/src/backend/utils/cache/syscache.c
index 4de61e7f94e..922c4a626f7 100644
--- a/src/backend/utils/cache/syscache.c
+++ b/src/backend/utils/cache/syscache.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/cache/syscache.c,v 1.119 2009/01/01 17:23:50 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/cache/syscache.c,v 1.120 2009/06/11 14:49:05 momjian Exp $
*
* NOTES
* These routines allow the parser/planner/executor to perform
@@ -368,7 +368,7 @@ static const struct cachedesc cacheinfo[] = {
},
256
},
- {ForeignDataWrapperRelationId, /* FOREIGNDATAWRAPPERNAME */
+ {ForeignDataWrapperRelationId, /* FOREIGNDATAWRAPPERNAME */
ForeignDataWrapperNameIndexId,
0,
1,
@@ -380,7 +380,7 @@ static const struct cachedesc cacheinfo[] = {
},
8
},
- {ForeignDataWrapperRelationId, /* FOREIGNDATAWRAPPEROID */
+ {ForeignDataWrapperRelationId, /* FOREIGNDATAWRAPPEROID */
ForeignDataWrapperOidIndexId,
0,
1,
@@ -392,7 +392,7 @@ static const struct cachedesc cacheinfo[] = {
},
8
},
- {ForeignServerRelationId, /* FOREIGNSERVERNAME */
+ {ForeignServerRelationId, /* FOREIGNSERVERNAME */
ForeignServerNameIndexId,
0,
1,
@@ -404,7 +404,7 @@ static const struct cachedesc cacheinfo[] = {
},
32
},
- {ForeignServerRelationId, /* FOREIGNSERVEROID */
+ {ForeignServerRelationId, /* FOREIGNSERVEROID */
ForeignServerOidIndexId,
0,
1,
@@ -728,7 +728,7 @@ static const struct cachedesc cacheinfo[] = {
},
1024
},
- {UserMappingRelationId, /* USERMAPPINGOID */
+ {UserMappingRelationId, /* USERMAPPINGOID */
UserMappingOidIndexId,
0,
1,
@@ -740,7 +740,7 @@ static const struct cachedesc cacheinfo[] = {
},
128
},
- {UserMappingRelationId, /* USERMAPPINGUSERSERVER */
+ {UserMappingRelationId, /* USERMAPPINGUSERSERVER */
UserMappingUserServerIndexId,
0,
2,