aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/cache
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>1998-09-01 04:40:42 +0000
committerBruce Momjian <bruce@momjian.us>1998-09-01 04:40:42 +0000
commitfa1a8d6a97068295fe30ac646aec7493a6305bc2 (patch)
tree645f7cef3c78fbab4d6d7bbc7c9a61ad2893d273 /src/backend/utils/cache
parentaf74855a608da4cd7ef88ceb2241ec1c75537f39 (diff)
downloadpostgresql-fa1a8d6a97068295fe30ac646aec7493a6305bc2.tar.gz
postgresql-fa1a8d6a97068295fe30ac646aec7493a6305bc2.zip
OK, folks, here is the pgindent output.
Diffstat (limited to 'src/backend/utils/cache')
-rw-r--r--src/backend/utils/cache/catcache.c8
-rw-r--r--src/backend/utils/cache/fcache.c7
-rw-r--r--src/backend/utils/cache/inval.c25
-rw-r--r--src/backend/utils/cache/lsyscache.c8
-rw-r--r--src/backend/utils/cache/relcache.c54
-rw-r--r--src/backend/utils/cache/syscache.c28
6 files changed, 63 insertions, 67 deletions
diff --git a/src/backend/utils/cache/catcache.c b/src/backend/utils/cache/catcache.c
index ebc263d8a2c..d54d2584ae8 100644
--- a/src/backend/utils/cache/catcache.c
+++ b/src/backend/utils/cache/catcache.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.33 1998/09/01 03:26:25 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.34 1998/09/01 04:32:57 momjian Exp $
*
* Notes:
* XXX This needs to use exception.h to handle recovery when
@@ -102,7 +102,7 @@ do { \
elog(DEBUG, "CatalogCacheInitializeCache: called w/relname %s", \
cache->cc_relname) \
} while(0)
-
+
#define CatalogCacheInitializeCache_DEBUG2 \
do { \
if (cache->cc_key[i] > 0) { \
@@ -665,7 +665,7 @@ do { \
cp->cc_skey[i].sk_argument); \
} \
} while(0)
-
+
#else
#define InitSysCache_DEBUG1
#endif
@@ -894,7 +894,7 @@ SearchSysCache(struct catcache * cache,
CACHE3_elog(DEBUG, "SearchSysCache(%s): found in bucket %d",
RelationGetRelationName(relation), hash);
heap_close(relation);
-#endif /* CACHEDEBUG */
+#endif /* CACHEDEBUG */
return ct->ct_tup;
}
diff --git a/src/backend/utils/cache/fcache.c b/src/backend/utils/cache/fcache.c
index 8933c664412..8ebef95a2d8 100644
--- a/src/backend/utils/cache/fcache.c
+++ b/src/backend/utils/cache/fcache.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/fcache.c,v 1.17 1998/09/01 03:26:27 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/fcache.c,v 1.18 1998/09/01 04:32:58 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -36,8 +36,7 @@
#endif
static Oid GetDynamicFuncArgType(Var *arg, ExprContext *econtext);
-static FunctionCachePtr
-init_fcache(Oid foid,
+static FunctionCachePtr init_fcache(Oid foid,
bool use_syscache,
List *argList,
ExprContext *econtext);
@@ -126,7 +125,7 @@ init_fcache(Oid foid,
* ----------------
*/
typeTuple = SearchSysCacheTuple(TYPOID,
- ObjectIdGetDatum(procedureStruct->prorettype),
+ ObjectIdGetDatum(procedureStruct->prorettype),
0, 0, 0);
if (!HeapTupleIsValid(typeTuple))
diff --git a/src/backend/utils/cache/inval.c b/src/backend/utils/cache/inval.c
index 631fc2a18c9..d21540776de 100644
--- a/src/backend/utils/cache/inval.c
+++ b/src/backend/utils/cache/inval.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/inval.c,v 1.15 1998/09/01 03:26:29 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/inval.c,v 1.16 1998/09/01 04:33:00 momjian Exp $
*
* Note - this code is real crufty...
*
@@ -33,8 +33,7 @@
static InvalidationEntry InvalidationEntryAllocate(uint16 size);
static void LocalInvalidInvalidate(LocalInvalid invalid, void (*function) ());
-static LocalInvalid
-LocalInvalidRegister(LocalInvalid invalid,
+static LocalInvalid LocalInvalidRegister(LocalInvalid invalid,
InvalidationEntry entry);
static void getmyrelids(void);
@@ -166,7 +165,7 @@ elog(DEBUG, "CacheIdRegisterLocalInvalid(%d, %d, [%d, %d])", \
ItemPointerGetOffsetNumber(pointer))
#else
#define CacheIdRegisterLocalInvalid_DEBUG1
-#endif /* INVALIDDEBUG */
+#endif /* INVALIDDEBUG */
static void
CacheIdRegisterLocalInvalid(Index cacheId,
@@ -218,7 +217,7 @@ RelationIdRegisterLocalInvalid(Oid relationId, Oid objectId)
#ifdef INVALIDDEBUG
elog(DEBUG, "RelationRegisterLocalInvalid(%d, %d)", relationId,
objectId);
-#endif /* defined(INVALIDDEBUG) */
+#endif /* defined(INVALIDDEBUG) */
/* ----------------
* create a message describing the relation descriptor
@@ -267,7 +266,7 @@ getmyrelids()
MyAMRelationId = tuple->t_oid;
tuple = SearchSysCacheTuple(RELNAME,
- PointerGetDatum(AccessMethodOperatorRelationName),
+ PointerGetDatum(AccessMethodOperatorRelationName),
0, 0, 0);
Assert(HeapTupleIsValid(tuple));
MyAMOPRelationId = tuple->t_oid;
@@ -287,7 +286,7 @@ elog(DEBUG, "CacheIdInvalidate(%d, %d, 0x%x[%d])", cacheId, hashIndex,\
pointer, ItemPointerIsValid(pointer))
#else
#define CacheIdInvalidate_DEBUG1
-#endif /* defined(INVALIDDEBUG) */
+#endif /* defined(INVALIDDEBUG) */
static void
CacheIdInvalidate(Index cacheId,
@@ -380,7 +379,7 @@ elog(DEBUG,\
#else
#define InvalidationMessageRegisterSharedInvalid_DEBUG1
#define InvalidationMessageRegisterSharedInvalid_DEBUG2
-#endif /* INVALIDDEBUG */
+#endif /* INVALIDDEBUG */
static void
InvalidationMessageRegisterSharedInvalid(InvalidationMessage message)
@@ -430,7 +429,7 @@ elog(DEBUG, "InvalidationMessageCacheInvalidate(c, %d, %d, [%d, %d])",\
#else
#define InvalidationMessageCacheInvalidate_DEBUG1
#define InvalidationMessageCacheInvalidate_DEBUG2
-#endif /* defined(INVALIDDEBUG) */
+#endif /* defined(INVALIDDEBUG) */
static void
InvalidationMessageCacheInvalidate(InvalidationMessage message)
@@ -536,7 +535,7 @@ DiscardInvalid()
*/
#ifdef INVALIDDEBUG
elog(DEBUG, "DiscardInvalid called");
-#endif /* defined(INVALIDDEBUG) */
+#endif /* defined(INVALIDDEBUG) */
InvalidateSharedInvalid(CacheIdInvalidate, ResetSystemCaches);
}
@@ -557,7 +556,7 @@ RegisterInvalid(bool send)
*/
#ifdef INVALIDDEBUG
elog(DEBUG, "RegisterInvalid(%d) called", send);
-#endif /* defined(INVALIDDEBUG) */
+#endif /* defined(INVALIDDEBUG) */
/* ----------------
* Note: Invalid is a global variable
@@ -582,7 +581,7 @@ SetRefreshWhenInvalidate(bool on)
{
#ifdef INVALIDDEBUG
elog(DEBUG, "RefreshWhenInvalidate(%d) called", on);
-#endif /* defined(INVALIDDEBUG) */
+#endif /* defined(INVALIDDEBUG) */
RefreshWhenInvalidate = on;
}
@@ -603,7 +602,7 @@ elog(DEBUG, "RelationInvalidateHeapTuple(%s, [%d,%d])", \
ItemPointerGetOffsetNumber(&tuple->t_ctid))
#else
#define RelationInvalidateHeapTuple_DEBUG1
-#endif /* defined(INVALIDDEBUG) */
+#endif /* defined(INVALIDDEBUG) */
void
RelationInvalidateHeapTuple(Relation relation, HeapTuple tuple)
diff --git a/src/backend/utils/cache/lsyscache.c b/src/backend/utils/cache/lsyscache.c
index 7189f16c6e3..e804f5aa1cb 100644
--- a/src/backend/utils/cache/lsyscache.c
+++ b/src/backend/utils/cache/lsyscache.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.21 1998/09/01 03:26:30 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.22 1998/09/01 04:33:01 momjian Exp $
*
* NOTES
* Eventually, the index information should go through here, too.
@@ -136,9 +136,9 @@ get_attisset(Oid relid, char *attname)
attno = get_attnum(relid, attname);
tuple = SearchSysCacheTuple(ATTNAME,
- ObjectIdGetDatum(relid),
- PointerGetDatum(attname),
- 0, 0);
+ ObjectIdGetDatum(relid),
+ PointerGetDatum(attname),
+ 0, 0);
if (!HeapTupleIsValid(tuple))
elog(ERROR, "get_attisset: no attribute %s in relation %d",
attname, relid);
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c
index 078f532c959..ba4acc9fa23 100644
--- a/src/backend/utils/cache/relcache.c
+++ b/src/backend/utils/cache/relcache.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.49 1998/09/01 03:26:32 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.50 1998/09/01 04:33:02 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -81,8 +81,7 @@
#include "utils/syscache.h"
-static void
-RelationFlushRelation(Relation *relationPtr,
+static void RelationFlushRelation(Relation *relationPtr,
bool onlyFlushReferenceCountZero);
static Relation RelationNameCacheGetRelation(char *relationName);
static void init_irels(void);
@@ -195,7 +194,7 @@ do { \
RELATION = NULL; \
} while(0)
-#define RelationIdCacheLookup(ID, RELATION) \
+#define RelationIdCacheLookup(ID, RELATION) \
do { \
RelIdCacheEnt *hentry; \
bool found; \
@@ -233,8 +232,7 @@ do { \
} while(0)
/* non-export function prototypes */
-static void
-formrdesc(char *relationName, u_int natts,
+static void formrdesc(char *relationName, u_int natts,
FormData_pg_attribute *att);
#if 0 /* See comments at line 1304 */
@@ -246,14 +244,11 @@ static HeapTuple ScanPgRelation(RelationBuildDescInfo buildinfo);
static HeapTuple scan_pg_rel_seq(RelationBuildDescInfo buildinfo);
static HeapTuple scan_pg_rel_ind(RelationBuildDescInfo buildinfo);
static Relation AllocateRelationDesc(u_int natts, Form_pg_class relp);
-static void
-RelationBuildTupleDesc(RelationBuildDescInfo buildinfo,
+static void RelationBuildTupleDesc(RelationBuildDescInfo buildinfo,
Relation relation, u_int natts);
-static void
-build_tupdesc_seq(RelationBuildDescInfo buildinfo,
+static void build_tupdesc_seq(RelationBuildDescInfo buildinfo,
Relation relation, u_int natts);
-static void
-build_tupdesc_ind(RelationBuildDescInfo buildinfo,
+static void build_tupdesc_ind(RelationBuildDescInfo buildinfo,
Relation relation, u_int natts);
static Relation RelationBuildDesc(RelationBuildDescInfo buildinfo);
static void IndexedAccessMethodInitialize(Relation relation);
@@ -596,11 +591,11 @@ build_tupdesc_ind(RelationBuildDescInfo buildinfo,
for (i = 1; i <= relation->rd_rel->relnatts; i++)
{
atttup = (HeapTuple) AttributeNumIndexScan(attrel,
- RelationGetRelid(relation), i);
+ RelationGetRelid(relation), i);
if (!HeapTupleIsValid(atttup))
elog(ERROR, "cannot find attribute %d of relation %s", i,
- relation->rd_rel->relname.data);
+ relation->rd_rel->relname.data);
attp = (Form_pg_attribute) GETSTRUCT(atttup);
relation->rd_att->attrs[i - 1] =
@@ -714,7 +709,7 @@ RelationBuildRuleLock(Relation relation)
* add attribute data to relation->rd_att
* ----------------
*/
- while (HeapTupleIsValid(pg_rewrite_tuple=heap_getnext(pg_rewrite_scan, 0)))
+ while (HeapTupleIsValid(pg_rewrite_tuple = heap_getnext(pg_rewrite_scan, 0)))
{
bool isnull;
Datum ruleaction;
@@ -1094,7 +1089,7 @@ formrdesc(char *relationName,
RelationCacheInsert(relation);
RelationInitLockInfo(relation);
-
+
/*
* Determining this requires a scan on pg_class, but to do the scan
* the rdesc for pg_class must already exist. Therefore we must do
@@ -1689,8 +1684,8 @@ AttrDefaultFetch(Relation relation)
for (found = 0;;)
{
- Buffer buffer;
-
+ Buffer buffer;
+
indexRes = index_getnext(sd, ForwardScanDirection);
if (!indexRes)
break;
@@ -1708,29 +1703,29 @@ AttrDefaultFetch(Relation relation)
continue;
if (attrdef[i].adsrc != NULL)
elog(ERROR, "AttrDefaultFetch: second record found for attr %s in rel %s",
- relation->rd_att->attrs[adform->adnum - 1]->attname.data,
- relation->rd_rel->relname.data);
+ relation->rd_att->attrs[adform->adnum - 1]->attname.data,
+ relation->rd_rel->relname.data);
val = (struct varlena *) fastgetattr(tuple,
Anum_pg_attrdef_adbin,
adrel->rd_att, &isnull);
if (isnull)
elog(ERROR, "AttrDefaultFetch: adbin IS NULL for attr %s in rel %s",
- relation->rd_att->attrs[adform->adnum - 1]->attname.data,
- relation->rd_rel->relname.data);
+ relation->rd_att->attrs[adform->adnum - 1]->attname.data,
+ relation->rd_rel->relname.data);
attrdef[i].adbin = textout(val);
val = (struct varlena *) fastgetattr(tuple,
Anum_pg_attrdef_adsrc,
adrel->rd_att, &isnull);
if (isnull)
elog(ERROR, "AttrDefaultFetch: adsrc IS NULL for attr %s in rel %s",
- relation->rd_att->attrs[adform->adnum - 1]->attname.data,
- relation->rd_rel->relname.data);
+ relation->rd_att->attrs[adform->adnum - 1]->attname.data,
+ relation->rd_rel->relname.data);
attrdef[i].adsrc = textout(val);
break;
}
ReleaseBuffer(buffer);
-
+
if (i >= ndef)
elog(ERROR, "AttrDefaultFetch: unexpected record found for attr %d in rel %s",
adform->adnum,
@@ -1777,8 +1772,8 @@ RelCheckFetch(Relation relation)
for (found = 0;;)
{
- Buffer buffer;
-
+ Buffer buffer;
+
indexRes = index_getnext(sd, ForwardScanDirection);
if (!indexRes)
break;
@@ -1790,7 +1785,7 @@ RelCheckFetch(Relation relation)
continue;
if (found == ncheck)
elog(ERROR, "RelCheckFetch: unexpected record found for rel %s",
- relation->rd_rel->relname.data);
+ relation->rd_rel->relname.data);
rcname = (Name) fastgetattr(tuple,
Anum_pg_relcheck_rcname,
@@ -1982,7 +1977,8 @@ init_irels(void)
#define SMD(i) strat[0].strategyMapData[i].entry[0]
/* have to reinit the function pointers in the strategy maps */
- for (i = 0; i < am->amstrategies * relform->relnatts; i++) {
+ for (i = 0; i < am->amstrategies * relform->relnatts; i++)
+ {
fmgr_info(SMD(i).sk_procedure,
&(SMD(i).sk_func));
SMD(i).sk_nargs = SMD(i).sk_func.fn_nargs;
diff --git a/src/backend/utils/cache/syscache.c b/src/backend/utils/cache/syscache.c
index cebbe28ac1b..25b3e0a4309 100644
--- a/src/backend/utils/cache/syscache.c
+++ b/src/backend/utils/cache/syscache.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.21 1998/09/01 03:26:33 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.22 1998/09/01 04:33:03 momjian Exp $
*
* NOTES
* These routines allow the parser/planner/executor to perform
@@ -205,7 +205,7 @@ static struct cachedesc cacheinfo[] = {
0,
0
},
- offsetof(FormData_pg_type, typalign) +sizeof(char),
+ offsetof(FormData_pg_type, typalign) + sizeof(char),
TypeNameIndex,
TypeNameIndexScan},
{TypeRelationName, /* TYPOID */
@@ -241,7 +241,7 @@ static struct cachedesc cacheinfo[] = {
sizeof(FormData_pg_opclass),
NULL,
NULL},
- {IndexRelationName, /* INDRELIDKEY */ /* never used */
+ {IndexRelationName, /* INDRELIDKEY *//* never used */
2,
{
Anum_pg_index_indrelid,
@@ -438,6 +438,7 @@ InitCatalogCache()
}
}
}
+
/*
* SearchSysCacheTupleCopy--
*
@@ -445,11 +446,11 @@ InitCatalogCache()
* that the user is required to pfree().
*/
HeapTuple
-SearchSysCacheTupleCopy(int cacheId,/* cache selection code */
- Datum key1,
- Datum key2,
- Datum key3,
- Datum key4)
+SearchSysCacheTupleCopy(int cacheId, /* cache selection code */
+ Datum key1,
+ Datum key2,
+ Datum key3,
+ Datum key4)
{
HeapTuple cachetup;
@@ -457,9 +458,9 @@ SearchSysCacheTupleCopy(int cacheId,/* cache selection code */
if (PointerIsValid(cachetup))
return heap_copytuple(cachetup);
else
- return cachetup; /* NULL */
+ return cachetup; /* NULL */
}
-
+
/*
* SearchSysCacheTuple--
@@ -588,7 +589,7 @@ SearchSysCacheGetAttribute(int cacheId,
elog(DEBUG,
"SearchSysCacheGetAttribute: Lookup in %s(%d) failed",
cacheName, cacheId);
-#endif /* defined(CACHEDEBUG) */
+#endif /* defined(CACHEDEBUG) */
return NULL;
}
@@ -623,6 +624,7 @@ SearchSysCacheGetAttribute(int cacheId,
if (isNull)
{
+
/*
* Used to be an elog(DEBUG, ...) here and a claim that it should
* be a FATAL error, I don't think either is warranted -mer 6/9/92
@@ -681,7 +683,7 @@ TypeDefaultRetrieve(Oid typId)
#ifdef CACHEDEBUG
elog(DEBUG, "TypeDefaultRetrieve: Lookup in %s(%d) failed",
cacheinfo[TYPOID].name, TYPOID);
-#endif /* defined(CACHEDEBUG) */
+#endif /* defined(CACHEDEBUG) */
return NULL;
}
@@ -700,7 +702,7 @@ TypeDefaultRetrieve(Oid typId)
#ifdef CACHEDEBUG
elog(DEBUG, "TypeDefaultRetrieve: No extractable typdefault in %s(%d)",
cacheinfo[TYPOID].name, TYPOID);
-#endif /* defined(CACHEDEBUG) */
+#endif /* defined(CACHEDEBUG) */
return NULL;
}