mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +03:00
pgindent run over code.
This commit is contained in:
5
src/backend/utils/cache/catcache.c
vendored
5
src/backend/utils/cache/catcache.c
vendored
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.40 1999/05/10 00:46:03 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.41 1999/05/25 16:12:22 momjian Exp $
|
||||
*
|
||||
* Notes:
|
||||
* XXX This needs to use exception.h to handle recovery when
|
||||
@ -196,6 +196,7 @@ CatalogCacheInitializeCache(struct catcache * cache,
|
||||
|
||||
if (cache->cc_key[i] > 0)
|
||||
{
|
||||
|
||||
/*
|
||||
* Yoiks. The implementation of the hashing code and the
|
||||
* implementation of int28's are at loggerheads. The right
|
||||
@ -277,7 +278,7 @@ CatalogCacheSetId(CatCache *cacheInOutP, int id)
|
||||
#endif
|
||||
|
||||
/* ----------------
|
||||
* comphash
|
||||
* comphash
|
||||
* Compute a hash value, somehow.
|
||||
*
|
||||
* XXX explain algorithm here.
|
||||
|
12
src/backend/utils/cache/inval.c
vendored
12
src/backend/utils/cache/inval.c
vendored
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/inval.c,v 1.22 1999/05/10 00:46:07 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/inval.c,v 1.23 1999/05/25 16:12:23 momjian Exp $
|
||||
*
|
||||
* Note - this code is real crufty...
|
||||
*
|
||||
@ -106,7 +106,7 @@ InvalidationEntryAllocate(uint16 size)
|
||||
}
|
||||
|
||||
/* --------------------------------
|
||||
* LocalInvalidRegister
|
||||
* LocalInvalidRegister
|
||||
* Returns a new local cache invalidation state containing a new entry.
|
||||
* --------------------------------
|
||||
*/
|
||||
@ -117,7 +117,7 @@ LocalInvalidRegister(LocalInvalid invalid,
|
||||
Assert(PointerIsValid(entry));
|
||||
|
||||
((InvalidationUserData *) entry)->dataP[-1] =
|
||||
(InvalidationUserData *) invalid;
|
||||
(InvalidationUserData *) invalid;
|
||||
|
||||
return entry;
|
||||
}
|
||||
@ -504,7 +504,7 @@ InitLocalInvalidateData()
|
||||
|
||||
|
||||
/*
|
||||
* DiscardInvalid
|
||||
* DiscardInvalid
|
||||
* Causes the invalidated cache state to be discarded.
|
||||
*
|
||||
* Note:
|
||||
@ -527,7 +527,7 @@ DiscardInvalid()
|
||||
}
|
||||
|
||||
/*
|
||||
* RegisterInvalid
|
||||
* RegisterInvalid
|
||||
* Causes registration of invalidated state with other backends iff true.
|
||||
*
|
||||
* Note:
|
||||
@ -559,7 +559,7 @@ RegisterInvalid(bool send)
|
||||
}
|
||||
|
||||
/*
|
||||
* RelationIdInvalidateHeapTuple
|
||||
* RelationIdInvalidateHeapTuple
|
||||
* Causes the given tuple in a relation to be invalidated.
|
||||
*
|
||||
* Note:
|
||||
|
6
src/backend/utils/cache/rel.c
vendored
6
src/backend/utils/cache/rel.c
vendored
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/rel.c,v 1.4 1999/02/13 23:19:43 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/rel.c,v 1.5 1999/05/25 16:12:23 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -29,7 +29,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* RelationGetIndexStrategy
|
||||
* RelationGetIndexStrategy
|
||||
* Returns index strategy for a relation.
|
||||
*
|
||||
* Note:
|
||||
@ -43,7 +43,7 @@ RelationGetIndexStrategy(Relation relation)
|
||||
}
|
||||
|
||||
/*
|
||||
* RelationSetIndexSupport
|
||||
* RelationSetIndexSupport
|
||||
* Sets index strategy and support info for a relation.
|
||||
*
|
||||
* Note:
|
||||
|
39
src/backend/utils/cache/relcache.c
vendored
39
src/backend/utils/cache/relcache.c
vendored
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.61 1999/05/10 00:46:08 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.62 1999/05/25 16:12:23 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -396,7 +396,7 @@ scan_pg_rel_ind(RelationBuildDescInfo buildinfo)
|
||||
switch (buildinfo.infotype)
|
||||
{
|
||||
case INFO_RELID:
|
||||
return_tuple = ClassOidIndexScan(pg_class_desc,buildinfo.i.info_id);
|
||||
return_tuple = ClassOidIndexScan(pg_class_desc, buildinfo.i.info_id);
|
||||
break;
|
||||
|
||||
case INFO_RELNAME:
|
||||
@ -707,20 +707,20 @@ RelationBuildRuleLock(Relation relation)
|
||||
|
||||
rule->event = (int) heap_getattr(pg_rewrite_tuple,
|
||||
Anum_pg_rewrite_ev_type, pg_rewrite_tupdesc,
|
||||
&isnull) - 48;
|
||||
&isnull) - 48;
|
||||
rule->attrno = (int) heap_getattr(pg_rewrite_tuple,
|
||||
Anum_pg_rewrite_ev_attr, pg_rewrite_tupdesc,
|
||||
&isnull);
|
||||
&isnull);
|
||||
rule->isInstead = !!heap_getattr(pg_rewrite_tuple,
|
||||
Anum_pg_rewrite_is_instead, pg_rewrite_tupdesc,
|
||||
&isnull);
|
||||
Anum_pg_rewrite_is_instead, pg_rewrite_tupdesc,
|
||||
&isnull);
|
||||
|
||||
ruleaction = heap_getattr(pg_rewrite_tuple,
|
||||
Anum_pg_rewrite_ev_action, pg_rewrite_tupdesc,
|
||||
&isnull);
|
||||
Anum_pg_rewrite_ev_action, pg_rewrite_tupdesc,
|
||||
&isnull);
|
||||
rule_evqual_string = heap_getattr(pg_rewrite_tuple,
|
||||
Anum_pg_rewrite_ev_qual, pg_rewrite_tupdesc,
|
||||
&isnull);
|
||||
Anum_pg_rewrite_ev_qual, pg_rewrite_tupdesc,
|
||||
&isnull);
|
||||
|
||||
ruleaction = PointerGetDatum(textout((struct varlena *) DatumGetPointer(ruleaction)));
|
||||
rule_evqual_string = PointerGetDatum(textout((struct varlena *) DatumGetPointer(rule_evqual_string)));
|
||||
@ -851,9 +851,7 @@ RelationBuildDesc(RelationBuildDescInfo buildinfo)
|
||||
* ----------------
|
||||
*/
|
||||
if (OidIsValid(relam))
|
||||
{
|
||||
relation->rd_am = (Form_pg_am) AccessMethodObjectIdGetForm(relam);
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
* initialize the tuple descriptor (relation->rd_att).
|
||||
@ -1331,13 +1329,13 @@ RelationForgetRelation(Oid rid)
|
||||
MemoryContext oldcxt;
|
||||
List *curr;
|
||||
List *prev = NIL;
|
||||
|
||||
|
||||
oldcxt = MemoryContextSwitchTo((MemoryContext) CacheCxt);
|
||||
|
||||
|
||||
foreach(curr, newlyCreatedRelns)
|
||||
{
|
||||
Relation reln = lfirst(curr);
|
||||
|
||||
|
||||
Assert(reln != NULL && reln->rd_myxactonly);
|
||||
if (RelationGetRelid(reln) == rid)
|
||||
break;
|
||||
@ -1353,7 +1351,7 @@ RelationForgetRelation(Oid rid)
|
||||
pfree(curr);
|
||||
MemoryContextSwitchTo(oldcxt);
|
||||
}
|
||||
|
||||
|
||||
RelationFlushRelation(&relation, false);
|
||||
}
|
||||
}
|
||||
@ -1378,6 +1376,7 @@ RelationIdInvalidateRelationCacheByRelationId(Oid relationId)
|
||||
*/
|
||||
if (PointerIsValid(relation) && !relation->rd_myxactonly)
|
||||
{
|
||||
|
||||
/*
|
||||
* The boolean onlyFlushReferenceCountZero in RelationFlushReln()
|
||||
* should be set to true when we are incrementing the command
|
||||
@ -1484,8 +1483,8 @@ RelationRegisterRelation(Relation relation)
|
||||
|
||||
/*
|
||||
* we've just created the relation. It is invisible to anyone else
|
||||
* before the transaction is committed. Setting rd_myxactonly allows us
|
||||
* to use the local buffer manager for select/insert/etc before the
|
||||
* before the transaction is committed. Setting rd_myxactonly allows
|
||||
* us to use the local buffer manager for select/insert/etc before the
|
||||
* end of transaction. (We also need to keep track of relations
|
||||
* created during a transaction and does the necessary clean up at the
|
||||
* end of the transaction.) - ay 3/95
|
||||
@ -1634,7 +1633,7 @@ AttrDefaultFetch(Relation relation)
|
||||
Relation adrel;
|
||||
Relation irel;
|
||||
ScanKeyData skey;
|
||||
HeapTupleData tuple;
|
||||
HeapTupleData tuple;
|
||||
Form_pg_attrdef adform;
|
||||
IndexScanDesc sd;
|
||||
RetrieveIndexResult indexRes;
|
||||
@ -1722,7 +1721,7 @@ RelCheckFetch(Relation relation)
|
||||
Relation rcrel;
|
||||
Relation irel;
|
||||
ScanKeyData skey;
|
||||
HeapTupleData tuple;
|
||||
HeapTupleData tuple;
|
||||
IndexScanDesc sd;
|
||||
RetrieveIndexResult indexRes;
|
||||
Name rcname;
|
||||
|
22
src/backend/utils/cache/syscache.c
vendored
22
src/backend/utils/cache/syscache.c
vendored
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.24 1999/02/13 23:19:45 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.25 1999/05/25 16:12:23 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* These routines allow the parser/planner/executor to perform
|
||||
@ -421,11 +421,11 @@ InitCatalogCache()
|
||||
Assert(!PointerIsValid((Pointer) SysCache[cacheId]));
|
||||
|
||||
SysCache[cacheId] = InitSysCache(cacheinfo[cacheId].name,
|
||||
cacheinfo[cacheId].indname,
|
||||
cacheId,
|
||||
cacheinfo[cacheId].nkeys,
|
||||
cacheinfo[cacheId].key,
|
||||
cacheinfo[cacheId].iScanFunc);
|
||||
cacheinfo[cacheId].indname,
|
||||
cacheId,
|
||||
cacheinfo[cacheId].nkeys,
|
||||
cacheinfo[cacheId].key,
|
||||
cacheinfo[cacheId].iScanFunc);
|
||||
if (!PointerIsValid((char *) SysCache[cacheId]))
|
||||
{
|
||||
elog(ERROR,
|
||||
@ -492,11 +492,11 @@ SearchSysCacheTuple(int cacheId,/* cache selection code */
|
||||
if (!PointerIsValid(SysCache[cacheId]))
|
||||
{
|
||||
SysCache[cacheId] = InitSysCache(cacheinfo[cacheId].name,
|
||||
cacheinfo[cacheId].indname,
|
||||
cacheId,
|
||||
cacheinfo[cacheId].nkeys,
|
||||
cacheinfo[cacheId].key,
|
||||
cacheinfo[cacheId].iScanFunc);
|
||||
cacheinfo[cacheId].indname,
|
||||
cacheId,
|
||||
cacheinfo[cacheId].nkeys,
|
||||
cacheinfo[cacheId].key,
|
||||
cacheinfo[cacheId].iScanFunc);
|
||||
if (!PointerIsValid(SysCache[cacheId]))
|
||||
elog(ERROR,
|
||||
"InitCatalogCache: Can't init cache %s(%d)",
|
||||
|
34
src/backend/utils/cache/temprel.c
vendored
34
src/backend/utils/cache/temprel.c
vendored
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/temprel.c,v 1.2 1999/02/13 23:19:45 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/temprel.c,v 1.3 1999/05/25 16:12:24 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -47,16 +47,16 @@ static List *temp_rels = NIL;
|
||||
|
||||
typedef struct TempTable
|
||||
{
|
||||
char *user_relname;
|
||||
char *user_relname;
|
||||
HeapTuple pg_class_tuple;
|
||||
} TempTable;
|
||||
} TempTable;
|
||||
|
||||
|
||||
void
|
||||
create_temp_relation(char *relname, HeapTuple pg_class_tuple)
|
||||
{
|
||||
MemoryContext oldcxt;
|
||||
TempTable *temp_rel;
|
||||
TempTable *temp_rel;
|
||||
|
||||
oldcxt = MemoryContextSwitchTo((MemoryContext) CacheCxt);
|
||||
|
||||
@ -65,7 +65,7 @@ create_temp_relation(char *relname, HeapTuple pg_class_tuple)
|
||||
|
||||
/* save user-supplied name */
|
||||
strcpy(temp_rel->user_relname, relname);
|
||||
|
||||
|
||||
temp_rel->pg_class_tuple = heap_copytuple(pg_class_tuple);
|
||||
|
||||
temp_rels = lcons(temp_rel, temp_rels);
|
||||
@ -76,24 +76,25 @@ create_temp_relation(char *relname, HeapTuple pg_class_tuple)
|
||||
void
|
||||
remove_all_temp_relations(void)
|
||||
{
|
||||
List *l, *next;
|
||||
List *l,
|
||||
*next;
|
||||
|
||||
l = temp_rels;
|
||||
while (l != NIL)
|
||||
{
|
||||
TempTable *temp_rel = lfirst(l);
|
||||
TempTable *temp_rel = lfirst(l);
|
||||
Form_pg_class classtuple;
|
||||
|
||||
classtuple = (Form_pg_class)GETSTRUCT(temp_rel->pg_class_tuple);
|
||||
classtuple = (Form_pg_class) GETSTRUCT(temp_rel->pg_class_tuple);
|
||||
|
||||
next = lnext(l); /* do this first, l is deallocated */
|
||||
next = lnext(l); /* do this first, l is deallocated */
|
||||
|
||||
if (classtuple->relkind != RELKIND_INDEX)
|
||||
{
|
||||
char relname[NAMEDATALEN];
|
||||
char relname[NAMEDATALEN];
|
||||
|
||||
/* safe from deallocation */
|
||||
strcpy(relname, temp_rel->user_relname);
|
||||
strcpy(relname, temp_rel->user_relname);
|
||||
heap_destroy_with_catalog(relname);
|
||||
}
|
||||
else
|
||||
@ -109,15 +110,16 @@ remove_temp_relation(Oid relid)
|
||||
{
|
||||
|
||||
MemoryContext oldcxt;
|
||||
List *l, *prev;
|
||||
|
||||
List *l,
|
||||
*prev;
|
||||
|
||||
oldcxt = MemoryContextSwitchTo((MemoryContext) CacheCxt);
|
||||
|
||||
prev = NIL;
|
||||
l = temp_rels;
|
||||
while (l != NIL)
|
||||
{
|
||||
TempTable *temp_rel = lfirst(l);
|
||||
TempTable *temp_rel = lfirst(l);
|
||||
|
||||
if (temp_rel->pg_class_tuple->t_data->t_oid == relid)
|
||||
{
|
||||
@ -152,11 +154,11 @@ remove_temp_relation(Oid relid)
|
||||
HeapTuple
|
||||
get_temp_rel_by_name(char *user_relname)
|
||||
{
|
||||
List *l;
|
||||
List *l;
|
||||
|
||||
foreach(l, temp_rels)
|
||||
{
|
||||
TempTable *temp_rel = lfirst(l);
|
||||
TempTable *temp_rel = lfirst(l);
|
||||
|
||||
if (strcmp(temp_rel->user_relname, user_relname) == 0)
|
||||
return temp_rel->pg_class_tuple;
|
||||
|
Reference in New Issue
Block a user