mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
pgindent run before PG 9.1 beta 1.
This commit is contained in:
3
src/backend/utils/cache/inval.c
vendored
3
src/backend/utils/cache/inval.c
vendored
@ -514,7 +514,8 @@ LocalExecuteInvalidationMessage(SharedInvalidationMessage *msg)
|
||||
* We could have smgr entries for relations of other databases, so no
|
||||
* short-circuit test is possible here.
|
||||
*/
|
||||
RelFileNodeBackend rnode;
|
||||
RelFileNodeBackend rnode;
|
||||
|
||||
rnode.node = msg->sm.rnode;
|
||||
rnode.backend = (msg->sm.backend_hi << 16) | (int) msg->sm.backend_lo;
|
||||
smgrclosenode(rnode);
|
||||
|
10
src/backend/utils/cache/lsyscache.c
vendored
10
src/backend/utils/cache/lsyscache.c
vendored
@ -1122,7 +1122,7 @@ op_input_types(Oid opno, Oid *lefttype, Oid *righttype)
|
||||
*
|
||||
* In some cases (currently only array_eq), mergejoinability depends on the
|
||||
* specific input data type the operator is invoked for, so that must be
|
||||
* passed as well. We currently assume that only one input's type is needed
|
||||
* passed as well. We currently assume that only one input's type is needed
|
||||
* to check this --- by convention, pass the left input's data type.
|
||||
*/
|
||||
bool
|
||||
@ -1172,7 +1172,7 @@ op_mergejoinable(Oid opno, Oid inputtype)
|
||||
*
|
||||
* In some cases (currently only array_eq), hashjoinability depends on the
|
||||
* specific input data type the operator is invoked for, so that must be
|
||||
* passed as well. We currently assume that only one input's type is needed
|
||||
* passed as well. We currently assume that only one input's type is needed
|
||||
* to check this --- by convention, pass the left input's data type.
|
||||
*/
|
||||
bool
|
||||
@ -2709,9 +2709,9 @@ get_attstatsslot(HeapTuple statstuple,
|
||||
/*
|
||||
* Need to get info about the array element type. We look at the
|
||||
* actual element type embedded in the array, which might be only
|
||||
* binary-compatible with the passed-in atttype. The info we
|
||||
* extract here should be the same either way, but deconstruct_array
|
||||
* is picky about having an exact type OID match.
|
||||
* binary-compatible with the passed-in atttype. The info we extract
|
||||
* here should be the same either way, but deconstruct_array is picky
|
||||
* about having an exact type OID match.
|
||||
*/
|
||||
arrayelemtype = ARR_ELEMTYPE(statarray);
|
||||
typeTuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(arrayelemtype));
|
||||
|
4
src/backend/utils/cache/plancache.c
vendored
4
src/backend/utils/cache/plancache.c
vendored
@ -512,8 +512,8 @@ RevalidateCachedPlan(CachedPlanSource *plansource, bool useResOwner)
|
||||
TupleDesc resultDesc;
|
||||
|
||||
/*
|
||||
* Restore the search_path that was in use when the plan was made.
|
||||
* See comments for PushOverrideSearchPath about limitations of this.
|
||||
* Restore the search_path that was in use when the plan was made. See
|
||||
* comments for PushOverrideSearchPath about limitations of this.
|
||||
*
|
||||
* (XXX is there anything else we really need to restore?)
|
||||
*/
|
||||
|
8
src/backend/utils/cache/relcache.c
vendored
8
src/backend/utils/cache/relcache.c
vendored
@ -1070,9 +1070,9 @@ RelationInitIndexAccessInfo(Relation relation)
|
||||
MemoryContextAllocZero(indexcxt, natts * sizeof(int16));
|
||||
|
||||
/*
|
||||
* indcollation cannot be referenced directly through the C struct, because it
|
||||
* comes after the variable-width indkey field. Must extract the datum
|
||||
* the hard way...
|
||||
* indcollation cannot be referenced directly through the C struct,
|
||||
* because it comes after the variable-width indkey field. Must extract
|
||||
* the datum the hard way...
|
||||
*/
|
||||
indcollDatum = fastgetattr(relation->rd_indextuple,
|
||||
Anum_pg_index_indcollation,
|
||||
@ -1096,7 +1096,7 @@ RelationInitIndexAccessInfo(Relation relation)
|
||||
|
||||
/*
|
||||
* Fill the support procedure OID array, as well as the info about
|
||||
* opfamilies and opclass input types. (aminfo and supportinfo are left
|
||||
* opfamilies and opclass input types. (aminfo and supportinfo are left
|
||||
* as zeroes, and are filled on-the-fly when used)
|
||||
*/
|
||||
IndexSupportInitialize(indclass, relation->rd_support,
|
||||
|
2
src/backend/utils/cache/syscache.c
vendored
2
src/backend/utils/cache/syscache.c
vendored
@ -422,7 +422,7 @@ static const struct cachedesc cacheinfo[] = {
|
||||
},
|
||||
32
|
||||
},
|
||||
{ForeignTableRelationId, /* FOREIGNTABLEREL */
|
||||
{ForeignTableRelationId, /* FOREIGNTABLEREL */
|
||||
ForeignTableRelidIndexId,
|
||||
1,
|
||||
{
|
||||
|
2
src/backend/utils/cache/ts_cache.c
vendored
2
src/backend/utils/cache/ts_cache.c
vendored
@ -582,7 +582,7 @@ getTSCurrentConfig(bool emitError)
|
||||
/* Look up the config */
|
||||
TSCurrentConfigCache =
|
||||
get_ts_config_oid(stringToQualifiedNameList(TSCurrentConfig),
|
||||
!emitError);
|
||||
!emitError);
|
||||
|
||||
return TSCurrentConfigCache;
|
||||
}
|
||||
|
67
src/backend/utils/cache/typcache.c
vendored
67
src/backend/utils/cache/typcache.c
vendored
@ -77,7 +77,7 @@ typedef struct TypeCacheEnumData
|
||||
Oid bitmap_base; /* OID corresponding to bit 0 of bitmapset */
|
||||
Bitmapset *sorted_values; /* Set of OIDs known to be in order */
|
||||
int num_values; /* total number of values in enum */
|
||||
EnumItem enum_values[1]; /* VARIABLE LENGTH ARRAY */
|
||||
EnumItem enum_values[1]; /* VARIABLE LENGTH ARRAY */
|
||||
} TypeCacheEnumData;
|
||||
|
||||
/*
|
||||
@ -227,10 +227,10 @@ lookup_type_cache(Oid type_id, int flags)
|
||||
{
|
||||
/*
|
||||
* In case we find a btree opclass where previously we only found
|
||||
* a hash opclass, reset eq_opr and derived information so that
|
||||
* we can fetch the btree equality operator instead of the hash
|
||||
* equality operator. (They're probably the same operator, but
|
||||
* we don't assume that here.)
|
||||
* a hash opclass, reset eq_opr and derived information so that we
|
||||
* can fetch the btree equality operator instead of the hash
|
||||
* equality operator. (They're probably the same operator, but we
|
||||
* don't assume that here.)
|
||||
*/
|
||||
typentry->eq_opr = InvalidOid;
|
||||
typentry->eq_opr_finfo.fn_oid = InvalidOid;
|
||||
@ -612,7 +612,8 @@ TypeCacheRelCallback(Datum arg, Oid relid)
|
||||
while ((typentry = (TypeCacheEntry *) hash_seq_search(&status)) != NULL)
|
||||
{
|
||||
if (typentry->tupDesc == NULL)
|
||||
continue; /* not composite, or tupdesc hasn't been requested */
|
||||
continue; /* not composite, or tupdesc hasn't been
|
||||
* requested */
|
||||
|
||||
/* Delete if match, or if we're zapping all composite types */
|
||||
if (relid == typentry->typrelid || relid == InvalidOid)
|
||||
@ -671,8 +672,8 @@ compare_values_of_enum(TypeCacheEntry *tcache, Oid arg1, Oid arg2)
|
||||
EnumItem *item2;
|
||||
|
||||
/*
|
||||
* Equal OIDs are certainly equal --- this case was probably handled
|
||||
* by our caller, but we may as well check.
|
||||
* Equal OIDs are certainly equal --- this case was probably handled by
|
||||
* our caller, but we may as well check.
|
||||
*/
|
||||
if (arg1 == arg2)
|
||||
return 0;
|
||||
@ -704,8 +705,8 @@ compare_values_of_enum(TypeCacheEntry *tcache, Oid arg1, Oid arg2)
|
||||
{
|
||||
/*
|
||||
* We couldn't find one or both values. That means the enum has
|
||||
* changed under us, so re-initialize the cache and try again.
|
||||
* We don't bother retrying the known-sorted case in this path.
|
||||
* changed under us, so re-initialize the cache and try again. We
|
||||
* don't bother retrying the known-sorted case in this path.
|
||||
*/
|
||||
load_enum_cache_data(tcache);
|
||||
enumdata = tcache->enumData;
|
||||
@ -714,8 +715,8 @@ compare_values_of_enum(TypeCacheEntry *tcache, Oid arg1, Oid arg2)
|
||||
item2 = find_enumitem(enumdata, arg2);
|
||||
|
||||
/*
|
||||
* If we still can't find the values, complain: we must have
|
||||
* corrupt data.
|
||||
* If we still can't find the values, complain: we must have corrupt
|
||||
* data.
|
||||
*/
|
||||
if (item1 == NULL)
|
||||
elog(ERROR, "enum value %u not found in cache for enum %s",
|
||||
@ -761,21 +762,21 @@ load_enum_cache_data(TypeCacheEntry *tcache)
|
||||
format_type_be(tcache->type_id))));
|
||||
|
||||
/*
|
||||
* Read all the information for members of the enum type. We collect
|
||||
* the info in working memory in the caller's context, and then transfer
|
||||
* it to permanent memory in CacheMemoryContext. This minimizes the risk
|
||||
* of leaking memory from CacheMemoryContext in the event of an error
|
||||
* partway through.
|
||||
* Read all the information for members of the enum type. We collect the
|
||||
* info in working memory in the caller's context, and then transfer it to
|
||||
* permanent memory in CacheMemoryContext. This minimizes the risk of
|
||||
* leaking memory from CacheMemoryContext in the event of an error partway
|
||||
* through.
|
||||
*/
|
||||
maxitems = 64;
|
||||
items = (EnumItem *) palloc(sizeof(EnumItem) * maxitems);
|
||||
numitems = 0;
|
||||
|
||||
/*
|
||||
* Scan pg_enum for the members of the target enum type. We use a
|
||||
* current MVCC snapshot, *not* SnapshotNow, so that we see a consistent
|
||||
* set of rows even if someone commits a renumbering of the enum meanwhile.
|
||||
* See comments for RenumberEnumType in catalog/pg_enum.c for more info.
|
||||
* Scan pg_enum for the members of the target enum type. We use a current
|
||||
* MVCC snapshot, *not* SnapshotNow, so that we see a consistent set of
|
||||
* rows even if someone commits a renumbering of the enum meanwhile. See
|
||||
* comments for RenumberEnumType in catalog/pg_enum.c for more info.
|
||||
*/
|
||||
ScanKeyInit(&skey,
|
||||
Anum_pg_enum_enumtypid,
|
||||
@ -817,8 +818,8 @@ load_enum_cache_data(TypeCacheEntry *tcache)
|
||||
* and we'd rather not do binary searches unnecessarily.
|
||||
*
|
||||
* This is somewhat heuristic, and might identify a subset of OIDs that
|
||||
* isn't exactly what the type started with. That's okay as long as
|
||||
* the subset is correctly sorted.
|
||||
* isn't exactly what the type started with. That's okay as long as the
|
||||
* subset is correctly sorted.
|
||||
*/
|
||||
bitmap_base = InvalidOid;
|
||||
bitmap = NULL;
|
||||
@ -829,15 +830,15 @@ load_enum_cache_data(TypeCacheEntry *tcache)
|
||||
/*
|
||||
* Identify longest sorted subsequence starting at start_pos
|
||||
*/
|
||||
Bitmapset *this_bitmap = bms_make_singleton(0);
|
||||
int this_bm_size = 1;
|
||||
Oid start_oid = items[start_pos].enum_oid;
|
||||
float4 prev_order = items[start_pos].sort_order;
|
||||
int i;
|
||||
Bitmapset *this_bitmap = bms_make_singleton(0);
|
||||
int this_bm_size = 1;
|
||||
Oid start_oid = items[start_pos].enum_oid;
|
||||
float4 prev_order = items[start_pos].sort_order;
|
||||
int i;
|
||||
|
||||
for (i = start_pos + 1; i < numitems; i++)
|
||||
{
|
||||
Oid offset;
|
||||
Oid offset;
|
||||
|
||||
offset = items[i].enum_oid - start_oid;
|
||||
/* quit if bitmap would be too large; cutoff is arbitrary */
|
||||
@ -864,10 +865,10 @@ load_enum_cache_data(TypeCacheEntry *tcache)
|
||||
bms_free(this_bitmap);
|
||||
|
||||
/*
|
||||
* Done if it's not possible to find a longer sequence in the rest
|
||||
* of the list. In typical cases this will happen on the first
|
||||
* iteration, which is why we create the bitmaps on the fly instead
|
||||
* of doing a second pass over the list.
|
||||
* Done if it's not possible to find a longer sequence in the rest of
|
||||
* the list. In typical cases this will happen on the first
|
||||
* iteration, which is why we create the bitmaps on the fly instead of
|
||||
* doing a second pass over the list.
|
||||
*/
|
||||
if (bm_size >= (numitems - start_pos - 1))
|
||||
break;
|
||||
|
Reference in New Issue
Block a user