diff options
Diffstat (limited to 'src')
1057 files changed, 3294 insertions, 3375 deletions
diff --git a/src/backend/access/brin/brin_pageops.c b/src/backend/access/brin/brin_pageops.c index 3609c8ae7c..bd08f0e396 100644 --- a/src/backend/access/brin/brin_pageops.c +++ b/src/backend/access/brin/brin_pageops.c @@ -357,7 +357,7 @@ brin_doinsert(Relation idxrel, BlockNumber pagesPerRange, (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("index row size %zu exceeds maximum %zu for index \"%s\"", itemsz, BrinMaxItemSize, RelationGetRelationName(idxrel)))); - return InvalidOffsetNumber; /* keep compiler quiet */ + return InvalidOffsetNumber; /* keep compiler quiet */ } /* Make sure the revmap is long enough to contain the entry we need */ @@ -823,7 +823,7 @@ brin_getinsertbuffer(Relation irel, Buffer oldbuf, Size itemsz, (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("index row size %zu exceeds maximum %zu for index \"%s\"", itemsz, freespace, RelationGetRelationName(irel)))); - return InvalidBuffer; /* keep compiler quiet */ + return InvalidBuffer; /* keep compiler quiet */ } if (newblk != oldblk) diff --git a/src/backend/access/brin/brin_revmap.c b/src/backend/access/brin/brin_revmap.c index e778cbcacd..c87bc03a9e 100644 --- a/src/backend/access/brin/brin_revmap.c +++ b/src/backend/access/brin/brin_revmap.c @@ -48,7 +48,7 @@ struct BrinRevmap { Relation rm_irel; BlockNumber rm_pagesPerRange; - BlockNumber rm_lastRevmapPage; /* cached from the metapage */ + BlockNumber rm_lastRevmapPage; /* cached from the metapage */ Buffer rm_metaBuf; Buffer rm_currBuf; }; diff --git a/src/backend/access/common/heaptuple.c b/src/backend/access/common/heaptuple.c index c0086ded62..584a202ab5 100644 --- a/src/backend/access/common/heaptuple.c +++ b/src/backend/access/common/heaptuple.c @@ -356,7 +356,7 @@ nocachegetattr(HeapTuple tuple, HeapTupleHeader tup = tuple->t_data; Form_pg_attribute *att = tupleDesc->attrs; char *tp; /* ptr to data part of tuple */ - bits8 *bp = tup->t_bits; /* ptr to null bitmap in tuple */ + bits8 *bp = tup->t_bits; /* ptr to null bitmap in tuple */ bool slow = false; /* do we have to walk attrs? */ int off; /* current offset within data */ @@ -762,7 +762,7 @@ heap_form_tuple(TupleDesc tupleDescriptor, HeapTupleHeaderSetNatts(td, numberOfAttributes); td->t_hoff = hoff; - if (tupleDescriptor->tdhasoid) /* else leave infomask = 0 */ + if (tupleDescriptor->tdhasoid) /* else leave infomask = 0 */ td->t_infomask = HEAP_HASOID; heap_fill_tuple(tupleDescriptor, @@ -941,7 +941,7 @@ heap_deform_tuple(HeapTuple tuple, TupleDesc tupleDesc, int attnum; char *tp; /* ptr to tuple data */ long off; /* offset in tuple data */ - bits8 *bp = tup->t_bits; /* ptr to null bitmap in tuple */ + bits8 *bp = tup->t_bits; /* ptr to null bitmap in tuple */ bool slow = false; /* can we use/set attcacheoff? */ natts = HeapTupleHeaderGetNatts(tup); @@ -1043,7 +1043,7 @@ slot_deform_tuple(TupleTableSlot *slot, int natts) int attnum; char *tp; /* ptr to tuple data */ long off; /* offset in tuple data */ - bits8 *bp = tup->t_bits; /* ptr to null bitmap in tuple */ + bits8 *bp = tup->t_bits; /* ptr to null bitmap in tuple */ bool slow; /* can we use/set attcacheoff? */ /* @@ -1151,7 +1151,7 @@ slot_getattr(TupleTableSlot *slot, int attnum, bool *isnull) { if (tuple == NULL) /* internal error */ elog(ERROR, "cannot extract system attribute from virtual tuple"); - if (tuple == &(slot->tts_minhdr)) /* internal error */ + if (tuple == &(slot->tts_minhdr)) /* internal error */ elog(ERROR, "cannot extract system attribute from minimal tuple"); return heap_getsysattr(tuple, attnum, tupleDesc, isnull); } @@ -1337,7 +1337,7 @@ slot_attisnull(TupleTableSlot *slot, int attnum) { if (tuple == NULL) /* internal error */ elog(ERROR, "cannot extract system attribute from virtual tuple"); - if (tuple == &(slot->tts_minhdr)) /* internal error */ + if (tuple == &(slot->tts_minhdr)) /* internal error */ elog(ERROR, "cannot extract system attribute from minimal tuple"); return heap_attisnull(tuple, attnum); } @@ -1446,7 +1446,7 @@ heap_form_minimal_tuple(TupleDesc tupleDescriptor, HeapTupleHeaderSetNatts(tuple, numberOfAttributes); tuple->t_hoff = hoff + MINIMAL_TUPLE_OFFSET; - if (tupleDescriptor->tdhasoid) /* else leave infomask = 0 */ + if (tupleDescriptor->tdhasoid) /* else leave infomask = 0 */ tuple->t_infomask = HEAP_HASOID; heap_fill_tuple(tupleDescriptor, diff --git a/src/backend/access/common/printsimple.c b/src/backend/access/common/printsimple.c index 851c3bf4de..c863e859fe 100644 --- a/src/backend/access/common/printsimple.c +++ b/src/backend/access/common/printsimple.c @@ -103,7 +103,7 @@ printsimple(TupleTableSlot *slot, DestReceiver *self) case INT4OID: { int32 num = DatumGetInt32(value); - char str[12]; /* sign, 10 digits and '\0' */ + char str[12]; /* sign, 10 digits and '\0' */ pg_ltoa(num, str); pq_sendcountedtext(&buf, str, strlen(str), false); @@ -113,7 +113,7 @@ printsimple(TupleTableSlot *slot, DestReceiver *self) case INT8OID: { int64 num = DatumGetInt64(value); - char str[23]; /* sign, 21 digits and '\0' */ + char str[23]; /* sign, 21 digits and '\0' */ pg_lltoa(num, str); pq_sendcountedtext(&buf, str, strlen(str), false); diff --git a/src/backend/access/common/tupconvert.c b/src/backend/access/common/tupconvert.c index 392a49b522..57e44375ea 100644 --- a/src/backend/access/common/tupconvert.c +++ b/src/backend/access/common/tupconvert.c @@ -188,7 +188,7 @@ convert_tuples_by_position(TupleDesc indesc, n = indesc->natts + 1; /* +1 for NULL */ map->invalues = (Datum *) palloc(n * sizeof(Datum)); map->inisnull = (bool *) palloc(n * sizeof(bool)); - map->invalues[0] = (Datum) 0; /* set up the NULL entry */ + map->invalues[0] = (Datum) 0; /* set up the NULL entry */ map->inisnull[0] = true; return map; @@ -267,7 +267,7 @@ convert_tuples_by_name(TupleDesc indesc, n = indesc->natts + 1; /* +1 for NULL */ map->invalues = (Datum *) palloc(n * sizeof(Datum)); map->inisnull = (bool *) palloc(n * sizeof(bool)); - map->invalues[0] = (Datum) 0; /* set up the NULL entry */ + map->invalues[0] = (Datum) 0; /* set up the NULL entry */ map->inisnull[0] = true; return map; diff --git a/src/backend/access/gin/ginbulk.c b/src/backend/access/gin/ginbulk.c index f07c76b90b..4ff149e59a 100644 --- a/src/backend/access/gin/ginbulk.c +++ b/src/backend/access/gin/ginbulk.c @@ -116,7 +116,7 @@ ginInitBA(BuildAccumulator *accum) cmpEntryAccumulator, ginCombineData, ginAllocEntryAccumulator, - NULL, /* no freefunc needed */ + NULL, /* no freefunc needed */ (void *) accum); } diff --git a/src/backend/access/gin/ginfast.c b/src/backend/access/gin/ginfast.c index 0d5bb70cc9..03a54346aa 100644 --- a/src/backend/access/gin/ginfast.c +++ b/src/backend/access/gin/ginfast.c @@ -913,8 +913,8 @@ ginInsertCleanup(GinState *ginstate, bool full_clean, * Remember next page - it will become the new list head */ blkno = GinPageGetOpaque(page)->rightlink; - UnlockReleaseBuffer(buffer); /* shiftList will do exclusive - * locking */ + UnlockReleaseBuffer(buffer); /* shiftList will do exclusive + * locking */ /* * remove read pages from pending list, at this point all content diff --git a/src/backend/access/gin/ginscan.c b/src/backend/access/gin/ginscan.c index c83375d6b4..25758b9b5d 100644 --- a/src/backend/access/gin/ginscan.c +++ b/src/backend/access/gin/ginscan.c @@ -362,7 +362,7 @@ ginNewScanKey(IndexScanDesc scan) { if (nullFlags[j]) { - nullFlags[j] = true; /* not any other nonzero value */ + nullFlags[j] = true; /* not any other nonzero value */ hasNullQuery = true; } } diff --git a/src/backend/access/gin/ginvacuum.c b/src/backend/access/gin/ginvacuum.c index 27e502a360..31425e9963 100644 --- a/src/backend/access/gin/ginvacuum.c +++ b/src/backend/access/gin/ginvacuum.c @@ -650,7 +650,7 @@ ginbulkdelete(IndexVacuumInfo *info, IndexBulkDeleteResult *stats, vacuum_delay_point(); } - if (blkno == InvalidBlockNumber) /* rightmost page */ + if (blkno == InvalidBlockNumber) /* rightmost page */ break; buffer = ReadBufferExtended(index, MAIN_FORKNUM, blkno, diff --git a/src/backend/access/gist/gist.c b/src/backend/access/gist/gist.c index 6593771361..afef753ede 100644 --- a/src/backend/access/gist/gist.c +++ b/src/backend/access/gist/gist.c @@ -1442,7 +1442,7 @@ initGISTstate(Relation index) giststate = (GISTSTATE *) palloc(sizeof(GISTSTATE)); giststate->scanCxt = scanCxt; - giststate->tempCxt = scanCxt; /* caller must change this if needed */ + giststate->tempCxt = scanCxt; /* caller must change this if needed */ giststate->tupdesc = index->rd_att; for (i = 0; i < index->rd_att->natts; i++) diff --git a/src/backend/access/gist/gistbuild.c b/src/backend/access/gist/gistbuild.c index f1f08bb3d8..c24643df03 100644 --- a/src/backend/access/gist/gistbuild.c +++ b/src/backend/access/gist/gistbuild.c @@ -814,7 +814,7 @@ gistbufferinginserttuples(GISTBuildState *buildstate, Buffer buffer, int level, downlinks, ndownlinks, downlinkoffnum, InvalidBlockNumber, InvalidOffsetNumber); - list_free_deep(splitinfo); /* we don't need this anymore */ + list_free_deep(splitinfo); /* we don't need this anymore */ } else UnlockReleaseBuffer(buffer); diff --git a/src/backend/access/gist/gistbuildbuffers.c b/src/backend/access/gist/gistbuildbuffers.c index ca4c32b3fe..f558729fbf 100644 --- a/src/backend/access/gist/gistbuildbuffers.c +++ b/src/backend/access/gist/gistbuildbuffers.c @@ -709,7 +709,7 @@ gistRelocateBuildBuffersOnSplit(GISTBuildBuffers *gfbb, GISTSTATE *giststate, * page seen so far. Skip the remaining columns and move * on to the next page, if any. */ - zero_penalty = false; /* so outer loop won't exit */ + zero_penalty = false; /* so outer loop won't exit */ break; } } diff --git a/src/backend/access/gist/gistget.c b/src/backend/access/gist/gistget.c index 5a4dea89ac..760ea0c997 100644 --- a/src/backend/access/gist/gistget.c +++ b/src/backend/access/gist/gistget.c @@ -147,7 +147,7 @@ gistindex_keytest(IndexScanDesc scan, { int i; - if (GistPageIsLeaf(page)) /* shouldn't happen */ + if (GistPageIsLeaf(page)) /* shouldn't happen */ elog(ERROR, "invalid GiST tuple found on leaf page"); for (i = 0; i < scan->numberOfOrderBys; i++) so->distances[i] = -get_float8_infinity(); diff --git a/src/backend/access/hash/hashfunc.c b/src/backend/access/hash/hashfunc.c index 289d766419..a127f3f8b1 100644 --- a/src/backend/access/hash/hashfunc.c +++ b/src/backend/access/hash/hashfunc.c @@ -412,7 +412,7 @@ hash_any(register const unsigned char *k, register int keylen) a += k[0]; /* case 0: nothing left to add */ } -#endif /* WORDS_BIGENDIAN */ +#endif /* WORDS_BIGENDIAN */ } else { @@ -429,7 +429,7 @@ hash_any(register const unsigned char *k, register int keylen) a += (k[0] + ((uint32) k[1] << 8) + ((uint32) k[2] << 16) + ((uint32) k[3] << 24)); b += (k[4] + ((uint32) k[5] << 8) + ((uint32) k[6] << 16) + ((uint32) k[7] << 24)); c += (k[8] + ((uint32) k[9] << 8) + ((uint32) k[10] << 16) + ((uint32) k[11] << 24)); -#endif /* WORDS_BIGENDIAN */ +#endif /* WORDS_BIGENDIAN */ mix(a, b, c); k += 12; len -= 12; @@ -492,7 +492,7 @@ hash_any(register const unsigned char *k, register int keylen) a += k[0]; /* case 0: nothing left to add */ } -#endif /* WORDS_BIGENDIAN */ +#endif /* WORDS_BIGENDIAN */ } final(a, b, c); diff --git a/src/backend/access/hash/hashsearch.c b/src/backend/access/hash/hashsearch.c index 2d9204903f..3e461ad7a0 100644 --- a/src/backend/access/hash/hashsearch.c +++ b/src/backend/access/hash/hashsearch.c @@ -462,7 +462,7 @@ _hash_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir) } if (so->hashso_sk_hash == _hash_get_indextuple_hashkey(itup)) - break; /* yes, so exit for-loop */ + break; /* yes, so exit for-loop */ } /* Before leaving current page, deal with any killed items */ @@ -519,7 +519,7 @@ _hash_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir) } if (so->hashso_sk_hash == _hash_get_indextuple_hashkey(itup)) - break; /* yes, so exit for-loop */ + break; /* yes, so exit for-loop */ } /* Before leaving current page, deal with any killed items */ diff --git a/src/backend/access/hash/hashutil.c b/src/backend/access/hash/hashutil.c index c513c3b842..62e37b6de5 100644 --- a/src/backend/access/hash/hashutil.c +++ b/src/backend/access/hash/hashutil.c @@ -207,7 +207,7 @@ _hash_get_totalbuckets(uint32 splitpoint_phase) /* account for buckets within splitpoint_group */ phases_within_splitpoint_group = (((splitpoint_phase - HASH_SPLITPOINT_GROUPS_WITH_ONE_PHASE) & - HASH_SPLITPOINT_PHASE_MASK) + 1); /* from 0-based to 1-based */ + HASH_SPLITPOINT_PHASE_MASK) + 1); /* from 0-based to 1-based */ total_buckets += (((1 << (splitpoint_group - 1)) >> HASH_SPLITPOINT_PHASE_BITS) * phases_within_splitpoint_group); diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c index e890e08c9a..5357a77dc2 100644 --- a/src/backend/access/heap/heapam.c +++ b/src/backend/access/heap/heapam.c @@ -521,15 +521,15 @@ heapgettup(HeapScanDesc scan, } } else - page = scan->rs_startblock; /* first page */ + page = scan->rs_startblock; /* first page */ heapgetpage(scan, page); - lineoff = FirstOffsetNumber; /* first offnum */ + lineoff = FirstOffsetNumber; /* first offnum */ scan->rs_inited = true; } else { /* continue from previously returned page/tuple */ - page = scan->rs_cblock; /* current page */ + page = scan->rs_cblock; /* current page */ lineoff = /* next offnum */ OffsetNumberNext(ItemPointerGetOffsetNumber(&(tuple->t_self))); } @@ -577,7 +577,7 @@ heapgettup(HeapScanDesc scan, else { /* continue from previously returned page/tuple */ - page = scan->rs_cblock; /* current page */ + page = scan->rs_cblock; /* current page */ } LockBuffer(scan->rs_cbuf, BUFFER_LOCK_SHARE); @@ -823,7 +823,7 @@ heapgettup_pagemode(HeapScanDesc scan, } } else - page = scan->rs_startblock; /* first page */ + page = scan->rs_startblock; /* first page */ heapgetpage(scan, page); lineindex = 0; scan->rs_inited = true; @@ -831,7 +831,7 @@ heapgettup_pagemode(HeapScanDesc scan, else { /* continue from previously returned page/tuple */ - page = scan->rs_cblock; /* current page */ + page = scan->rs_cblock; /* current page */ lineindex = scan->rs_cindex + 1; } @@ -876,7 +876,7 @@ heapgettup_pagemode(HeapScanDesc scan, else { /* continue from previously returned page/tuple */ - page = scan->rs_cblock; /* current page */ + page = scan->rs_cblock; /* current page */ } dp = BufferGetPage(scan->rs_cbuf); @@ -1088,7 +1088,7 @@ fastgetattr(HeapTuple tup, int attnum, TupleDesc tupleDesc, ) ); } -#endif /* defined(DISABLE_COMPLEX_MACRO) */ +#endif /* defined(DISABLE_COMPLEX_MACRO) */ /* ---------------------------------------------------------------- @@ -1787,7 +1787,7 @@ heap_update_snapshot(HeapScanDesc scan, Snapshot snapshot) #define HEAPDEBUG_1 #define HEAPDEBUG_2 #define HEAPDEBUG_3 -#endif /* !defined(HEAPDEBUGALL) */ +#endif /* !defined(HEAPDEBUGALL) */ HeapTuple @@ -2623,7 +2623,7 @@ heap_prepare_insert(Relation relation, HeapTuple tup, TransactionId xid, HeapTupleHeaderSetXminFrozen(tup->t_data); HeapTupleHeaderSetCmin(tup->t_data, cid); - HeapTupleHeaderSetXmax(tup->t_data, 0); /* for cleanliness */ + HeapTupleHeaderSetXmax(tup->t_data, 0); /* for cleanliness */ tup->t_tableOid = RelationGetRelid(relation); /* @@ -4214,7 +4214,7 @@ l2: HeapTupleClearHeapOnly(newtup); } - RelationPutHeapTuple(relation, newbuf, heaptup, false); /* insert new tuple */ + RelationPutHeapTuple(relation, newbuf, heaptup, false); /* insert new tuple */ /* Clear obsolete visibility flags, possibly set by ourselves above... */ @@ -6361,7 +6361,7 @@ FreezeMultiXactId(MultiXactId multi, uint16 t_infomask, { Assert(!TransactionIdDidCommit(xid)); *flags |= FRM_INVALIDATE_XMAX; - xid = InvalidTransactionId; /* not strictly necessary */ + xid = InvalidTransactionId; /* not strictly necessary */ } else { diff --git a/src/backend/access/heap/hio.c b/src/backend/access/heap/hio.c index 6529fe3d6b..13e3bdca50 100644 --- a/src/backend/access/heap/hio.c +++ b/src/backend/access/heap/hio.c @@ -329,7 +329,7 @@ RelationGetBufferForTuple(Relation relation, Size len, if (otherBuffer != InvalidBuffer) otherBlock = BufferGetBlockNumber(otherBuffer); else - otherBlock = InvalidBlockNumber; /* just to keep compiler quiet */ + otherBlock = InvalidBlockNumber; /* just to keep compiler quiet */ /* * We first try to put the tuple on the same page we last inserted a tuple diff --git a/src/backend/access/heap/pruneheap.c b/src/backend/access/heap/pruneheap.c index d69a266c36..5b7c57d568 100644 --- a/src/backend/access/heap/pruneheap.c +++ b/src/backend/access/heap/pruneheap.c @@ -31,8 +31,7 @@ typedef struct { TransactionId new_prune_xid; /* new prune hint value for page */ - TransactionId latestRemovedXid; /* latest xid to be removed by this - * prune */ + TransactionId latestRemovedXid; /* latest xid to be removed by this prune */ int nredirected; /* numbers of entries in arrays below */ int ndead; int nunused; @@ -149,8 +148,8 @@ heap_page_prune_opt(Relation relation, Buffer buffer) */ if (PageIsFull(page) || PageGetHeapFreeSpace(page) < minfree) { - TransactionId ignore = InvalidTransactionId; /* return value not - * needed */ + TransactionId ignore = InvalidTransactionId; /* return value not + * needed */ /* OK to prune */ (void) heap_page_prune(relation, buffer, OldestXmin, true, &ignore); diff --git a/src/backend/access/heap/rewriteheap.c b/src/backend/access/heap/rewriteheap.c index e702af901e..bd560e47e1 100644 --- a/src/backend/access/heap/rewriteheap.c +++ b/src/backend/access/heap/rewriteheap.c @@ -146,22 +146,22 @@ typedef struct RewriteStateData BlockNumber rs_blockno; /* block where page will go */ bool rs_buffer_valid; /* T if any tuples in buffer */ bool rs_use_wal; /* must we WAL-log inserts? */ - bool rs_logical_rewrite; /* do we need to do logical rewriting */ - TransactionId rs_oldest_xmin; /* oldest xmin used by caller to - * determine tuple visibility */ + bool rs_logical_rewrite; /* do we need to do logical rewriting */ + TransactionId rs_oldest_xmin; /* oldest xmin used by caller to determine + * tuple visibility */ TransactionId rs_freeze_xid; /* Xid that will be used as freeze cutoff * point */ - TransactionId rs_logical_xmin; /* Xid that will be used as cutoff - * point for logical rewrites */ + TransactionId rs_logical_xmin; /* Xid that will be used as cutoff point + * for logical rewrites */ MultiXactId rs_cutoff_multi; /* MultiXactId that will be used as cutoff * point for multixacts */ MemoryContext rs_cxt; /* for hash tables and entries and tuples in * them */ XLogRecPtr rs_begin_lsn; /* XLogInsertLsn when starting the rewrite */ - HTAB *rs_unresolved_tups; /* unmatched A tuples */ - HTAB *rs_old_new_tid_map; /* unmatched B tuples */ + HTAB *rs_unresolved_tups; /* unmatched A tuples */ + HTAB *rs_old_new_tid_map; /* unmatched B tuples */ HTAB *rs_logical_mappings; /* logical remapping files */ - uint32 rs_num_rewrite_mappings; /* # in memory mappings */ + uint32 rs_num_rewrite_mappings; /* # in memory mappings */ } RewriteStateData; /* @@ -216,8 +216,8 @@ typedef struct RewriteMappingFile */ typedef struct RewriteMappingDataEntry { - LogicalRewriteMappingData map; /* map between old and new location of - * the tuple */ + LogicalRewriteMappingData map; /* map between old and new location of the + * tuple */ dlist_node node; } RewriteMappingDataEntry; @@ -655,7 +655,7 @@ raw_heap_insert(RewriteState state, HeapTuple tup) else heaptup = tup; - len = MAXALIGN(heaptup->t_len); /* be conservative */ + len = MAXALIGN(heaptup->t_len); /* be conservative */ /* * If we're gonna fail for oversize tuple, do it right away diff --git a/src/backend/access/heap/tuptoaster.c b/src/backend/access/heap/tuptoaster.c index a2b3700750..fa5e78a067 100644 --- a/src/backend/access/heap/tuptoaster.c +++ b/src/backend/access/heap/tuptoaster.c @@ -1523,7 +1523,7 @@ toast_save_datum(Relation rel, Datum value, { data_p = VARDATA_SHORT(dval); data_todo = VARSIZE_SHORT(dval) - VARHDRSZ_SHORT; - toast_pointer.va_rawsize = data_todo + VARHDRSZ; /* as if not short */ + toast_pointer.va_rawsize = data_todo + VARHDRSZ; /* as if not short */ toast_pointer.va_extsize = data_todo; } else if (VARATT_IS_COMPRESSED(dval)) diff --git a/src/backend/access/index/genam.c b/src/backend/access/index/genam.c index a91fda7bcd..05d7da001a 100644 --- a/src/backend/access/index/genam.c +++ b/src/backend/access/index/genam.c @@ -83,7 +83,7 @@ RelationGetIndexScan(Relation indexRelation, int nkeys, int norderbys) scan->heapRelation = NULL; /* may be set later */ scan->indexRelation = indexRelation; - scan->xs_snapshot = InvalidSnapshot; /* caller must initialize this */ + scan->xs_snapshot = InvalidSnapshot; /* caller must initialize this */ scan->numberOfKeys = nkeys; scan->numberOfOrderBys = norderbys; diff --git a/src/backend/access/index/indexam.c b/src/backend/access/index/indexam.c index cc5ac8b857..cacd74a978 100644 --- a/src/backend/access/index/indexam.c +++ b/src/backend/access/index/indexam.c @@ -326,7 +326,7 @@ index_rescan(IndexScanDesc scan, scan->xs_continue_hot = false; - scan->kill_prior_tuple = false; /* for safety */ + scan->kill_prior_tuple = false; /* for safety */ scan->indexRelation->rd_amroutine->amrescan(scan, keys, nkeys, orderbys, norderbys); @@ -401,7 +401,7 @@ index_restrpos(IndexScanDesc scan) scan->xs_continue_hot = false; - scan->kill_prior_tuple = false; /* for safety */ + scan->kill_prior_tuple = false; /* for safety */ scan->indexRelation->rd_amroutine->amrestrpos(scan); } diff --git a/src/backend/access/nbtree/nbtinsert.c b/src/backend/access/nbtree/nbtinsert.c index 6dca8109fd..df8f44ae80 100644 --- a/src/backend/access/nbtree/nbtinsert.c +++ b/src/backend/access/nbtree/nbtinsert.c @@ -36,7 +36,7 @@ typedef struct OffsetNumber newitemoff; /* where the new item is to be inserted */ int leftspace; /* space available for items on left page */ int rightspace; /* space available for items on right page */ - int olddataitemstotal; /* space taken by old items */ + int olddataitemstotal; /* space taken by old items */ bool have_split; /* found a valid split? */ diff --git a/src/backend/access/nbtree/nbtree.c b/src/backend/access/nbtree/nbtree.c index 5d7504040d..3dbafdd6fc 100644 --- a/src/backend/access/nbtree/nbtree.c +++ b/src/backend/access/nbtree/nbtree.c @@ -59,7 +59,7 @@ typedef struct IndexBulkDeleteCallback callback; void *callback_state; BTCycleId cycleid; - BlockNumber lastBlockVacuumed; /* highest blkno actually vacuumed */ + BlockNumber lastBlockVacuumed; /* highest blkno actually vacuumed */ BlockNumber lastBlockLocked; /* highest blkno we've cleanup-locked */ BlockNumber totFreePages; /* true total # of free pages */ MemoryContext pagedelcontext; @@ -95,9 +95,8 @@ typedef struct BTParallelScanDescData BTPS_State btps_pageStatus; /* indicates whether next page is * available for scan. see above for * possible states of parallel scan. */ - int btps_arrayKeyCount; /* count indicating number of array - * scan keys processed by parallel - * scan */ + int btps_arrayKeyCount; /* count indicating number of array scan + * keys processed by parallel scan */ slock_t btps_mutex; /* protects above variables */ ConditionVariable btps_cv; /* used to synchronize parallel scan */ } BTParallelScanDescData; @@ -187,7 +186,7 @@ btbuild(Relation heap, Relation index, IndexInfo *indexInfo) #ifdef BTREE_BUILD_STATS if (log_btree_build_stats) ResetUsage(); -#endif /* BTREE_BUILD_STATS */ +#endif /* BTREE_BUILD_STATS */ /* * We expect to be called exactly once for any index relation. If that's @@ -234,7 +233,7 @@ btbuild(Relation heap, Relation index, IndexInfo *indexInfo) ShowUsage("BTREE BUILD STATS"); ResetUsage(); } -#endif /* BTREE_BUILD_STATS */ +#endif /* BTREE_BUILD_STATS */ /* * Return statistics diff --git a/src/backend/access/nbtree/nbtsearch.c b/src/backend/access/nbtree/nbtsearch.c index 2f32b2e78d..2de1625a12 100644 --- a/src/backend/access/nbtree/nbtsearch.c +++ b/src/backend/access/nbtree/nbtsearch.c @@ -466,7 +466,7 @@ _bt_compare(Relation rel, datum = index_getattr(itup, scankey->sk_attno, itupdesc, &isNull); /* see comments about NULLs handling in btbuild */ - if (scankey->sk_flags & SK_ISNULL) /* key is NULL */ + if (scankey->sk_flags & SK_ISNULL) /* key is NULL */ { if (isNull) result = 0; /* NULL "=" NULL */ diff --git a/src/backend/access/nbtree/nbtsort.c b/src/backend/access/nbtree/nbtsort.c index 3d041c47c0..168756cc78 100644 --- a/src/backend/access/nbtree/nbtsort.c +++ b/src/backend/access/nbtree/nbtsort.c @@ -111,7 +111,7 @@ typedef struct BTPageState OffsetNumber btps_lastoff; /* last item offset loaded */ uint32 btps_level; /* tree level (0 = leaf) */ Size btps_full; /* "full" if less than this much free space */ - struct BTPageState *btps_next; /* link to parent level, if any */ + struct BTPageState *btps_next; /* link to parent level, if any */ } BTPageState; /* @@ -122,8 +122,8 @@ typedef struct BTWriteState Relation heap; Relation index; bool btws_use_wal; /* dump pages to WAL? */ - BlockNumber btws_pages_alloced; /* # pages allocated */ - BlockNumber btws_pages_written; /* # pages written out */ + BlockNumber btws_pages_alloced; /* # pages allocated */ + BlockNumber btws_pages_written; /* # pages written out */ Page btws_zeropage; /* workspace for filling zeroes */ } BTWriteState; @@ -208,7 +208,7 @@ _bt_leafbuild(BTSpool *btspool, BTSpool *btspool2) ShowUsage("BTREE BUILD (Spool) STATISTICS"); ResetUsage(); } -#endif /* BTREE_BUILD_STATS */ +#endif /* BTREE_BUILD_STATS */ tuplesort_performsort(btspool->sortstate); if (btspool2) @@ -566,7 +566,7 @@ _bt_buildadd(BTWriteState *wstate, BTPageState *state, IndexTuple itup) oopaque->btpo_next = nblkno; nopaque->btpo_prev = oblkno; - nopaque->btpo_next = P_NONE; /* redundant */ + nopaque->btpo_next = P_NONE; /* redundant */ } /* diff --git a/src/backend/access/rmgrdesc/xlogdesc.c b/src/backend/access/rmgrdesc/xlogdesc.c index 5f07eb1499..2bf6de3332 100644 --- a/src/backend/access/rmgrdesc/xlogdesc.c +++ b/src/backend/access/rmgrdesc/xlogdesc.c @@ -26,7 +26,7 @@ const struct config_enum_entry wal_level_options[] = { {"minimal", WAL_LEVEL_MINIMAL, false}, {"replica", WAL_LEVEL_REPLICA, false}, - {"archive", WAL_LEVEL_REPLICA, true}, /* deprecated */ + {"archive", WAL_LEVEL_REPLICA, true}, /* deprecated */ {"hot_standby", WAL_LEVEL_REPLICA, true}, /* deprecated */ {"logical", WAL_LEVEL_LOGICAL, false}, {NULL, 0, false} diff --git a/src/backend/access/spgist/spgdoinsert.c b/src/backend/access/spgist/spgdoinsert.c index 57d2612c47..8c420633f4 100644 --- a/src/backend/access/spgist/spgdoinsert.c +++ b/src/backend/access/spgist/spgdoinsert.c @@ -1004,7 +1004,7 @@ doPickSplit(Relation index, SpGistState *state, insertedNew = true; } for (i = 0; i < nToInsert; i++) - leafPageSelect[i] = 0; /* signifies current page */ + leafPageSelect[i] = 0; /* signifies current page */ } else if (in.nTuples == 1 && totalLeafSizes > SPGIST_PAGE_CAPACITY) { @@ -1076,12 +1076,12 @@ doPickSplit(Relation index, SpGistState *state, { if (leafSizes[i] <= curspace) { - nodePageSelect[i] = 0; /* signifies current page */ + nodePageSelect[i] = 0; /* signifies current page */ curspace -= leafSizes[i]; } else { - nodePageSelect[i] = 1; /* signifies new leaf page */ + nodePageSelect[i] = 1; /* signifies new leaf page */ newspace -= leafSizes[i]; } } diff --git a/src/backend/access/spgist/spgscan.c b/src/backend/access/spgist/spgscan.c index 9281050646..e1f9d87278 100644 --- a/src/backend/access/spgist/spgscan.c +++ b/src/backend/access/spgist/spgscan.c @@ -29,7 +29,7 @@ typedef void (*storeRes_func) (SpGistScanOpaque so, ItemPointer heapPtr, typedef struct ScanStackEntry { - Datum reconstructedValue; /* value reconstructed from parent */ + Datum reconstructedValue; /* value reconstructed from parent */ void *traversalValue; /* opclass-specific traverse value */ int level; /* level of items on this page */ ItemPointerData ptr; /* block and offset to scan from */ diff --git a/src/backend/access/spgist/spgvacuum.c b/src/backend/access/spgist/spgvacuum.c index cce9b3f618..508d3e083f 100644 --- a/src/backend/access/spgist/spgvacuum.c +++ b/src/backend/access/spgist/spgvacuum.c @@ -34,7 +34,7 @@ typedef struct spgVacPendingItem { ItemPointerData tid; /* redirection target to visit */ bool done; /* have we dealt with this? */ - struct spgVacPendingItem *next; /* list link */ + struct spgVacPendingItem *next; /* list link */ } spgVacPendingItem; /* Local state for vacuum operations */ @@ -48,7 +48,7 @@ typedef struct spgBulkDeleteState /* Additional working state */ SpGistState spgstate; /* for SPGiST operations that need one */ - spgVacPendingItem *pendingList; /* TIDs we need to (re)visit */ + spgVacPendingItem *pendingList; /* TIDs we need to (re)visit */ TransactionId myXmin; /* for detecting newly-added redirects */ BlockNumber lastFilledBlock; /* last non-deletable block */ } spgBulkDeleteState; diff --git a/src/backend/access/transam/clog.c b/src/backend/access/transam/clog.c index bece57589e..ed1b1d8ce4 100644 --- a/src/backend/access/transam/clog.c +++ b/src/backend/access/transam/clog.c @@ -149,7 +149,7 @@ void TransactionIdSetTreeStatus(TransactionId xid, int nsubxids, TransactionId *subxids, XidStatus status, XLogRecPtr lsn) { - int pageno = TransactionIdToPage(xid); /* get page of parent */ + int pageno = TransactionIdToPage(xid); /* get page of parent */ int i; Assert(status == TRANSACTION_STATUS_COMMITTED || diff --git a/src/backend/access/transam/slru.c b/src/backend/access/transam/slru.c index 92966d3b10..aba45b0a85 100644 --- a/src/backend/access/transam/slru.c +++ b/src/backend/access/transam/slru.c @@ -76,7 +76,7 @@ typedef struct SlruFlushData { int num_files; /* # files actually open */ int fd[MAX_FLUSH_BUFFERS]; /* their FD's */ - int segno[MAX_FLUSH_BUFFERS]; /* their log seg#s */ + int segno[MAX_FLUSH_BUFFERS]; /* their log seg#s */ } SlruFlushData; typedef struct SlruFlushData *SlruFlush; @@ -150,10 +150,10 @@ SimpleLruShmemSize(int nslots, int nlsns) sz = MAXALIGN(sizeof(SlruSharedData)); sz += MAXALIGN(nslots * sizeof(char *)); /* page_buffer[] */ sz += MAXALIGN(nslots * sizeof(SlruPageStatus)); /* page_status[] */ - sz += MAXALIGN(nslots * sizeof(bool)); /* page_dirty[] */ - sz += MAXALIGN(nslots * sizeof(int)); /* page_number[] */ - sz += MAXALIGN(nslots * sizeof(int)); /* page_lru_count[] */ - sz += MAXALIGN(nslots * sizeof(LWLockPadded)); /* buffer_locks[] */ + sz += MAXALIGN(nslots * sizeof(bool)); /* page_dirty[] */ + sz += MAXALIGN(nslots * sizeof(int)); /* page_number[] */ + sz += MAXALIGN(nslots * sizeof(int)); /* page_lru_count[] */ + sz += MAXALIGN(nslots * sizeof(LWLockPadded)); /* buffer_locks[] */ if (nlsns > 0) sz += MAXALIGN(nslots * nlsns * sizeof(XLogRecPtr)); /* group_lsn[] */ @@ -972,9 +972,9 @@ SlruSelectLRUPage(SlruCtl ctl, int pageno) int bestvalidslot = 0; /* keep compiler quiet */ int best_valid_delta = -1; int best_valid_page_number = 0; /* keep compiler quiet */ - int bestinvalidslot = 0; /* keep compiler quiet */ + int bestinvalidslot = 0; /* keep compiler quiet */ int best_invalid_delta = -1; - int best_invalid_page_number = 0; /* keep compiler quiet */ + int best_invalid_page_number = 0; /* keep compiler quiet */ /* See if page already has a buffer assigned */ for (slotno = 0; slotno < shared->num_slots; slotno++) diff --git a/src/backend/access/transam/timeline.c b/src/backend/access/transam/timeline.c index 8cab8b9aa9..188008b4ca 100644 --- a/src/backend/access/transam/timeline.c +++ b/src/backend/access/transam/timeline.c @@ -261,7 +261,7 @@ findNewestTimeLine(TimeLineID startTLI) { if (existsTimeLineHistory(probeTLI)) { - newestTLI = probeTLI; /* probeTLI exists */ + newestTLI = probeTLI; /* probeTLI exists */ } else { diff --git a/src/backend/access/transam/twophase.c b/src/backend/access/transam/twophase.c index 957457c979..9e6933e9e8 100644 --- a/src/backend/access/transam/twophase.c +++ b/src/backend/access/transam/twophase.c @@ -164,7 +164,7 @@ typedef struct GlobalTransactionData * track of the end LSN because that is the LSN we need to wait for prior * to commit. */ - XLogRecPtr prepare_start_lsn; /* XLOG offset of prepare record start */ + XLogRecPtr prepare_start_lsn; /* XLOG offset of prepare record start */ XLogRecPtr prepare_end_lsn; /* XLOG offset of prepare record end */ TransactionId xid; /* The GXACT id */ @@ -898,7 +898,7 @@ TwoPhaseGetDummyProc(TransactionId xid) /* * Header for a 2PC state file */ -#define TWOPHASE_MAGIC 0x57F94533 /* format identifier */ +#define TWOPHASE_MAGIC 0x57F94533 /* format identifier */ typedef struct TwoPhaseFileHeader { @@ -1024,7 +1024,7 @@ StartPrepare(GlobalTransaction gxact) hdr.nabortrels = smgrGetPendingDeletes(false, &abortrels); hdr.ninvalmsgs = xactGetCommittedInvalidationMessages(&invalmsgs, &hdr.initfileinval); - hdr.gidlen = strlen(gxact->gid) + 1; /* Include '\0' */ + hdr.gidlen = strlen(gxact->gid) + 1; /* Include '\0' */ save_state_data(&hdr, sizeof(TwoPhaseFileHeader)); save_state_data(gxact->gid, hdr.gidlen); diff --git a/src/backend/access/transam/twophase_rmgr.c b/src/backend/access/transam/twophase_rmgr.c index cdcc382f34..1cd03482d9 100644 --- a/src/backend/access/transam/twophase_rmgr.c +++ b/src/backend/access/transam/twophase_rmgr.c @@ -27,7 +27,7 @@ const TwoPhaseCallback twophase_recover_callbacks[TWOPHASE_RM_MAX_ID + 1] = lock_twophase_recover, /* Lock */ NULL, /* pgstat */ multixact_twophase_recover, /* MultiXact */ - predicatelock_twophase_recover /* PredicateLock */ + predicatelock_twophase_recover /* PredicateLock */ }; const TwoPhaseCallback twophase_postcommit_callbacks[TWOPHASE_RM_MAX_ID + 1] = @@ -35,7 +35,7 @@ const TwoPhaseCallback twophase_postcommit_callbacks[TWOPHASE_RM_MAX_ID + 1] = NULL, /* END ID */ lock_twophase_postcommit, /* Lock */ pgstat_twophase_postcommit, /* pgstat */ - multixact_twophase_postcommit, /* MultiXact */ + multixact_twophase_postcommit, /* MultiXact */ NULL /* PredicateLock */ }; @@ -44,14 +44,14 @@ const TwoPhaseCallback twophase_postabort_callbacks[TWOPHASE_RM_MAX_ID + 1] = NULL, /* END ID */ lock_twophase_postabort, /* Lock */ pgstat_twophase_postabort, /* pgstat */ - multixact_twophase_postabort, /* MultiXact */ + multixact_twophase_postabort, /* MultiXact */ NULL /* PredicateLock */ }; const TwoPhaseCallback twophase_standby_recover_callbacks[TWOPHASE_RM_MAX_ID + 1] = { NULL, /* END ID */ - lock_twophase_standby_recover, /* Lock */ + lock_twophase_standby_recover, /* Lock */ NULL, /* pgstat */ NULL, /* MultiXact */ NULL /* PredicateLock */ diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c index e09696c37f..e14be6b314 100644 --- a/src/backend/access/transam/xact.c +++ b/src/backend/access/transam/xact.c @@ -177,18 +177,18 @@ typedef struct TransactionStateData TBlockState blockState; /* high-level state */ int nestingLevel; /* transaction nesting depth */ int gucNestLevel; /* GUC context nesting depth */ - MemoryContext curTransactionContext; /* my xact-lifetime context */ + MemoryContext curTransactionContext; /* my xact-lifetime context */ ResourceOwner curTransactionOwner; /* my query resources */ TransactionId *childXids; /* subcommitted child XIDs, in XID order */ int nChildXids; /* # of subcommitted child XIDs */ int maxChildXids; /* allocated size of childXids[] */ Oid prevUser; /* previous CurrentUserId setting */ int prevSecContext; /* previous SecurityRestrictionContext */ - bool prevXactReadOnly; /* entry-time xact r/o state */ - bool startedInRecovery; /* did we start in recovery? */ + bool prevXactReadOnly; /* entry-time xact r/o state */ + bool startedInRecovery; /* did we start in recovery? */ bool didLogXid; /* has xid been included in WAL record? */ - int parallelModeLevel; /* Enter/ExitParallelMode counter */ - struct TransactionStateData *parent; /* back link to parent */ + int parallelModeLevel; /* Enter/ExitParallelMode counter */ + struct TransactionStateData *parent; /* back link to parent */ } TransactionStateData; typedef TransactionStateData *TransactionState; @@ -2641,8 +2641,7 @@ CleanupTransaction(void) * do abort cleanup processing */ AtCleanup_Portals(); /* now safe to release portal memory */ - AtEOXact_Snapshot(false, true); /* and release the transaction's - * snapshots */ + AtEOXact_Snapshot(false, true); /* and release the transaction's snapshots */ CurrentResourceOwner = NULL; /* and resource owner */ if (TopTransactionResourceOwner) @@ -3769,7 +3768,7 @@ DefineSavepoint(char *name) case TBLOCK_SUBINPROGRESS: /* Normal subtransaction start */ PushTransaction(); - s = CurrentTransactionState; /* changed by push */ + s = CurrentTransactionState; /* changed by push */ /* * Savepoint names, like the TransactionState block itself, live @@ -4080,7 +4079,7 @@ BeginInternalSubTransaction(char *name) case TBLOCK_SUBINPROGRESS: /* Normal subtransaction start */ PushTransaction(); - s = CurrentTransactionState; /* changed by push */ + s = CurrentTransactionState; /* changed by push */ /* * Savepoint names, like the TransactionState block itself, live diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index e386df7315..106210a883 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -86,8 +86,8 @@ extern uint32 bootstrap_data_checksum_version; /* User-settable parameters */ -int max_wal_size_mb = 1024; /* 1 GB */ -int min_wal_size_mb = 80; /* 80 MB */ +int max_wal_size_mb = 1024; /* 1 GB */ +int min_wal_size_mb = 80; /* 80 MB */ int wal_keep_segments = 0; int XLOGbuffers = -1; int XLogArchiveTimeout = 0; @@ -582,8 +582,7 @@ typedef struct XLogCtlData XLogRecPtr asyncXactLSN; /* LSN of newest async commit/abort */ XLogRecPtr replicationSlotMinLSN; /* oldest LSN needed by any slot */ - XLogSegNo lastRemovedSegNo; /* latest removed/recycled XLOG - * segment */ + XLogSegNo lastRemovedSegNo; /* latest removed/recycled XLOG segment */ /* Fake LSN counter, for unlogged relations. Protected by ulsn_lck. */ XLogRecPtr unloggedLSN; @@ -784,7 +783,7 @@ static int readFile = -1; static XLogSegNo readSegNo = 0; static uint32 readOff = 0; static uint32 readLen = 0; -static XLogSource readSource = 0; /* XLOG_FROM_* code */ +static XLogSource readSource = 0; /* XLOG_FROM_* code */ /* * Keeps track of which source we're currently reading from. This is @@ -812,14 +811,14 @@ typedef struct XLogPageReadPrivate * XLogReceiptSource tracks where we last successfully read some WAL.) */ static TimestampTz XLogReceiptTime = 0; -static XLogSource XLogReceiptSource = 0; /* XLOG_FROM_* code */ +static XLogSource XLogReceiptSource = 0; /* XLOG_FROM_* code */ /* State information for XLOG reading */ static XLogRecPtr ReadRecPtr; /* start of last record read */ static XLogRecPtr EndRecPtr; /* end+1 of last record read */ -static XLogRecPtr minRecoveryPoint; /* local copy of - * ControlFile->minRecoveryPoint */ +static XLogRecPtr minRecoveryPoint; /* local copy of + * ControlFile->minRecoveryPoint */ static TimeLineID minRecoveryPointTLI; static bool updateMinRecoveryPoint = true; @@ -2020,7 +2019,7 @@ XLogRecPtrToBytePos(XLogRecPtr ptr) { result = fullsegs * UsableBytesInSegment + (XLOG_BLCKSZ - SizeOfXLogLongPHD) + /* account for first page */ - (fullpages - 1) * UsableBytesInPage; /* full pages */ + (fullpages - 1) * UsableBytesInPage; /* full pages */ if (offset > 0) { Assert(offset >= SizeOfXLogShortPHD); @@ -2508,7 +2507,7 @@ XLogWrite(XLogwrtRqst WriteRqst, bool flexible) /* signal that we need to wakeup walsenders later */ WalSndWakeupRequest(); - LogwrtResult.Flush = LogwrtResult.Write; /* end of page */ + LogwrtResult.Flush = LogwrtResult.Write; /* end of page */ if (XLogArchivingActive()) XLogArchiveNotifySeg(openLogSegNo); @@ -4377,7 +4376,7 @@ static void WriteControlFile(void) { int fd; - char buffer[PG_CONTROL_SIZE]; /* need not be aligned */ + char buffer[PG_CONTROL_SIZE]; /* need not be aligned */ /* * Initialize version and compatibility-check fields @@ -6531,7 +6530,7 @@ StartupXLOG(void) ereport(LOG, (errmsg("using previous checkpoint record at %X/%X", (uint32) (checkPointLoc >> 32), (uint32) checkPointLoc))); - InRecovery = true; /* force recovery even if SHUTDOWNED */ + InRecovery = true; /* force recovery even if SHUTDOWNED */ } else ereport(PANIC, @@ -8835,7 +8834,7 @@ CreateCheckPoint(int flags) if (shutdown) { if (flags & CHECKPOINT_END_OF_RECOVERY) - LocalXLogInsertAllowed = -1; /* return to "check" state */ + LocalXLogInsertAllowed = -1; /* return to "check" state */ else LocalXLogInsertAllowed = 0; /* never again write WAL */ } @@ -9965,7 +9964,7 @@ xlog_outrec(StringInfo buf, XLogReaderState *record) appendStringInfoString(buf, " FPW"); } } -#endif /* WAL_DEBUG */ +#endif /* WAL_DEBUG */ /* * Returns a string describing an XLogRecord, consisting of its identity diff --git a/src/backend/access/transam/xloginsert.c b/src/backend/access/transam/xloginsert.c index 6a02738479..c9cc6636d3 100644 --- a/src/backend/access/transam/xloginsert.c +++ b/src/backend/access/transam/xloginsert.c @@ -61,9 +61,9 @@ typedef struct } registered_buffer; static registered_buffer *registered_buffers; -static int max_registered_buffers; /* allocated size */ -static int max_registered_block_id = 0; /* highest block_id + 1 - * currently registered */ +static int max_registered_buffers; /* allocated size */ +static int max_registered_block_id = 0; /* highest block_id + 1 currently + * registered */ /* * A chain of XLogRecDatas to hold the "main data" of a WAL record, registered @@ -438,7 +438,7 @@ XLogInsert(RmgrId rmid, uint8 info) if (IsBootstrapProcessingMode() && rmid != RM_XLOG_ID) { XLogResetInsertion(); - EndPos = SizeOfXLogLongPHD; /* start of 1st chkpt record */ + EndPos = SizeOfXLogLongPHD; /* start of 1st chkpt record */ return EndPos; } diff --git a/src/backend/access/transam/xlogreader.c b/src/backend/access/transam/xlogreader.c index c3b1371764..d6b857f109 100644 --- a/src/backend/access/transam/xlogreader.c +++ b/src/backend/access/transam/xlogreader.c @@ -974,7 +974,7 @@ out: return found; } -#endif /* FRONTEND */ +#endif /* FRONTEND */ /* ---------------------------------------- diff --git a/src/backend/bootstrap/bootstrap.c b/src/backend/bootstrap/bootstrap.c index d2708cb33e..b9573973d2 100644 --- a/src/backend/bootstrap/bootstrap.c +++ b/src/backend/bootstrap/bootstrap.c @@ -46,7 +46,7 @@ #include "utils/relmapper.h" #include "utils/tqual.h" -uint32 bootstrap_data_checksum_version = 0; /* No checksum */ +uint32 bootstrap_data_checksum_version = 0; /* No checksum */ #define ALLOC(t, c) \ @@ -163,7 +163,7 @@ static struct typmap *Ap = NULL; static Datum values[MAXATTR]; /* current row's attribute values */ static bool Nulls[MAXATTR]; -static MemoryContext nogc = NULL; /* special no-gc mem context */ +static MemoryContext nogc = NULL; /* special no-gc mem context */ /* * At bootstrap time, we first declare all the indices to be built, and @@ -680,7 +680,7 @@ DefineAttr(char *name, char *type, int attnum, int nullness) namestrcpy(&attrtypes[attnum]->attname, name); elog(DEBUG4, "column %s %s", NameStr(attrtypes[attnum]->attname), type); - attrtypes[attnum]->attnum = attnum + 1; /* fillatt */ + attrtypes[attnum]->attnum = attnum + 1; /* fillatt */ typeoid = gettype(type); diff --git a/src/backend/catalog/aclchk.c b/src/backend/catalog/aclchk.c index 304e3c4bc3..de0a1ba833 100644 --- a/src/backend/catalog/aclchk.c +++ b/src/backend/catalog/aclchk.c @@ -157,7 +157,7 @@ dumpacl(Acl *acl) DatumGetCString(DirectFunctionCall1(aclitemout, PointerGetDatum(aip + i)))); } -#endif /* ACLDEBUG */ +#endif /* ACLDEBUG */ /* diff --git a/src/backend/catalog/dependency.c b/src/backend/catalog/dependency.c index cd82cb9f29..b12b36ed34 100644 --- a/src/backend/catalog/dependency.c +++ b/src/backend/catalog/dependency.c @@ -97,12 +97,12 @@ typedef struct } ObjectAddressExtra; /* ObjectAddressExtra flag bits */ -#define DEPFLAG_ORIGINAL 0x0001 /* an original deletion target */ -#define DEPFLAG_NORMAL 0x0002 /* reached via normal dependency */ -#define DEPFLAG_AUTO 0x0004 /* reached via auto dependency */ -#define DEPFLAG_INTERNAL 0x0008 /* reached via internal dependency */ -#define DEPFLAG_EXTENSION 0x0010 /* reached via extension dependency */ -#define DEPFLAG_REVERSE 0x0020 /* reverse internal/extension link */ +#define DEPFLAG_ORIGINAL 0x0001 /* an original deletion target */ +#define DEPFLAG_NORMAL 0x0002 /* reached via normal dependency */ +#define DEPFLAG_AUTO 0x0004 /* reached via auto dependency */ +#define DEPFLAG_INTERNAL 0x0008 /* reached via internal dependency */ +#define DEPFLAG_EXTENSION 0x0010 /* reached via extension dependency */ +#define DEPFLAG_REVERSE 0x0020 /* reverse internal/extension link */ /* expansible list of ObjectAddresses */ @@ -150,7 +150,7 @@ static const Oid object_classes[] = { OperatorClassRelationId, /* OCLASS_OPCLASS */ OperatorFamilyRelationId, /* OCLASS_OPFAMILY */ AccessMethodRelationId, /* OCLASS_AM */ - AccessMethodOperatorRelationId, /* OCLASS_AMOP */ + AccessMethodOperatorRelationId, /* OCLASS_AMOP */ AccessMethodProcedureRelationId, /* OCLASS_AMPROC */ RewriteRelationId, /* OCLASS_REWRITE */ TriggerRelationId, /* OCLASS_TRIGGER */ @@ -163,7 +163,7 @@ static const Oid object_classes[] = { AuthIdRelationId, /* OCLASS_ROLE */ DatabaseRelationId, /* OCLASS_DATABASE */ TableSpaceRelationId, /* OCLASS_TBLSPACE */ - ForeignDataWrapperRelationId, /* OCLASS_FDW */ + ForeignDataWrapperRelationId, /* OCLASS_FDW */ ForeignServerRelationId, /* OCLASS_FOREIGN_SERVER */ UserMappingRelationId, /* OCLASS_USER_MAPPING */ DefaultAclRelationId, /* OCLASS_DEFACL */ @@ -399,7 +399,7 @@ performMultipleDeletions(const ObjectAddresses *objects, findDependentObjects(thisobj, DEPFLAG_ORIGINAL, flags, - NULL, /* empty stack */ + NULL, /* empty stack */ targetObjects, objects, &depRel); @@ -1405,7 +1405,7 @@ recordDependencyOnSingleRelExpr(const ObjectAddress *depender, rte.type = T_RangeTblEntry; rte.rtekind = RTE_RELATION; rte.relid = relId; - rte.relkind = RELKIND_RELATION; /* no need for exactness here */ + rte.relkind = RELKIND_RELATION; /* no need for exactness here */ context.rtables = list_make1(list_make1(&rte)); @@ -1871,7 +1871,7 @@ find_expr_references_walker(Node *node, TargetEntry *tle = (TargetEntry *) lfirst(lc); if (tle->resjunk) - continue; /* ignore junk tlist items */ + continue; /* ignore junk tlist items */ add_object_address(OCLASS_CLASS, rte->relid, tle->resno, context->addrs); } diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c index 4e5b79ef94..8052dcc288 100644 --- a/src/backend/catalog/heap.c +++ b/src/backend/catalog/heap.c @@ -950,25 +950,25 @@ AddNewRelationType(const char *typeName, return TypeCreate(new_row_type, /* optional predetermined OID */ typeName, /* type name */ - typeNamespace, /* type namespace */ + typeNamespace, /* type namespace */ new_rel_oid, /* relation oid */ new_rel_kind, /* relation kind */ ownerid, /* owner's ID */ -1, /* internal size (varlena) */ TYPTYPE_COMPOSITE, /* type-type (composite) */ - TYPCATEGORY_COMPOSITE, /* type-category (ditto) */ + TYPCATEGORY_COMPOSITE, /* type-category (ditto) */ false, /* composite types are never preferred */ DEFAULT_TYPDELIM, /* default array delimiter */ F_RECORD_IN, /* input procedure */ F_RECORD_OUT, /* output procedure */ - F_RECORD_RECV, /* receive procedure */ - F_RECORD_SEND, /* send procedure */ + F_RECORD_RECV, /* receive procedure */ + F_RECORD_SEND, /* send procedure */ InvalidOid, /* typmodin procedure - none */ InvalidOid, /* typmodout procedure - none */ InvalidOid, /* analyze procedure - default */ InvalidOid, /* array element type - irrelevant */ false, /* this is not an array type */ - new_array_type, /* array type if any */ + new_array_type, /* array type if any */ InvalidOid, /* domain base type - irrelevant */ NULL, /* default value - none */ NULL, /* default binary representation */ @@ -1218,7 +1218,7 @@ heap_create_with_catalog(const char *relname, relarrayname = makeArrayTypeName(relname, relnamespace); - TypeCreate(new_array_oid, /* force the type's OID to this */ + TypeCreate(new_array_oid, /* force the type's OID to this */ relarrayname, /* Array type name */ relnamespace, /* Same namespace as parent */ InvalidOid, /* Not composite, no relationOid */ @@ -1560,7 +1560,7 @@ RemoveAttributeById(Oid relid, AttrNumber attnum) tuple = SearchSysCacheCopy2(ATTNUM, ObjectIdGetDatum(relid), Int16GetDatum(attnum)); - if (!HeapTupleIsValid(tuple)) /* shouldn't happen */ + if (!HeapTupleIsValid(tuple)) /* shouldn't happen */ elog(ERROR, "cache lookup failed for attribute %d of relation %u", attnum, relid); attStruct = (Form_pg_attribute) GETSTRUCT(tuple); @@ -1725,7 +1725,7 @@ RemoveAttrDefaultById(Oid attrdefId) tuple = SearchSysCacheCopy2(ATTNUM, ObjectIdGetDatum(myrelid), Int16GetDatum(myattnum)); - if (!HeapTupleIsValid(tuple)) /* shouldn't happen */ + if (!HeapTupleIsValid(tuple)) /* shouldn't happen */ elog(ERROR, "cache lookup failed for attribute %d of relation %u", myattnum, myrelid); @@ -2083,7 +2083,7 @@ StoreRelCheck(Relation rel, char *ccname, Node *expr, */ constrOid = CreateConstraintEntry(ccname, /* Constraint Name */ - RelationGetNamespace(rel), /* namespace */ + RelationGetNamespace(rel), /* namespace */ CONSTRAINT_CHECK, /* Constraint Type */ false, /* Is Deferrable */ false, /* Is Deferred */ @@ -2091,9 +2091,9 @@ StoreRelCheck(Relation rel, char *ccname, Node *expr, RelationGetRelid(rel), /* relation */ attNos, /* attrs in the constraint */ keycount, /* # attrs in the constraint */ - InvalidOid, /* not a domain constraint */ - InvalidOid, /* no associated index */ - InvalidOid, /* Foreign key fields */ + InvalidOid, /* not a domain constraint */ + InvalidOid, /* no associated index */ + InvalidOid, /* Foreign key fields */ NULL, NULL, NULL, @@ -2102,14 +2102,14 @@ StoreRelCheck(Relation rel, char *ccname, Node *expr, ' ', ' ', ' ', - NULL, /* not an exclusion constraint */ - expr, /* Tree form of check constraint */ + NULL, /* not an exclusion constraint */ + expr, /* Tree form of check constraint */ ccbin, /* Binary form of check constraint */ ccsrc, /* Source form of check constraint */ is_local, /* conislocal */ inhcount, /* coninhcount */ is_no_inherit, /* connoinherit */ - is_internal); /* internally constructed? */ + is_internal); /* internally constructed? */ pfree(ccbin); pfree(ccsrc); diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c index 8a77444000..549a2d19c6 100644 --- a/src/backend/catalog/index.c +++ b/src/backend/catalog/index.c @@ -158,7 +158,7 @@ relationHasPrimaryKey(Relation rel) HeapTuple indexTuple; indexTuple = SearchSysCache1(INDEXRELID, ObjectIdGetDatum(indexoid)); - if (!HeapTupleIsValid(indexTuple)) /* should not happen */ + if (!HeapTupleIsValid(indexTuple)) /* should not happen */ elog(ERROR, "cache lookup failed for index %u", indexoid); result = ((Form_pg_index) GETSTRUCT(indexTuple))->indisprimary; ReleaseSysCache(indexTuple); @@ -332,7 +332,7 @@ ConstructTupleDescriptor(Relation heapRelation, /* * here we are indexing on a normal attribute (1...n) */ - if (atnum > natts) /* safety check */ + if (atnum > natts) /* safety check */ elog(ERROR, "invalid column number %d", atnum); from = heapTupDesc->attrs[AttrNumberGetAttrOffset(atnum)]; } @@ -420,7 +420,7 @@ ConstructTupleDescriptor(Relation heapRelation, /* * Set the attribute name as specified by caller. */ - if (colnames_item == NULL) /* shouldn't happen */ + if (colnames_item == NULL) /* shouldn't happen */ elog(ERROR, "too few entries in colnames list"); namestrcpy(&to->attname, (const char *) lfirst(colnames_item)); colnames_item = lnext(colnames_item); @@ -954,7 +954,7 @@ index_create(Relation heapRelation, else { elog(ERROR, "constraint must be PRIMARY, UNIQUE or EXCLUDE"); - constraintType = 0; /* keep compiler quiet */ + constraintType = 0; /* keep compiler quiet */ } index_constraint_create(heapRelation, @@ -964,9 +964,9 @@ index_create(Relation heapRelation, constraintType, deferrable, initdeferred, - false, /* already marked primary */ - false, /* pg_index entry is OK */ - false, /* no old dependencies */ + false, /* already marked primary */ + false, /* pg_index entry is OK */ + false, /* no old dependencies */ allow_system_table_mods, is_internal); } @@ -1205,7 +1205,7 @@ index_constraint_create(Relation heapRelation, indexInfo->ii_KeyAttrNumbers, indexInfo->ii_NumIndexAttrs, InvalidOid, /* no domain */ - indexRelationId, /* index OID */ + indexRelationId, /* index OID */ InvalidOid, /* no foreign key */ NULL, NULL, @@ -1216,12 +1216,12 @@ index_constraint_create(Relation heapRelation, ' ', ' ', indexInfo->ii_ExclusionOps, - NULL, /* no check constraint */ + NULL, /* no check constraint */ NULL, NULL, - true, /* islocal */ + true, /* islocal */ 0, /* inhcount */ - true, /* noinherit */ + true, /* noinherit */ is_internal); /* @@ -2259,7 +2259,7 @@ IndexBuildHeapRangeScan(Relation heapRelation, if (IsBootstrapProcessingMode() || indexInfo->ii_Concurrent) { snapshot = RegisterSnapshot(GetTransactionSnapshot()); - OldestXmin = InvalidTransactionId; /* not used */ + OldestXmin = InvalidTransactionId; /* not used */ /* "any visible" mode is not compatible with this */ Assert(!anyvisible); @@ -2272,8 +2272,8 @@ IndexBuildHeapRangeScan(Relation heapRelation, } scan = heap_beginscan_strat(heapRelation, /* relation */ - snapshot, /* snapshot */ - 0, /* number of keys */ + snapshot, /* snapshot */ + 0, /* number of keys */ NULL, /* scan key */ true, /* buffer access strategy OK */ allow_sync); /* syncscan OK? */ @@ -2524,7 +2524,7 @@ IndexBuildHeapRangeScan(Relation heapRelation, break; default: elog(ERROR, "unexpected HeapTupleSatisfiesVacuum result"); - indexIt = tupleIsAlive = false; /* keep compiler quiet */ + indexIt = tupleIsAlive = false; /* keep compiler quiet */ break; } @@ -2677,8 +2677,8 @@ IndexCheckExclusion(Relation heapRelation, */ snapshot = RegisterSnapshot(GetLatestSnapshot()); scan = heap_beginscan_strat(heapRelation, /* relation */ - snapshot, /* snapshot */ - 0, /* number of keys */ + snapshot, /* snapshot */ + 0, /* number of keys */ NULL, /* scan key */ true, /* buffer access strategy OK */ true); /* syncscan OK */ @@ -2997,8 +2997,8 @@ validate_index_heapscan(Relation heapRelation, * match the sorted TIDs. */ scan = heap_beginscan_strat(heapRelation, /* relation */ - snapshot, /* snapshot */ - 0, /* number of keys */ + snapshot, /* snapshot */ + 0, /* number of keys */ NULL, /* scan key */ true, /* buffer access strategy OK */ false); /* syncscan not OK */ diff --git a/src/backend/catalog/indexing.c b/src/backend/catalog/indexing.c index abc344ad69..e5b6bafaff 100644 --- a/src/backend/catalog/indexing.c +++ b/src/backend/catalog/indexing.c @@ -42,7 +42,7 @@ CatalogOpenIndexes(Relation heapRel) ResultRelInfo *resultRelInfo; resultRelInfo = makeNode(ResultRelInfo); - resultRelInfo->ri_RangeTableIndex = 1; /* dummy */ + resultRelInfo->ri_RangeTableIndex = 1; /* dummy */ resultRelInfo->ri_RelationDesc = heapRel; resultRelInfo->ri_TrigDesc = NULL; /* we don't fire triggers */ @@ -136,7 +136,7 @@ CatalogIndexInsert(CatalogIndexState indstate, HeapTuple heapTuple) index_insert(relationDescs[i], /* index relation */ values, /* array of index Datums */ isnull, /* is-null flags */ - &(heapTuple->t_self), /* tid of heap tuple */ + &(heapTuple->t_self), /* tid of heap tuple */ heapRelation, relationDescs[i]->rd_index->indisunique ? UNIQUE_CHECK_YES : UNIQUE_CHECK_NO, diff --git a/src/backend/catalog/namespace.c b/src/backend/catalog/namespace.c index 94755d687b..2938501917 100644 --- a/src/backend/catalog/namespace.c +++ b/src/backend/catalog/namespace.c @@ -157,7 +157,7 @@ static bool baseSearchPathValid = true; typedef struct { List *searchPath; /* the desired search path */ - Oid creationNamespace; /* the desired creation namespace */ + Oid creationNamespace; /* the desired creation namespace */ int nestLevel; /* subtransaction nesting level */ } OverrideStackEntry; @@ -273,7 +273,7 @@ RangeVarGetRelidExtended(const RangeVar *relation, LOCKMODE lockmode, if (relation->relpersistence == RELPERSISTENCE_TEMP) { if (!OidIsValid(myTempNamespace)) - relId = InvalidOid; /* this probably can't happen? */ + relId = InvalidOid; /* this probably can't happen? */ else { if (relation->schemaname) @@ -1665,7 +1665,7 @@ OpernameGetCandidates(List *names, char oprkind, bool missing_schema_ok) /* We have a match with a previous result */ Assert(pathpos != prevResult->pathpos); if (pathpos > prevResult->pathpos) - continue; /* keep previous result */ + continue; /* keep previous result */ /* replace previous result */ prevResult->pathpos = pathpos; prevResult->oid = HeapTupleGetOid(opertup); @@ -3428,7 +3428,7 @@ PopOverrideSearchPath(void) entry = (OverrideStackEntry *) linitial(overrideStack); activeSearchPath = entry->searchPath; activeCreationNamespace = entry->creationNamespace; - activeTempCreationPending = false; /* XXX is this OK? */ + activeTempCreationPending = false; /* XXX is this OK? */ } else { @@ -3876,7 +3876,7 @@ AtEOXact_Namespace(bool isCommit, bool parallel) { myTempNamespace = InvalidOid; myTempToastNamespace = InvalidOid; - baseSearchPathValid = false; /* need to rebuild list */ + baseSearchPathValid = false; /* need to rebuild list */ } myTempNamespaceSubID = InvalidSubTransactionId; } @@ -3928,7 +3928,7 @@ AtEOSubXact_Namespace(bool isCommit, SubTransactionId mySubid, /* TEMP namespace creation failed, so reset state */ myTempNamespace = InvalidOid; myTempToastNamespace = InvalidOid; - baseSearchPathValid = false; /* need to rebuild list */ + baseSearchPathValid = false; /* need to rebuild list */ } } @@ -3953,7 +3953,7 @@ AtEOSubXact_Namespace(bool isCommit, SubTransactionId mySubid, entry = (OverrideStackEntry *) linitial(overrideStack); activeSearchPath = entry->searchPath; activeCreationNamespace = entry->creationNamespace; - activeTempCreationPending = false; /* XXX is this OK? */ + activeTempCreationPending = false; /* XXX is this OK? */ } else { diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index 791322a803..b882d5f0e1 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -97,19 +97,18 @@ typedef struct Oid class_oid; /* oid of catalog */ Oid oid_index_oid; /* oid of index on system oid column */ int oid_catcache_id; /* id of catcache on system oid column */ - int name_catcache_id; /* id of catcache on (name,namespace), - * or (name) if the object does not - * live in a namespace */ + int name_catcache_id; /* id of catcache on (name,namespace), or + * (name) if the object does not live in a + * namespace */ AttrNumber attnum_name; /* attnum of name field */ - AttrNumber attnum_namespace; /* attnum of namespace field */ + AttrNumber attnum_namespace; /* attnum of namespace field */ AttrNumber attnum_owner; /* attnum of owner field */ AttrNumber attnum_acl; /* attnum of acl field */ AclObjectKind acl_kind; /* ACL_KIND_* of this object type */ - bool is_nsp_name_unique; /* can the nsp/name combination (or - * name alone, if there's no - * namespace) be considered a unique - * identifier for an object of this - * class? */ + bool is_nsp_name_unique; /* can the nsp/name combination (or name + * alone, if there's no namespace) be + * considered a unique identifier for an + * object of this class? */ } ObjectPropertyType; static const ObjectPropertyType ObjectProperty[] = diff --git a/src/backend/catalog/partition.c b/src/backend/catalog/partition.c index b9cca29ea3..e563b8548b 100644 --- a/src/backend/catalog/partition.c +++ b/src/backend/catalog/partition.c @@ -1553,7 +1553,7 @@ get_qual_for_range(PartitionKey key, PartitionBoundSpec *spec) */ i = 0; partexprs_item = list_head(key->partexprs); - partexprs_item_saved = partexprs_item; /* placate compiler */ + partexprs_item_saved = partexprs_item; /* placate compiler */ forboth(cell1, spec->lowerdatums, cell2, spec->upperdatums) { EState *estate; diff --git a/src/backend/catalog/pg_aggregate.c b/src/backend/catalog/pg_aggregate.c index 65c2e88e93..aa45c141a4 100644 --- a/src/backend/catalog/pg_aggregate.c +++ b/src/backend/catalog/pg_aggregate.c @@ -83,9 +83,9 @@ AggregateCreate(const char *aggName, Oid finalfn = InvalidOid; /* can be omitted */ Oid combinefn = InvalidOid; /* can be omitted */ Oid serialfn = InvalidOid; /* can be omitted */ - Oid deserialfn = InvalidOid; /* can be omitted */ + Oid deserialfn = InvalidOid; /* can be omitted */ Oid mtransfn = InvalidOid; /* can be omitted */ - Oid minvtransfn = InvalidOid; /* can be omitted */ + Oid minvtransfn = InvalidOid; /* can be omitted */ Oid mfinalfn = InvalidOid; /* can be omitted */ Oid sortop = InvalidOid; /* can be omitted */ Oid *aggArgTypes = parameterTypes->values; @@ -605,30 +605,30 @@ AggregateCreate(const char *aggName, myself = ProcedureCreate(aggName, aggNamespace, - false, /* no replacement */ - false, /* doesn't return a set */ + false, /* no replacement */ + false, /* doesn't return a set */ finaltype, /* returnType */ - GetUserId(), /* proowner */ - INTERNALlanguageId, /* languageObjectId */ - InvalidOid, /* no validator */ + GetUserId(), /* proowner */ + INTERNALlanguageId, /* languageObjectId */ + InvalidOid, /* no validator */ "aggregate_dummy", /* placeholder proc */ - NULL, /* probin */ - true, /* isAgg */ - false, /* isWindowFunc */ - false, /* security invoker (currently not - * definable for agg) */ - false, /* isLeakProof */ - false, /* isStrict (not needed for agg) */ - PROVOLATILE_IMMUTABLE, /* volatility (not - * needed for agg) */ + NULL, /* probin */ + true, /* isAgg */ + false, /* isWindowFunc */ + false, /* security invoker (currently not + * definable for agg) */ + false, /* isLeakProof */ + false, /* isStrict (not needed for agg) */ + PROVOLATILE_IMMUTABLE, /* volatility (not needed + * for agg) */ proparallel, parameterTypes, /* paramTypes */ allParameterTypes, /* allParamTypes */ parameterModes, /* parameterModes */ parameterNames, /* parameterNames */ parameterDefaults, /* parameterDefaults */ - PointerGetDatum(NULL), /* trftypes */ - PointerGetDatum(NULL), /* proconfig */ + PointerGetDatum(NULL), /* trftypes */ + PointerGetDatum(NULL), /* proconfig */ 1, /* procost */ 0); /* prorows */ procOid = myself.objectId; diff --git a/src/backend/catalog/pg_constraint.c b/src/backend/catalog/pg_constraint.c index e5ae3d9292..60ccaa08b0 100644 --- a/src/backend/catalog/pg_constraint.c +++ b/src/backend/catalog/pg_constraint.c @@ -576,7 +576,7 @@ RemoveConstraintById(Oid conId) con->conrelid); classForm = (Form_pg_class) GETSTRUCT(relTup); - if (classForm->relchecks == 0) /* should not happen */ + if (classForm->relchecks == 0) /* should not happen */ elog(ERROR, "relation \"%s\" has relchecks = 0", RelationGetRelationName(rel)); classForm->relchecks--; @@ -928,7 +928,7 @@ get_primary_key_attnos(Oid relid, bool deferrableOk, Oid *constraintOid) if (isNull) elog(ERROR, "null conkey for constraint %u", HeapTupleGetOid(tuple)); - arr = DatumGetArrayTypeP(adatum); /* ensure not toasted */ + arr = DatumGetArrayTypeP(adatum); /* ensure not toasted */ numkeys = ARR_DIMS(arr)[0]; if (ARR_NDIM(arr) != 1 || numkeys < 0 || diff --git a/src/backend/catalog/pg_operator.c b/src/backend/catalog/pg_operator.c index b5cbc04889..370683823f 100644 --- a/src/backend/catalog/pg_operator.c +++ b/src/backend/catalog/pg_operator.c @@ -225,7 +225,7 @@ OperatorShellMake(const char *operatorName, for (i = 0; i < Natts_pg_operator; ++i) { nulls[i] = false; - values[i] = (Datum) NULL; /* redundant, but safe */ + values[i] = (Datum) NULL; /* redundant, but safe */ } /* diff --git a/src/backend/catalog/pg_type.c b/src/backend/catalog/pg_type.c index 6b0e4f4729..6172973343 100644 --- a/src/backend/catalog/pg_type.c +++ b/src/backend/catalog/pg_type.c @@ -79,7 +79,7 @@ TypeShellMake(const char *typeName, Oid typeNamespace, Oid ownerId) for (i = 0; i < Natts_pg_type; ++i) { nulls[i] = false; - values[i] = (Datum) NULL; /* redundant, but safe */ + values[i] = (Datum) NULL; /* redundant, but safe */ } /* @@ -214,7 +214,7 @@ TypeCreate(Oid newTypeOid, bool isImplicitArray, Oid arrayType, Oid baseType, - const char *defaultTypeValue, /* human readable rep */ + const char *defaultTypeValue, /* human readable rep */ char *defaultTypeBin, /* cooked rep */ bool passedByValue, char alignment, @@ -511,8 +511,8 @@ TypeCreate(Oid newTypeOid, void GenerateTypeDependencies(Oid typeNamespace, Oid typeObjectId, - Oid relationOid, /* only for relation rowtypes */ - char relationKind, /* ditto */ + Oid relationOid, /* only for relation rowtypes */ + char relationKind, /* ditto */ Oid owner, Oid inputProcedure, Oid outputProcedure, diff --git a/src/backend/catalog/storage.c b/src/backend/catalog/storage.c index f677916d03..9a5fde00ca 100644 --- a/src/backend/catalog/storage.c +++ b/src/backend/catalog/storage.c @@ -58,7 +58,7 @@ typedef struct PendingRelDelete BackendId backend; /* InvalidBackendId if not a temp rel */ bool atCommit; /* T=delete at commit; F=delete at abort */ int nestLevel; /* xact nesting level of request */ - struct PendingRelDelete *next; /* linked-list link */ + struct PendingRelDelete *next; /* linked-list link */ } PendingRelDelete; static PendingRelDelete *pendingDeletes = NULL; /* head of linked list */ diff --git a/src/backend/commands/aggregatecmds.c b/src/backend/commands/aggregatecmds.c index a84c61493f..b204b19c72 100644 --- a/src/backend/commands/aggregatecmds.c +++ b/src/backend/commands/aggregatecmds.c @@ -416,8 +416,8 @@ DefineAggregate(ParseState *pstate, List *name, List *args, bool oldstyle, List /* * Most of the argument-checking is done inside of AggregateCreate */ - return AggregateCreate(aggName, /* aggregate name */ - aggNamespace, /* namespace */ + return AggregateCreate(aggName, /* aggregate name */ + aggNamespace, /* namespace */ aggKind, numArgs, numDirectArgs, @@ -427,22 +427,22 @@ DefineAggregate(ParseState *pstate, List *name, List *args, bool oldstyle, List PointerGetDatum(parameterNames), parameterDefaults, variadicArgType, - transfuncName, /* step function name */ - finalfuncName, /* final function name */ - combinefuncName, /* combine function name */ - serialfuncName, /* serial function name */ + transfuncName, /* step function name */ + finalfuncName, /* final function name */ + combinefuncName, /* combine function name */ + serialfuncName, /* serial function name */ deserialfuncName, /* deserial function name */ - mtransfuncName, /* fwd trans function name */ + mtransfuncName, /* fwd trans function name */ minvtransfuncName, /* inv trans function name */ - mfinalfuncName, /* final function name */ + mfinalfuncName, /* final function name */ finalfuncExtraArgs, mfinalfuncExtraArgs, sortoperatorName, /* sort operator name */ transTypeId, /* transition data type */ transSpace, /* transition space */ - mtransTypeId, /* transition data type */ + mtransTypeId, /* transition data type */ mtransSpace, /* transition space */ - initval, /* initial condition */ + initval, /* initial condition */ minitval, /* initial condition */ - proparallel); /* parallel safe? */ + proparallel); /* parallel safe? */ } diff --git a/src/backend/commands/alter.c b/src/backend/commands/alter.c index 4d3fe8c745..e5f0b75a86 100644 --- a/src/backend/commands/alter.c +++ b/src/backend/commands/alter.c @@ -408,7 +408,7 @@ ExecRenameStmt(RenameStmt *stmt) default: elog(ERROR, "unrecognized rename stmt type: %d", (int) stmt->renameType); - return InvalidObjectAddress; /* keep compiler happy */ + return InvalidObjectAddress; /* keep compiler happy */ } } @@ -525,7 +525,7 @@ ExecAlterObjectSchemaStmt(AlterObjectSchemaStmt *stmt, default: elog(ERROR, "unrecognized AlterObjectSchemaStmt type: %d", (int) stmt->objectType); - return InvalidObjectAddress; /* keep compiler happy */ + return InvalidObjectAddress; /* keep compiler happy */ } if (oldSchemaAddr) @@ -880,7 +880,7 @@ ExecAlterOwnerStmt(AlterOwnerStmt *stmt) default: elog(ERROR, "unrecognized AlterOwnerStmt type: %d", (int) stmt->objectType); - return InvalidObjectAddress; /* keep compiler happy */ + return InvalidObjectAddress; /* keep compiler happy */ } } diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c index ecdd8950ee..a19c6c25e6 100644 --- a/src/backend/commands/analyze.c +++ b/src/backend/commands/analyze.c @@ -452,7 +452,7 @@ do_analyze_rel(Relation onerel, int options, VacuumParams *params, /* Found an index expression */ Node *indexkey; - if (indexpr_item == NULL) /* shouldn't happen */ + if (indexpr_item == NULL) /* shouldn't happen */ elog(ERROR, "too few entries in indexprs list"); indexkey = (Node *) lfirst(indexpr_item); indexpr_item = lnext(indexpr_item); @@ -1545,7 +1545,7 @@ update_attstats(Oid relid, bool inh, int natts, VacAttrStats **vacattrstats) i = Anum_pg_statistic_stakind1 - 1; for (k = 0; k < STATISTIC_NUM_SLOTS; k++) { - values[i++] = Int16GetDatum(stats->stakind[k]); /* stakindN */ + values[i++] = Int16GetDatum(stats->stakind[k]); /* stakindN */ } i = Anum_pg_statistic_staop1 - 1; for (k = 0; k < STATISTIC_NUM_SLOTS; k++) @@ -1860,7 +1860,7 @@ compute_trivial_stats(VacAttrStatsP stats, stats->stawidth = total_width / (double) nonnull_cnt; else stats->stawidth = stats->attrtype->typlen; - stats->stadistinct = 0.0; /* "unknown" */ + stats->stadistinct = 0.0; /* "unknown" */ } else if (null_cnt > 0) { @@ -1871,7 +1871,7 @@ compute_trivial_stats(VacAttrStatsP stats, stats->stawidth = 0; /* "unknown" */ else stats->stawidth = stats->attrtype->typlen; - stats->stadistinct = 0.0; /* "unknown" */ + stats->stadistinct = 0.0; /* "unknown" */ } } @@ -2224,7 +2224,7 @@ compute_distinct_stats(VacAttrStatsP stats, stats->stawidth = 0; /* "unknown" */ else stats->stawidth = stats->attrtype->typlen; - stats->stadistinct = 0.0; /* "unknown" */ + stats->stadistinct = 0.0; /* "unknown" */ } /* We don't need to bother cleaning up any of our temporary palloc's */ @@ -2774,7 +2774,7 @@ compute_scalar_stats(VacAttrStatsP stats, stats->stawidth = 0; /* "unknown" */ else stats->stawidth = stats->attrtype->typlen; - stats->stadistinct = 0.0; /* "unknown" */ + stats->stadistinct = 0.0; /* "unknown" */ } /* We don't need to bother cleaning up any of our temporary palloc's */ diff --git a/src/backend/commands/async.c b/src/backend/commands/async.c index 87b215d8d3..9befe0492a 100644 --- a/src/backend/commands/async.c +++ b/src/backend/commands/async.c @@ -245,7 +245,7 @@ typedef struct AsyncQueueControl QueuePosition head; /* head points to the next free location */ QueuePosition tail; /* the global tail is equivalent to the pos of * the "slowest" backend */ - TimestampTz lastQueueFillWarn; /* time of last queue-full msg */ + TimestampTz lastQueueFillWarn; /* time of last queue-full msg */ QueueBackendStatus backend[FLEXIBLE_ARRAY_MEMBER]; /* backend[0] is not used; used entries are from [1] to [MaxBackends] */ } AsyncQueueControl; @@ -265,7 +265,7 @@ static SlruCtlData AsyncCtlData; #define AsyncCtl (&AsyncCtlData) #define QUEUE_PAGESIZE BLCKSZ -#define QUEUE_FULL_WARN_INTERVAL 5000 /* warn at most once every 5s */ +#define QUEUE_FULL_WARN_INTERVAL 5000 /* warn at most once every 5s */ /* * slru.c currently assumes that all filenames are four characters of hex @@ -291,7 +291,7 @@ static SlruCtlData AsyncCtlData; * (ie, have committed a LISTEN on). It is a simple list of channel names, * allocated in TopMemoryContext. */ -static List *listenChannels = NIL; /* list of C strings */ +static List *listenChannels = NIL; /* list of C strings */ /* * State for pending LISTEN/UNLISTEN actions consists of an ordered list of @@ -316,7 +316,7 @@ typedef struct char channel[FLEXIBLE_ARRAY_MEMBER]; /* nul-terminated string */ } ListenAction; -static List *pendingActions = NIL; /* list of ListenAction */ +static List *pendingActions = NIL; /* list of ListenAction */ static List *upperPendingActions = NIL; /* list of upper-xact lists */ @@ -342,9 +342,9 @@ typedef struct Notification char *payload; /* payload string (can be empty) */ } Notification; -static List *pendingNotifies = NIL; /* list of Notifications */ +static List *pendingNotifies = NIL; /* list of Notifications */ -static List *upperPendingNotifies = NIL; /* list of upper-xact lists */ +static List *upperPendingNotifies = NIL; /* list of upper-xact lists */ /* * Inbound notifications are initially processed by HandleNotifyInterrupt(), @@ -1184,7 +1184,7 @@ asyncQueueUnregister(void) { bool advanceTail; - Assert(listenChannels == NIL); /* else caller error */ + Assert(listenChannels == NIL); /* else caller error */ if (!amRegisteredListener) /* nothing to do */ return; @@ -1825,7 +1825,7 @@ asyncQueueReadAllNotifications(void) /* we only want to read as far as head */ copysize = QUEUE_POS_OFFSET(head) - curoffset; if (copysize < 0) - copysize = 0; /* just for safety */ + copysize = 0; /* just for safety */ } else { diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index ef1abf34ab..1cc5309426 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -325,7 +325,7 @@ cluster_rel(Oid tableOid, Oid indexOid, bool recheck, bool verbose) * Check that the index is still the one with indisclustered set. */ tuple = SearchSysCache1(INDEXRELID, ObjectIdGetDatum(indexOid)); - if (!HeapTupleIsValid(tuple)) /* probably can't happen */ + if (!HeapTupleIsValid(tuple)) /* probably can't happen */ { relation_close(OldHeap, AccessExclusiveLock); return; diff --git a/src/backend/commands/collationcmds.c b/src/backend/commands/collationcmds.c index 91b65b174d..e805b7cfc4 100644 --- a/src/backend/commands/collationcmds.c +++ b/src/backend/commands/collationcmds.c @@ -417,7 +417,7 @@ get_icu_locale_comment(const char *localename) return result; } -#endif /* USE_ICU */ +#endif /* USE_ICU */ Datum @@ -552,7 +552,7 @@ pg_import_system_collations(PG_FUNCTION_ARGS) if (count == 0) ereport(WARNING, (errmsg("no usable system locales were found"))); -#endif /* not HAVE_LOCALE_T && not WIN32 */ +#endif /* not HAVE_LOCALE_T && not WIN32 */ #ifdef USE_ICU if (!is_encoding_supported_by_icu(GetDatabaseEncoding())) diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c index ff32d04189..ec6011cdb8 100644 --- a/src/backend/commands/copy.c +++ b/src/backend/commands/copy.c @@ -102,7 +102,7 @@ typedef struct CopyStateData bool fe_eof; /* true if detected end of copy data */ EolType eol_type; /* EOL type of input */ int file_encoding; /* file or remote side's character encoding */ - bool need_transcoding; /* file encoding diff from server? */ + bool need_transcoding; /* file encoding diff from server? */ bool encoding_embeds_ascii; /* ASCII can be non-first byte? */ /* parameters from the COPY command */ @@ -119,17 +119,17 @@ typedef struct CopyStateData bool header_line; /* CSV header line? */ char *null_print; /* NULL marker string (server encoding!) */ int null_print_len; /* length of same */ - char *null_print_client; /* same converted to file encoding */ + char *null_print_client; /* same converted to file encoding */ char *delim; /* column delimiter (must be 1 byte) */ char *quote; /* CSV quote char (must be 1 byte) */ char *escape; /* CSV escape char (must be 1 byte) */ List *force_quote; /* list of column names */ bool force_quote_all; /* FORCE_QUOTE *? */ - bool *force_quote_flags; /* per-column CSV FQ flags */ + bool *force_quote_flags; /* per-column CSV FQ flags */ List *force_notnull; /* list of column names */ bool *force_notnull_flags; /* per-column CSV FNN flags */ List *force_null; /* list of column names */ - bool *force_null_flags; /* per-column CSV FN flags */ + bool *force_null_flags; /* per-column CSV FN flags */ bool convert_selectively; /* do selective binary conversion? */ List *convert_select; /* list of column names (can be NIL) */ bool *convert_select_flags; /* per-column CSV/TEXT CS flags */ @@ -162,7 +162,7 @@ typedef struct CopyStateData Oid *typioparams; /* array of element types for in_functions */ int *defmap; /* array of default att numbers */ ExprState **defexprs; /* array of default att expressions */ - bool volatile_defexprs; /* is any of defexprs volatile? */ + bool volatile_defexprs; /* is any of defexprs volatile? */ List *range_table; PartitionDispatch *partition_dispatch_info; @@ -195,7 +195,7 @@ typedef struct CopyStateData * can display it in error messages if appropriate. */ StringInfoData line_buf; - bool line_buf_converted; /* converted to server encoding? */ + bool line_buf_converted; /* converted to server encoding? */ bool line_buf_valid; /* contains the row being processed? */ /* @@ -355,10 +355,10 @@ SendCopyBegin(CopyState cstate) int i; pq_beginmessage(&buf, 'H'); - pq_sendbyte(&buf, format); /* overall format */ + pq_sendbyte(&buf, format); /* overall format */ pq_sendint(&buf, natts, 2); for (i = 0; i < natts; i++) - pq_sendint(&buf, format, 2); /* per-column formats */ + pq_sendint(&buf, format, 2); /* per-column formats */ pq_endmessage(&buf); cstate->copy_dest = COPY_NEW_FE; } @@ -388,10 +388,10 @@ ReceiveCopyBegin(CopyState cstate) int i; pq_beginmessage(&buf, 'G'); - pq_sendbyte(&buf, format); /* overall format */ + pq_sendbyte(&buf, format); /* overall format */ pq_sendint(&buf, natts, 2); for (i = 0; i < natts; i++) - pq_sendint(&buf, format, 2); /* per-column formats */ + pq_sendint(&buf, format, 2); /* per-column formats */ pq_endmessage(&buf); cstate->copy_dest = COPY_NEW_FE; cstate->fe_msgbuf = makeStringInfo(); @@ -609,20 +609,20 @@ CopyGetData(CopyState cstate, void *databuf, int minread, int maxread) RESUME_CANCEL_INTERRUPTS(); switch (mtype) { - case 'd': /* CopyData */ + case 'd': /* CopyData */ break; - case 'c': /* CopyDone */ + case 'c': /* CopyDone */ /* COPY IN correctly terminated by frontend */ cstate->fe_eof = true; return bytesread; - case 'f': /* CopyFail */ + case 'f': /* CopyFail */ ereport(ERROR, (errcode(ERRCODE_QUERY_CANCELED), errmsg("COPY from stdin failed: %s", pq_getmsgstring(cstate->fe_msgbuf)))); break; - case 'H': /* Flush */ - case 'S': /* Sync */ + case 'H': /* Flush */ + case 'S': /* Sync */ /* * Ignore Flush/Sync for the convenience of client @@ -1697,7 +1697,7 @@ BeginCopy(ParseState *pstate, /* See Multibyte encoding comment above */ cstate->encoding_embeds_ascii = PG_ENCODING_IS_CLIENT_ONLY(cstate->file_encoding); - cstate->copy_dest = COPY_FILE; /* default */ + cstate->copy_dest = COPY_FILE; /* default */ MemoryContextSwitchTo(oldcontext); @@ -1951,7 +1951,7 @@ CopyTo(CopyState cstate) tupDesc = cstate->queryDesc->tupDesc; attr = tupDesc->attrs; num_phys_attrs = tupDesc->natts; - cstate->null_print_client = cstate->null_print; /* default */ + cstate->null_print_client = cstate->null_print; /* default */ /* We use fe_msgbuf as a per-row buffer regardless of copy_dest */ cstate->fe_msgbuf = makeStringInfo(); @@ -3707,8 +3707,8 @@ CopyReadLineText(CopyState cstate) if (c == '\n') { - raw_buf_ptr++; /* eat newline */ - cstate->eol_type = EOL_CRNL; /* in case not set yet */ + raw_buf_ptr++; /* eat newline */ + cstate->eol_type = EOL_CRNL; /* in case not set yet */ } else { @@ -4458,7 +4458,7 @@ CopyAttributeOutText(CopyState cstate, char *string) break; /* All ASCII control chars are length 1 */ ptr++; - continue; /* fall to end of loop */ + continue; /* fall to end of loop */ } /* if we get here, we need to convert the control char */ DUMPSOFAR(); @@ -4518,7 +4518,7 @@ CopyAttributeOutText(CopyState cstate, char *string) break; /* All ASCII control chars are length 1 */ ptr++; - continue; /* fall to end of loop */ + continue; /* fall to end of loop */ } /* if we get here, we need to convert the control char */ DUMPSOFAR(); diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c index 11038f6764..96ab6f23cd 100644 --- a/src/backend/commands/dbcommands.c +++ b/src/backend/commands/dbcommands.c @@ -322,7 +322,7 @@ createdb(ParseState *pstate, const CreatedbStmt *stmt) * won't change underneath us. */ if (!dbtemplate) - dbtemplate = "template1"; /* Default template database name */ + dbtemplate = "template1"; /* Default template database name */ if (!get_db_info(dbtemplate, ShareLock, &src_dboid, &src_owner, &src_encoding, @@ -1284,7 +1284,7 @@ movedb(const char *dbname, const char *tblspcname) sysscan = systable_beginscan(pgdbrel, DatabaseNameIndexId, true, NULL, 1, &scankey); oldtuple = systable_getnext(sysscan); - if (!HeapTupleIsValid(oldtuple)) /* shouldn't happen... */ + if (!HeapTupleIsValid(oldtuple)) /* shouldn't happen... */ ereport(ERROR, (errcode(ERRCODE_UNDEFINED_DATABASE), errmsg("database \"%s\" does not exist", dbname))); diff --git a/src/backend/commands/event_trigger.c b/src/backend/commands/event_trigger.c index 4cfab418a6..48a6375559 100644 --- a/src/backend/commands/event_trigger.c +++ b/src/backend/commands/event_trigger.c @@ -57,8 +57,8 @@ typedef struct EventTriggerQueryState bool in_sql_drop; /* table_rewrite */ - Oid table_rewrite_oid; /* InvalidOid, or set for - * table_rewrite event */ + Oid table_rewrite_oid; /* InvalidOid, or set for table_rewrite + * event */ int table_rewrite_reason; /* AT_REWRITE reason */ /* Support for command collection */ diff --git a/src/backend/commands/extension.c b/src/backend/commands/extension.c index 91f9cac786..a40b5ec4de 100644 --- a/src/backend/commands/extension.c +++ b/src/backend/commands/extension.c @@ -96,7 +96,7 @@ typedef struct ExtensionVersionInfo /* working state for Dijkstra's algorithm: */ bool distance_known; /* is distance from start known yet? */ int distance; /* current worst-case distance estimate */ - struct ExtensionVersionInfo *previous; /* current best predecessor */ + struct ExtensionVersionInfo *previous; /* current best predecessor */ } ExtensionVersionInfo; /* Local functions */ @@ -2387,7 +2387,7 @@ pg_extension_config_dump(PG_FUNCTION_ARGS) extTup = systable_getnext(extScan); - if (!HeapTupleIsValid(extTup)) /* should not happen */ + if (!HeapTupleIsValid(extTup)) /* should not happen */ elog(ERROR, "could not find tuple for extension %u", CurrentExtensionObject); @@ -2433,7 +2433,7 @@ pg_extension_config_dump(PG_FUNCTION_ARGS) { if (arrayData[i] == tableoid) { - arrayIndex = i + 1; /* replace this element instead */ + arrayIndex = i + 1; /* replace this element instead */ break; } } @@ -2535,7 +2535,7 @@ extension_config_remove(Oid extensionoid, Oid tableoid) extTup = systable_getnext(extScan); - if (!HeapTupleIsValid(extTup)) /* should not happen */ + if (!HeapTupleIsValid(extTup)) /* should not happen */ elog(ERROR, "could not find tuple for extension %u", extensionoid); @@ -2736,7 +2736,7 @@ AlterExtensionNamespace(const char *extensionName, const char *newschema, Oid *o extTup = systable_getnext(extScan); - if (!HeapTupleIsValid(extTup)) /* should not happen */ + if (!HeapTupleIsValid(extTup)) /* should not happen */ elog(ERROR, "could not find tuple for extension %u", extensionOid); @@ -2801,7 +2801,7 @@ AlterExtensionNamespace(const char *extensionName, const char *newschema, Oid *o dep.objectId = pg_depend->objid; dep.objectSubId = pg_depend->objsubid; - if (dep.objectSubId != 0) /* should not happen */ + if (dep.objectSubId != 0) /* should not happen */ elog(ERROR, "extension should not have a sub-object dependency"); /* Relocate the object */ diff --git a/src/backend/commands/functioncmds.c b/src/backend/commands/functioncmds.c index 2e26090bf9..1a165d5b0c 100644 --- a/src/backend/commands/functioncmds.c +++ b/src/backend/commands/functioncmds.c @@ -201,7 +201,7 @@ interpret_function_parameter_list(ParseState *pstate, ListCell *x; int i; - *variadicArgType = InvalidOid; /* default result */ + *variadicArgType = InvalidOid; /* default result */ *requiredResultType = InvalidOid; /* default result */ inTypes = (Oid *) palloc(parameterCount * sizeof(Oid)); @@ -562,7 +562,7 @@ interpret_func_parallel(DefElem *defel) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("parameter \"parallel\" must be SAFE, RESTRICTED, or UNSAFE"))); - return PROPARALLEL_UNSAFE; /* keep compiler quiet */ + return PROPARALLEL_UNSAFE; /* keep compiler quiet */ } } @@ -1090,7 +1090,7 @@ CreateFunction(ParseState *pstate, CreateFunctionStmt *stmt) languageValidator, prosrc_str, /* converted to text later */ probin_str, /* converted to text later */ - false, /* not an aggregate */ + false, /* not an aggregate */ isWindowFunc, security, isLeakProof, @@ -1146,7 +1146,7 @@ RemoveFunctionById(Oid funcOid) relation = heap_open(AggregateRelationId, RowExclusiveLock); tup = SearchSysCache1(AGGFNOID, ObjectIdGetDatum(funcOid)); - if (!HeapTupleIsValid(tup)) /* should not happen */ + if (!HeapTupleIsValid(tup)) /* should not happen */ elog(ERROR, "cache lookup failed for pg_aggregate tuple for function %u", funcOid); CatalogTupleDelete(relation, &tup->t_self); @@ -1326,7 +1326,7 @@ SetFunctionReturnType(Oid funcOid, Oid newRetType) elog(ERROR, "cache lookup failed for function %u", funcOid); procForm = (Form_pg_proc) GETSTRUCT(tup); - if (procForm->prorettype != OPAQUEOID) /* caller messed up */ + if (procForm->prorettype != OPAQUEOID) /* caller messed up */ elog(ERROR, "function %u doesn't return OPAQUE", funcOid); /* okay to overwrite copied tuple */ diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c index c0902794e9..e3f2dcfa8c 100644 --- a/src/backend/commands/indexcmds.c +++ b/src/backend/commands/indexcmds.c @@ -645,7 +645,7 @@ DefineIndex(Oid relationId, else { elog(ERROR, "unknown constraint type"); - constraint_type = NULL; /* keep compiler quiet */ + constraint_type = NULL; /* keep compiler quiet */ } ereport(DEBUG1, @@ -909,7 +909,7 @@ DefineIndex(Oid relationId, newer_snapshots[k])) break; } - if (k >= n_newer_snapshots) /* not there anymore */ + if (k >= n_newer_snapshots) /* not there anymore */ SetInvalidVirtualTransactionId(old_snapshots[j]); } pfree(newer_snapshots); @@ -1704,9 +1704,9 @@ ChooseIndexColumnNames(List *indexElems) /* Get the preliminary name from the IndexElem */ if (ielem->indexcolname) - origname = ielem->indexcolname; /* caller-specified name */ + origname = ielem->indexcolname; /* caller-specified name */ else if (ielem->name) - origname = ielem->name; /* simple column reference */ + origname = ielem->name; /* simple column reference */ else origname = "expr"; /* default name for expression */ diff --git a/src/backend/commands/opclasscmds.c b/src/backend/commands/opclasscmds.c index ab51d1a417..512014438b 100644 --- a/src/backend/commands/opclasscmds.c +++ b/src/backend/commands/opclasscmds.c @@ -856,7 +856,7 @@ AlterOpFamilyAdd(AlterOpFamilyStmt *stmt, Oid amoid, Oid opfamilyoid, ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("operator argument types must be specified in ALTER OPERATOR FAMILY"))); - operOid = InvalidOid; /* keep compiler quiet */ + operOid = InvalidOid; /* keep compiler quiet */ } if (item->order_family) diff --git a/src/backend/commands/operatorcmds.c b/src/backend/commands/operatorcmds.c index 739d5875eb..c7e7676611 100644 --- a/src/backend/commands/operatorcmds.c +++ b/src/backend/commands/operatorcmds.c @@ -70,16 +70,16 @@ DefineOperator(List *names, List *parameters) char *oprName; Oid oprNamespace; AclResult aclresult; - bool canMerge = false; /* operator merges */ + bool canMerge = false; /* operator merges */ bool canHash = false; /* operator hashes */ - List *functionName = NIL; /* function for operator */ - TypeName *typeName1 = NULL; /* first type name */ - TypeName *typeName2 = NULL; /* second type name */ + List *functionName = NIL; /* function for operator */ + TypeName *typeName1 = NULL; /* first type name */ + TypeName *typeName2 = NULL; /* second type name */ Oid typeId1 = InvalidOid; /* types converted to OID */ Oid typeId2 = InvalidOid; Oid rettype; List *commutatorName = NIL; /* optional commutator operator name */ - List *negatorName = NIL; /* optional negator operator name */ + List *negatorName = NIL; /* optional negator operator name */ List *restrictionName = NIL; /* optional restrict. sel. procedure */ List *joinName = NIL; /* optional join sel. procedure */ Oid functionOid; /* functions converted to OID */ @@ -243,9 +243,9 @@ DefineOperator(List *names, List *parameters) oprNamespace, /* namespace */ typeId1, /* left type id */ typeId2, /* right type id */ - functionOid, /* function for operator */ + functionOid, /* function for operator */ commutatorName, /* optional commutator operator name */ - negatorName, /* optional negator operator name */ + negatorName, /* optional negator operator name */ restrictionOid, /* optional restrict. sel. procedure */ joinOid, /* optional join sel. procedure name */ canMerge, /* operator merges */ diff --git a/src/backend/commands/portalcmds.c b/src/backend/commands/portalcmds.c index 167910fcb5..46369cf3db 100644 --- a/src/backend/commands/portalcmds.c +++ b/src/backend/commands/portalcmds.c @@ -403,7 +403,7 @@ PersistHoldablePortal(Portal portal) /* * Now shut down the inner executor. */ - portal->queryDesc = NULL; /* prevent double shutdown */ + portal->queryDesc = NULL; /* prevent double shutdown */ ExecutorFinish(queryDesc); ExecutorEnd(queryDesc); FreeQueryDesc(queryDesc); diff --git a/src/backend/commands/proclang.c b/src/backend/commands/proclang.c index a4fbc05a12..4d555f1f5c 100644 --- a/src/backend/commands/proclang.c +++ b/src/backend/commands/proclang.c @@ -161,18 +161,18 @@ CreateProceduralLanguage(CreatePLangStmt *stmt) { tmpAddr = ProcedureCreate(pltemplate->tmplinline, PG_CATALOG_NAMESPACE, - false, /* replace */ - false, /* returnsSet */ + false, /* replace */ + false, /* returnsSet */ VOIDOID, BOOTSTRAP_SUPERUSERID, ClanguageId, F_FMGR_C_VALIDATOR, pltemplate->tmplinline, pltemplate->tmpllibrary, - false, /* isAgg */ - false, /* isWindowFunc */ - false, /* security_definer */ - false, /* isLeakProof */ + false, /* isAgg */ + false, /* isWindowFunc */ + false, /* security_definer */ + false, /* isLeakProof */ true, /* isStrict */ PROVOLATILE_VOLATILE, PROPARALLEL_UNSAFE, @@ -204,18 +204,18 @@ CreateProceduralLanguage(CreatePLangStmt *stmt) { tmpAddr = ProcedureCreate(pltemplate->tmplvalidator, PG_CATALOG_NAMESPACE, - false, /* replace */ - false, /* returnsSet */ + false, /* replace */ + false, /* returnsSet */ VOIDOID, BOOTSTRAP_SUPERUSERID, ClanguageId, F_FMGR_C_VALIDATOR, pltemplate->tmplvalidator, pltemplate->tmpllibrary, - false, /* isAgg */ - false, /* isWindowFunc */ - false, /* security_definer */ - false, /* isLeakProof */ + false, /* isAgg */ + false, /* isWindowFunc */ + false, /* security_definer */ + false, /* isLeakProof */ true, /* isStrict */ PROVOLATILE_VOLATILE, PROPARALLEL_UNSAFE, @@ -533,7 +533,7 @@ DropProceduralLanguageById(Oid langOid) rel = heap_open(LanguageRelationId, RowExclusiveLock); langTup = SearchSysCache1(LANGOID, ObjectIdGetDatum(langOid)); - if (!HeapTupleIsValid(langTup)) /* should not happen */ + if (!HeapTupleIsValid(langTup)) /* should not happen */ elog(ERROR, "cache lookup failed for language %u", langOid); CatalogTupleDelete(rel, &langTup->t_self); diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c index 031bbc874d..58bda55837 100644 --- a/src/backend/commands/sequence.c +++ b/src/backend/commands/sequence.c @@ -611,7 +611,7 @@ nextval_internal(Oid relid, bool check_permissions) */ PreventCommandIfParallelMode("nextval()"); - if (elm->last != elm->cached) /* some numbers were cached */ + if (elm->last != elm->cached) /* some numbers were cached */ { Assert(elm->last_valid); Assert(elm->increment != 0); @@ -1455,7 +1455,7 @@ init_params(ParseState *pstate, List *options, bool for_identity, seqform->seqmax = PG_INT64_MAX; } else - seqform->seqmax = -1; /* descending seq */ + seqform->seqmax = -1; /* descending seq */ seqdataform->log_cnt = 0; } @@ -1532,9 +1532,9 @@ init_params(ParseState *pstate, List *options, bool for_identity, else if (isInit) { if (seqform->seqincrement > 0) - seqform->seqstart = seqform->seqmin; /* ascending seq */ + seqform->seqstart = seqform->seqmin; /* ascending seq */ else - seqform->seqstart = seqform->seqmax; /* descending seq */ + seqform->seqstart = seqform->seqmax; /* descending seq */ } /* crosscheck START */ diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 758c876ef3..207241cb92 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -138,17 +138,17 @@ static List *on_commits = NIL; * a pass determined by subcommand type. */ -#define AT_PASS_UNSET -1 /* UNSET will cause ERROR */ -#define AT_PASS_DROP 0 /* DROP (all flavors) */ -#define AT_PASS_ALTER_TYPE 1 /* ALTER COLUMN TYPE */ -#define AT_PASS_OLD_INDEX 2 /* re-add existing indexes */ -#define AT_PASS_OLD_CONSTR 3 /* re-add existing constraints */ -#define AT_PASS_COL_ATTRS 4 /* set other column attributes */ +#define AT_PASS_UNSET -1 /* UNSET will cause ERROR */ +#define AT_PASS_DROP 0 /* DROP (all flavors) */ +#define AT_PASS_ALTER_TYPE 1 /* ALTER COLUMN TYPE */ +#define AT_PASS_OLD_INDEX 2 /* re-add existing indexes */ +#define AT_PASS_OLD_CONSTR 3 /* re-add existing constraints */ +#define AT_PASS_COL_ATTRS 4 /* set other column attributes */ /* We could support a RENAME COLUMN pass here, but not currently used */ -#define AT_PASS_ADD_COL 5 /* ADD COLUMN */ -#define AT_PASS_ADD_INDEX 6 /* ADD indexes */ -#define AT_PASS_ADD_CONSTR 7 /* ADD constraints, defaults */ -#define AT_PASS_MISC 8 /* other stuff */ +#define AT_PASS_ADD_COL 5 /* ADD COLUMN */ +#define AT_PASS_ADD_INDEX 6 /* ADD indexes */ +#define AT_PASS_ADD_CONSTR 7 /* ADD constraints, defaults */ +#define AT_PASS_MISC 8 /* other stuff */ #define AT_NUM_PASSES 9 typedef struct AlteredTableInfo @@ -166,13 +166,13 @@ typedef struct AlteredTableInfo int rewrite; /* Reason for forced rewrite, if any */ Oid newTableSpace; /* new tablespace; 0 means no change */ bool chgPersistence; /* T if SET LOGGED/UNLOGGED is used */ - char newrelpersistence; /* if above is true */ + char newrelpersistence; /* if above is true */ Expr *partition_constraint; /* for attach partition validation */ /* Objects to rebuild after completing ALTER TYPE operations */ List *changedConstraintOids; /* OIDs of constraints to rebuild */ List *changedConstraintDefs; /* string definitions of same */ - List *changedIndexOids; /* OIDs of indexes to rebuild */ - List *changedIndexDefs; /* string definitions of same */ + List *changedIndexOids; /* OIDs of indexes to rebuild */ + List *changedIndexDefs; /* string definitions of same */ } AlteredTableInfo; /* Struct describing one new constraint to check in Phase 3 scan */ @@ -701,13 +701,13 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, cooked = (CookedConstraint *) palloc(sizeof(CookedConstraint)); cooked->contype = CONSTR_DEFAULT; - cooked->conoid = InvalidOid; /* until created */ + cooked->conoid = InvalidOid; /* until created */ cooked->name = NULL; cooked->attnum = attnum; cooked->expr = colDef->cooked_default; cooked->skip_validation = false; cooked->is_local = true; /* not used for defaults */ - cooked->inhcount = 0; /* ditto */ + cooked->inhcount = 0; /* ditto */ cooked->is_no_inherit = false; cookedDefaults = lappend(cookedDefaults, cooked); descriptor->attrs[attnum - 1]->atthasdef = true; @@ -917,7 +917,7 @@ DropErrorMsgNonExistent(RangeVar *rel, char rightkind, bool missing_ok) } } - Assert(rentry->kind != '\0'); /* Should be impossible */ + Assert(rentry->kind != '\0'); /* Should be impossible */ } /* @@ -1629,7 +1629,7 @@ MergeAttributes(List *schema, List *supers, char relpersistence, int parentsWithOids = 0; bool have_bogus_defaults = false; int child_attno; - static Node bogus_marker = {0}; /* marks conflicting defaults */ + static Node bogus_marker = {0}; /* marks conflicting defaults */ List *saved_schema = NIL; /* @@ -1688,8 +1688,8 @@ MergeAttributes(List *schema, List *supers, char relpersistence, while (rest != NULL) { ColumnDef *restdef = lfirst(rest); - ListCell *next = lnext(rest); /* need to save it in case we - * delete it */ + ListCell *next = lnext(rest); /* need to save it in case we + * delete it */ if (strcmp(coldef->colname, restdef->colname) == 0) { @@ -2012,7 +2012,7 @@ MergeAttributes(List *schema, List *supers, char relpersistence, cooked = (CookedConstraint *) palloc(sizeof(CookedConstraint)); cooked->contype = CONSTR_CHECK; - cooked->conoid = InvalidOid; /* until created */ + cooked->conoid = InvalidOid; /* until created */ cooked->name = pstrdup(name); cooked->attnum = 0; /* not used for constraints */ cooked->expr = expr; @@ -2650,7 +2650,7 @@ renameatt_internal(Oid myrelid, heap_close(attrelation, RowExclusiveLock); - relation_close(targetrelation, NoLock); /* close rel but keep lock */ + relation_close(targetrelation, NoLock); /* close rel but keep lock */ return attnum; } @@ -2701,10 +2701,10 @@ renameatt(RenameStmt *stmt) attnum = renameatt_internal(relid, - stmt->subname, /* old att name */ - stmt->newname, /* new att name */ + stmt->subname, /* old att name */ + stmt->newname, /* new att name */ stmt->relation->inh, /* recursive? */ - false, /* recursing? */ + false, /* recursing? */ 0, /* expected inhcount */ stmt->behavior); @@ -2856,8 +2856,8 @@ RenameConstraint(RenameStmt *stmt) stmt->subname, stmt->newname, (stmt->relation && - stmt->relation->inh), /* recursive? */ - false, /* recursing? */ + stmt->relation->inh), /* recursive? */ + false, /* recursing? */ 0 /* expected inhcount */ ); } @@ -2933,7 +2933,7 @@ RenameRelationInternal(Oid myrelid, const char *newrelname, bool is_internal) relrelation = heap_open(RelationRelationId, RowExclusiveLock); reltup = SearchSysCacheCopy1(RELOID, ObjectIdGetDatum(myrelid)); - if (!HeapTupleIsValid(reltup)) /* shouldn't happen */ + if (!HeapTupleIsValid(reltup)) /* shouldn't happen */ elog(ERROR, "cache lookup failed for relation %u", myrelid); relform = (Form_pg_class) GETSTRUCT(reltup); @@ -3175,7 +3175,7 @@ AlterTableGetLockLevel(List *cmds) */ case AT_AddColumn: /* may rewrite heap, in some cases and visible * to SELECT */ - case AT_SetTableSpace: /* must rewrite heap */ + case AT_SetTableSpace: /* must rewrite heap */ case AT_AlterColumnType: /* must rewrite heap */ case AT_AddOids: /* must rewrite heap */ cmd_lockmode = AccessExclusiveLock; @@ -3196,7 +3196,7 @@ AlterTableGetLockLevel(List *cmds) * Removing constraints can affect SELECTs that have been * optimised assuming the constraint holds true. */ - case AT_DropConstraint: /* as DROP INDEX */ + case AT_DropConstraint: /* as DROP INDEX */ case AT_DropNotNull: /* may change some SQL plans */ cmd_lockmode = AccessExclusiveLock; break; @@ -3264,8 +3264,8 @@ AlterTableGetLockLevel(List *cmds) break; case AT_AddConstraint: - case AT_ProcessedConstraint: /* becomes AT_AddConstraint */ - case AT_AddConstraintRecurse: /* becomes AT_AddConstraint */ + case AT_ProcessedConstraint: /* becomes AT_AddConstraint */ + case AT_AddConstraintRecurse: /* becomes AT_AddConstraint */ case AT_ReAddConstraint: /* becomes AT_AddConstraint */ if (IsA(cmd->def, Constraint)) { @@ -3345,11 +3345,11 @@ AlterTableGetLockLevel(List *cmds) * applies: we don't currently allow concurrent catalog * updates. */ - case AT_SetStatistics: /* Uses MVCC in getTableAttrs() */ + case AT_SetStatistics: /* Uses MVCC in getTableAttrs() */ case AT_ClusterOn: /* Uses MVCC in getIndexes() */ case AT_DropCluster: /* Uses MVCC in getIndexes() */ case AT_SetOptions: /* Uses MVCC in getTableAttrs() */ - case AT_ResetOptions: /* Uses MVCC in getTableAttrs() */ + case AT_ResetOptions: /* Uses MVCC in getTableAttrs() */ cmd_lockmode = ShareUpdateExclusiveLock; break; @@ -3368,8 +3368,8 @@ AlterTableGetLockLevel(List *cmds) * reasons these can all be used with ALTER TABLE, so we can't * decide between them using the basic grammar. */ - case AT_SetRelOptions: /* Uses MVCC in getIndexes() and - * getTables() */ + case AT_SetRelOptions: /* Uses MVCC in getIndexes() and + * getTables() */ case AT_ResetRelOptions: /* Uses MVCC in getIndexes() and * getTables() */ cmd_lockmode = AlterTableGetRelOptionsLockLevel((List *) cmd->def); @@ -3553,7 +3553,7 @@ ATPrepCmd(List **wqueue, Relation rel, AlterTableCmd *cmd, cmd->subtype = AT_AddConstraintRecurse; pass = AT_PASS_ADD_CONSTR; break; - case AT_AddIndexConstraint: /* ADD CONSTRAINT USING INDEX */ + case AT_AddIndexConstraint: /* ADD CONSTRAINT USING INDEX */ ATSimplePermissions(rel, ATT_TABLE); /* This command never recurses */ /* No command-specific prep needed */ @@ -3643,7 +3643,7 @@ ATPrepCmd(List **wqueue, Relation rel, AlterTableCmd *cmd, break; case AT_SetRelOptions: /* SET (...) */ case AT_ResetRelOptions: /* RESET (...) */ - case AT_ReplaceRelOptions: /* reset them all, then set just these */ + case AT_ReplaceRelOptions: /* reset them all, then set just these */ ATSimplePermissions(rel, ATT_TABLE | ATT_VIEW | ATT_MATVIEW | ATT_INDEX); /* This command never recurses */ /* No command-specific prep needed */ @@ -3665,7 +3665,7 @@ ATPrepCmd(List **wqueue, Relation rel, AlterTableCmd *cmd, ATSimplePermissions(rel, ATT_TABLE); pass = AT_PASS_MISC; break; - case AT_ValidateConstraint: /* VALIDATE CONSTRAINT */ + case AT_ValidateConstraint: /* VALIDATE CONSTRAINT */ ATSimplePermissions(rel, ATT_TABLE | ATT_FOREIGN_TABLE); /* Recursion occurs during execution phase */ /* No command-specific prep needed except saving recurse flag */ @@ -3719,7 +3719,7 @@ ATPrepCmd(List **wqueue, Relation rel, AlterTableCmd *cmd, default: /* oops */ elog(ERROR, "unrecognized alter table type: %d", (int) cmd->subtype); - pass = AT_PASS_UNSET; /* keep compiler quiet */ + pass = AT_PASS_UNSET; /* keep compiler quiet */ break; } Assert(pass > AT_PASS_UNSET); @@ -3856,7 +3856,7 @@ ATExecCmd(List **wqueue, AlteredTableInfo *tab, Relation rel, cmd->behavior, false, false, cmd->missing_ok, lockmode); break; - case AT_DropColumnRecurse: /* DROP COLUMN with recursion */ + case AT_DropColumnRecurse: /* DROP COLUMN with recursion */ address = ATExecDropColumn(wqueue, rel, cmd->name, cmd->behavior, true, false, cmd->missing_ok, lockmode); @@ -3887,19 +3887,19 @@ ATExecCmd(List **wqueue, AlteredTableInfo *tab, Relation rel, case AT_ReAddComment: /* Re-add existing comment */ address = CommentObject((CommentStmt *) cmd->def); break; - case AT_AddIndexConstraint: /* ADD CONSTRAINT USING INDEX */ + case AT_AddIndexConstraint: /* ADD CONSTRAINT USING INDEX */ address = ATExecAddIndexConstraint(tab, rel, (IndexStmt *) cmd->def, lockmode); break; case AT_AlterConstraint: /* ALTER CONSTRAINT */ address = ATExecAlterConstraint(rel, cmd, false, false, lockmode); break; - case AT_ValidateConstraint: /* VALIDATE CONSTRAINT */ + case AT_ValidateConstraint: /* VALIDATE CONSTRAINT */ address = ATExecValidateConstraint(rel, cmd->name, false, false, lockmode); break; - case AT_ValidateConstraintRecurse: /* VALIDATE CONSTRAINT with - * recursion */ + case AT_ValidateConstraintRecurse: /* VALIDATE CONSTRAINT with + * recursion */ address = ATExecValidateConstraint(rel, cmd->name, true, false, lockmode); break; @@ -3916,7 +3916,7 @@ ATExecCmd(List **wqueue, AlteredTableInfo *tab, Relation rel, case AT_AlterColumnType: /* ALTER COLUMN TYPE */ address = ATExecAlterColumnType(tab, rel, cmd, lockmode); break; - case AT_AlterColumnGenericOptions: /* ALTER COLUMN OPTIONS */ + case AT_AlterColumnGenericOptions: /* ALTER COLUMN OPTIONS */ address = ATExecAlterColumnGenericOptions(rel, cmd->name, (List *) cmd->def, lockmode); @@ -3966,18 +3966,18 @@ ATExecCmd(List **wqueue, AlteredTableInfo *tab, Relation rel, break; case AT_SetRelOptions: /* SET (...) */ case AT_ResetRelOptions: /* RESET (...) */ - case AT_ReplaceRelOptions: /* replace entire option list */ + case AT_ReplaceRelOptions: /* replace entire option list */ ATExecSetRelOptions(rel, (List *) cmd->def, cmd->subtype, lockmode); break; case AT_EnableTrig: /* ENABLE TRIGGER name */ ATExecEnableDisableTrigger(rel, cmd->name, TRIGGER_FIRES_ON_ORIGIN, false, lockmode); break; - case AT_EnableAlwaysTrig: /* ENABLE ALWAYS TRIGGER name */ + case AT_EnableAlwaysTrig: /* ENABLE ALWAYS TRIGGER name */ ATExecEnableDisableTrigger(rel, cmd->name, TRIGGER_FIRES_ALWAYS, false, lockmode); break; - case AT_EnableReplicaTrig: /* ENABLE REPLICA TRIGGER name */ + case AT_EnableReplicaTrig: /* ENABLE REPLICA TRIGGER name */ ATExecEnableDisableTrigger(rel, cmd->name, TRIGGER_FIRES_ON_REPLICA, false, lockmode); break; @@ -4006,11 +4006,11 @@ ATExecCmd(List **wqueue, AlteredTableInfo *tab, Relation rel, ATExecEnableDisableRule(rel, cmd->name, RULE_FIRES_ON_ORIGIN, lockmode); break; - case AT_EnableAlwaysRule: /* ENABLE ALWAYS RULE name */ + case AT_EnableAlwaysRule: /* ENABLE ALWAYS RULE name */ ATExecEnableDisableRule(rel, cmd->name, RULE_FIRES_ALWAYS, lockmode); break; - case AT_EnableReplicaRule: /* ENABLE REPLICA RULE name */ + case AT_EnableReplicaRule: /* ENABLE REPLICA RULE name */ ATExecEnableDisableRule(rel, cmd->name, RULE_FIRES_ON_REPLICA, lockmode); break; @@ -4330,7 +4330,7 @@ ATRewriteTable(AlteredTableInfo *tab, Oid OIDNewHeap, LOCKMODE lockmode) */ oldrel = heap_open(tab->relid, NoLock); oldTupDesc = tab->oldDesc; - newTupDesc = RelationGetDescr(oldrel); /* includes all mods */ + newTupDesc = RelationGetDescr(oldrel); /* includes all mods */ if (OidIsValid(OIDNewHeap)) newrel = heap_open(OIDNewHeap, lockmode); @@ -6540,12 +6540,12 @@ ATExecDropColumn(List **wqueue, Relation rel, const char *colName, CheckTableNotInUse(childrel, "ALTER TABLE"); tuple = SearchSysCacheCopyAttName(childrelid, colName); - if (!HeapTupleIsValid(tuple)) /* shouldn't happen */ + if (!HeapTupleIsValid(tuple)) /* shouldn't happen */ elog(ERROR, "cache lookup failed for attribute \"%s\" of relation %u", colName, childrelid); childatt = (Form_pg_attribute) GETSTRUCT(tuple); - if (childatt->attinhcount <= 0) /* shouldn't happen */ + if (childatt->attinhcount <= 0) /* shouldn't happen */ elog(ERROR, "relation %u has non-inherited attribute \"%s\"", childrelid, colName); @@ -6767,8 +6767,8 @@ ATExecAddIndexConstraint(AlteredTableInfo *tab, Relation rel, stmt->deferrable, stmt->initdeferred, stmt->primary, - true, /* update pg_index */ - true, /* remove old dependencies */ + true, /* update pg_index */ + true, /* remove old dependencies */ allowSystemTableMods, false); /* is_internal */ @@ -6889,8 +6889,8 @@ ATAddCheckConstraint(List **wqueue, AlteredTableInfo *tab, Relation rel, newcons = AddRelationNewConstraints(rel, NIL, list_make1(copyObject(constr)), recursing | is_readd, /* allow_merge */ - !recursing, /* is_local */ - is_readd); /* is_internal */ + !recursing, /* is_local */ + is_readd); /* is_internal */ /* we don't expect more than one constraint here */ Assert(list_length(newcons) <= 1); @@ -7337,8 +7337,7 @@ ATAddForeignKeyConstraint(AlteredTableInfo *tab, Relation rel, RelationGetRelid(rel), fkattnum, numfks, - InvalidOid, /* not a domain - * constraint */ + InvalidOid, /* not a domain constraint */ indexOid, RelationGetRelid(pkrel), pkattnum, @@ -7349,13 +7348,13 @@ ATAddForeignKeyConstraint(AlteredTableInfo *tab, Relation rel, fkconstraint->fk_upd_action, fkconstraint->fk_del_action, fkconstraint->fk_matchtype, - NULL, /* no exclusion constraint */ - NULL, /* no check constraint */ + NULL, /* no exclusion constraint */ + NULL, /* no check constraint */ NULL, NULL, - true, /* islocal */ - 0, /* inhcount */ - true, /* isnoinherit */ + true, /* islocal */ + 0, /* inhcount */ + true, /* isnoinherit */ false); /* is_internal */ ObjectAddressSet(address, ConstraintRelationId, constrOid); @@ -8607,7 +8606,7 @@ ATExecDropConstraint(Relation rel, const char *constrName, con = (Form_pg_constraint) GETSTRUCT(copy_tuple); - if (con->coninhcount <= 0) /* shouldn't happen */ + if (con->coninhcount <= 0) /* shouldn't happen */ elog(ERROR, "relation %u has non-inherited constraint \"%s\"", childrelid, constrName); @@ -8965,7 +8964,7 @@ ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel, /* Look up the target column */ heapTup = SearchSysCacheCopyAttName(RelationGetRelid(rel), colName); - if (!HeapTupleIsValid(heapTup)) /* shouldn't happen */ + if (!HeapTupleIsValid(heapTup)) /* shouldn't happen */ ereport(ERROR, (errcode(ERRCODE_UNDEFINED_COLUMN), errmsg("column \"%s\" of relation \"%s\" does not exist", @@ -9005,7 +9004,7 @@ ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel, defaultexpr = build_column_default(rel, attnum); Assert(defaultexpr); defaultexpr = strip_implicit_coercions(defaultexpr); - defaultexpr = coerce_to_target_type(NULL, /* no UNKNOWN params */ + defaultexpr = coerce_to_target_type(NULL, /* no UNKNOWN params */ defaultexpr, exprType(defaultexpr), targettype, targettypmod, COERCION_ASSIGNMENT, @@ -9500,7 +9499,7 @@ ATPostAlterTypeCleanup(List **wqueue, AlteredTableInfo *tab, LOCKMODE lockmode) bool conislocal; tup = SearchSysCache1(CONSTROID, ObjectIdGetDatum(oldId)); - if (!HeapTupleIsValid(tup)) /* should not happen */ + if (!HeapTupleIsValid(tup)) /* should not happen */ elog(ERROR, "cache lookup failed for constraint %u", oldId); con = (Form_pg_constraint) GETSTRUCT(tup); relid = con->conrelid; @@ -11647,7 +11646,7 @@ RemoveInheritance(Relation child_rel, Relation parent_rel) HeapTuple copyTuple = heap_copytuple(constraintTuple); Form_pg_constraint copy_con = (Form_pg_constraint) GETSTRUCT(copyTuple); - if (copy_con->coninhcount <= 0) /* shouldn't happen */ + if (copy_con->coninhcount <= 0) /* shouldn't happen */ elog(ERROR, "relation %u has non-inherited constraint \"%s\"", RelationGetRelid(child_rel), NameStr(copy_con->conname)); @@ -12836,7 +12835,7 @@ PreCommit_on_commit_actions(void) if (oids_to_truncate != NIL) { heap_truncate(oids_to_truncate); - CommandCounterIncrement(); /* XXX needed? */ + CommandCounterIncrement(); /* XXX needed? */ } } @@ -12979,7 +12978,7 @@ RangeVarCallbackOwnsRelation(const RangeVar *relation, return; tuple = SearchSysCache1(RELOID, ObjectIdGetDatum(relId)); - if (!HeapTupleIsValid(tuple)) /* should not happen */ + if (!HeapTupleIsValid(tuple)) /* should not happen */ elog(ERROR, "cache lookup failed for relation %u", relId); if (!pg_class_ownercheck(relId, GetUserId())) diff --git a/src/backend/commands/tablespace.c b/src/backend/commands/tablespace.c index f9c26201d9..03bf06012a 100644 --- a/src/backend/commands/tablespace.c +++ b/src/backend/commands/tablespace.c @@ -388,7 +388,7 @@ CreateTableSpace(CreateTableSpaceStmt *stmt) (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("tablespaces are not supported on this platform"))); return InvalidOid; /* keep compiler quiet */ -#endif /* HAVE_SYMLINK */ +#endif /* HAVE_SYMLINK */ } /* @@ -549,7 +549,7 @@ DropTableSpace(DropTableSpaceStmt *stmt) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("tablespaces are not supported on this platform"))); -#endif /* HAVE_SYMLINK */ +#endif /* HAVE_SYMLINK */ } diff --git a/src/backend/commands/trigger.c b/src/backend/commands/trigger.c index d7ed71f767..191f27651c 100644 --- a/src/backend/commands/trigger.c +++ b/src/backend/commands/trigger.c @@ -593,11 +593,11 @@ CreateTrigger(CreateTrigStmt *stmt, const char *queryString, stmt->initdeferred, true, RelationGetRelid(rel), - NULL, /* no conkey */ + NULL, /* no conkey */ 0, - InvalidOid, /* no domain */ - InvalidOid, /* no index */ - InvalidOid, /* no foreign key */ + InvalidOid, /* no domain */ + InvalidOid, /* no index */ + InvalidOid, /* no foreign key */ NULL, NULL, NULL, @@ -606,14 +606,14 @@ CreateTrigger(CreateTrigStmt *stmt, const char *queryString, ' ', ' ', ' ', - NULL, /* no exclusion */ - NULL, /* no check constraint */ + NULL, /* no exclusion */ + NULL, /* no check constraint */ NULL, NULL, - true, /* islocal */ - 0, /* inhcount */ - true, /* isnoinherit */ - isInternal); /* is_internal */ + true, /* islocal */ + 0, /* inhcount */ + true, /* isnoinherit */ + isInternal); /* is_internal */ } /* @@ -2026,7 +2026,7 @@ equalTriggerDescs(TriggerDesc *trigdesc1, TriggerDesc *trigdesc2) return false; return true; } -#endif /* NOT_USED */ +#endif /* NOT_USED */ /* * Call a trigger function. @@ -3255,8 +3255,7 @@ typedef SetConstraintStateData *SetConstraintState; */ typedef uint32 TriggerFlags; -#define AFTER_TRIGGER_OFFSET 0x0FFFFFFF /* must be low-order - * bits */ +#define AFTER_TRIGGER_OFFSET 0x0FFFFFFF /* must be low-order bits */ #define AFTER_TRIGGER_DONE 0x10000000 #define AFTER_TRIGGER_IN_PROGRESS 0x20000000 /* bits describing the size and tuple sources of this event */ @@ -3317,7 +3316,7 @@ typedef struct AfterTriggerEventDataZeroCtids */ typedef struct AfterTriggerEventChunk { - struct AfterTriggerEventChunk *next; /* list link */ + struct AfterTriggerEventChunk *next; /* list link */ char *freeptr; /* start of free space in chunk */ char *endfree; /* end of free space in chunk */ char *endptr; /* end of chunk */ @@ -3409,7 +3408,7 @@ typedef struct AfterTriggersData { CommandId firing_counter; /* next firing ID to assign */ SetConstraintState state; /* the active S C state */ - AfterTriggerEventList events; /* deferred-event list */ + AfterTriggerEventList events; /* deferred-event list */ int query_depth; /* current query list index */ AfterTriggerEventList *query_stack; /* events pending from each query */ Tuplestorestate **fdw_tuplestores; /* foreign tuples for one row from @@ -3422,7 +3421,7 @@ typedef struct AfterTriggersData /* these fields are just for resetting at subtrans abort: */ SetConstraintState *state_stack; /* stacked S C states */ - AfterTriggerEventList *events_stack; /* stacked list pointers */ + AfterTriggerEventList *events_stack; /* stacked list pointers */ int *depth_stack; /* stacked query_depths */ CommandId *firing_stack; /* stacked firing_counters */ int maxtransdepth; /* allocated len of above arrays */ @@ -4058,7 +4057,7 @@ afterTriggerInvokeEvents(AfterTriggerEventList *events, slot1 = MakeSingleTupleTableSlot(rel->rd_att); slot2 = MakeSingleTupleTableSlot(rel->rd_att); } - if (trigdesc == NULL) /* should not happen */ + if (trigdesc == NULL) /* should not happen */ elog(ERROR, "relation %u has no triggers", evtshared->ats_relid); } @@ -4132,7 +4131,7 @@ AfterTriggerBeginXact(void) /* * Initialize after-trigger state structure to empty */ - afterTriggers.firing_counter = (CommandId) 1; /* mustn't be 0 */ + afterTriggers.firing_counter = (CommandId) 1; /* mustn't be 0 */ afterTriggers.query_depth = -1; /* diff --git a/src/backend/commands/tsearchcmds.c b/src/backend/commands/tsearchcmds.c index dfb95a1ed3..cb212fdf68 100644 --- a/src/backend/commands/tsearchcmds.c +++ b/src/backend/commands/tsearchcmds.c @@ -1561,7 +1561,7 @@ serialize_deflist(List *deflist) List * deserialize_deflist(Datum txt) { - text *in = DatumGetTextPP(txt); /* in case it's toasted */ + text *in = DatumGetTextPP(txt); /* in case it's toasted */ List *result = NIL; int len = VARSIZE_ANY_EXHDR(in); char *ptr, @@ -1582,7 +1582,7 @@ deserialize_deflist(Datum txt) } ds_state; ds_state state = CS_WAITKEY; - workspace = (char *) palloc(len + 1); /* certainly enough room */ + workspace = (char *) palloc(len + 1); /* certainly enough room */ ptr = VARDATA_ANY(in); endptr = ptr + len; for (; ptr < endptr; ptr++) diff --git a/src/backend/commands/typecmds.c b/src/backend/commands/typecmds.c index e7ecc4ed7e..4e083eb345 100644 --- a/src/backend/commands/typecmds.c +++ b/src/backend/commands/typecmds.c @@ -606,11 +606,11 @@ DefineType(ParseState *pstate, List *names, List *parameters) address = TypeCreate(InvalidOid, /* no predetermined type OID */ typeName, /* type name */ - typeNamespace, /* namespace */ + typeNamespace, /* namespace */ InvalidOid, /* relation oid (n/a here) */ 0, /* relation kind (ditto) */ GetUserId(), /* owner's ID */ - internalLength, /* internal size */ + internalLength, /* internal size */ TYPTYPE_BASE, /* type-type (base type) */ category, /* type-category */ preferred, /* is it a preferred type? */ @@ -653,7 +653,7 @@ DefineType(ParseState *pstate, List *names, List *parameters) GetUserId(), /* owner's ID */ -1, /* internal size (always varlena) */ TYPTYPE_BASE, /* type-type (base type) */ - TYPCATEGORY_ARRAY, /* type-category (array) */ + TYPCATEGORY_ARRAY, /* type-category (array) */ false, /* array types are never preferred */ delimiter, /* array element delimiter */ F_ARRAY_IN, /* input procedure */ @@ -662,7 +662,7 @@ DefineType(ParseState *pstate, List *names, List *parameters) F_ARRAY_SEND, /* send procedure */ typmodinOid, /* typmodin procedure */ typmodoutOid, /* typmodout procedure */ - F_ARRAY_TYPANALYZE, /* analyze procedure */ + F_ARRAY_TYPANALYZE, /* analyze procedure */ typoid, /* element type ID */ true, /* yes this is an array type */ InvalidOid, /* no further array type */ @@ -1033,19 +1033,19 @@ DefineDomain(CreateDomainStmt *stmt) address = TypeCreate(InvalidOid, /* no predetermined type OID */ domainName, /* type name */ - domainNamespace, /* namespace */ + domainNamespace, /* namespace */ InvalidOid, /* relation oid (n/a here) */ 0, /* relation kind (ditto) */ GetUserId(), /* owner's ID */ - internalLength, /* internal size */ - TYPTYPE_DOMAIN, /* type-type (domain type) */ + internalLength, /* internal size */ + TYPTYPE_DOMAIN, /* type-type (domain type) */ category, /* type-category */ false, /* domain types are never preferred */ delimiter, /* array element delimiter */ - inputProcedure, /* input procedure */ - outputProcedure, /* output procedure */ + inputProcedure, /* input procedure */ + outputProcedure, /* output procedure */ receiveProcedure, /* receive procedure */ - sendProcedure, /* send procedure */ + sendProcedure, /* send procedure */ InvalidOid, /* typmodin procedure - none */ InvalidOid, /* typmodout procedure - none */ analyzeProcedure, /* analyze procedure */ @@ -1054,7 +1054,7 @@ DefineDomain(CreateDomainStmt *stmt) InvalidOid, /* no arrays for domains (yet) */ basetypeoid, /* base type ID */ defaultValue, /* default type value (text) */ - defaultValueBin, /* default type value (binary) */ + defaultValueBin, /* default type value (binary) */ byValue, /* passed by value */ alignment, /* required alignment */ storage, /* TOAST strategy */ @@ -1145,7 +1145,7 @@ DefineEnum(CreateEnumStmt *stmt) enumTypeAddr = TypeCreate(InvalidOid, /* no predetermined type OID */ enumName, /* type name */ - enumNamespace, /* namespace */ + enumNamespace, /* namespace */ InvalidOid, /* relation oid (n/a here) */ 0, /* relation kind (ditto) */ GetUserId(), /* owner's ID */ @@ -1191,7 +1191,7 @@ DefineEnum(CreateEnumStmt *stmt) GetUserId(), /* owner's ID */ -1, /* internal size (always varlena) */ TYPTYPE_BASE, /* type-type (base type) */ - TYPCATEGORY_ARRAY, /* type-category (array) */ + TYPCATEGORY_ARRAY, /* type-category (array) */ false, /* array types are never preferred */ DEFAULT_TYPDELIM, /* array element delimiter */ F_ARRAY_IN, /* input procedure */ @@ -1200,7 +1200,7 @@ DefineEnum(CreateEnumStmt *stmt) F_ARRAY_SEND, /* send procedure */ InvalidOid, /* typmodin procedure - none */ InvalidOid, /* typmodout procedure - none */ - F_ARRAY_TYPANALYZE, /* analyze procedure */ + F_ARRAY_TYPANALYZE, /* analyze procedure */ enumTypeAddr.objectId, /* element type ID */ true, /* yes this is an array type */ InvalidOid, /* no further array type */ @@ -1473,12 +1473,12 @@ DefineRange(CreateRangeStmt *stmt) address = TypeCreate(InvalidOid, /* no predetermined type OID */ typeName, /* type name */ - typeNamespace, /* namespace */ + typeNamespace, /* namespace */ InvalidOid, /* relation oid (n/a here) */ 0, /* relation kind (ditto) */ GetUserId(), /* owner's ID */ -1, /* internal size (always varlena) */ - TYPTYPE_RANGE, /* type-type (range type) */ + TYPTYPE_RANGE, /* type-type (range type) */ TYPCATEGORY_RANGE, /* type-category (range type) */ false, /* range types are never preferred */ DEFAULT_TYPDELIM, /* array element delimiter */ @@ -1491,7 +1491,7 @@ DefineRange(CreateRangeStmt *stmt) F_RANGE_TYPANALYZE, /* analyze procedure */ InvalidOid, /* element type ID - none */ false, /* this is not an array type */ - rangeArrayOid, /* array type we are about to create */ + rangeArrayOid, /* array type we are about to create */ InvalidOid, /* base type ID (only for domains) */ NULL, /* never a default type value */ NULL, /* no binary form available either */ @@ -1521,7 +1521,7 @@ DefineRange(CreateRangeStmt *stmt) GetUserId(), /* owner's ID */ -1, /* internal size (always varlena) */ TYPTYPE_BASE, /* type-type (base type) */ - TYPCATEGORY_ARRAY, /* type-category (array) */ + TYPCATEGORY_ARRAY, /* type-category (array) */ false, /* array types are never preferred */ DEFAULT_TYPDELIM, /* array element delimiter */ F_ARRAY_IN, /* input procedure */ @@ -1530,7 +1530,7 @@ DefineRange(CreateRangeStmt *stmt) F_ARRAY_SEND, /* send procedure */ InvalidOid, /* typmodin procedure - none */ InvalidOid, /* typmodout procedure - none */ - F_ARRAY_TYPANALYZE, /* analyze procedure */ + F_ARRAY_TYPANALYZE, /* analyze procedure */ typoid, /* element type ID */ true, /* yes this is an array type */ InvalidOid, /* no further array type */ @@ -1591,14 +1591,14 @@ makeRangeConstructors(const char *name, Oid namespace, pronargs[i]); myself = ProcedureCreate(name, /* name: same as range type */ - namespace, /* namespace */ + namespace, /* namespace */ false, /* replace */ false, /* returns set */ - rangeOid, /* return type */ + rangeOid, /* return type */ BOOTSTRAP_SUPERUSERID, /* proowner */ INTERNALlanguageId, /* language */ - F_FMGR_INTERNAL_VALIDATOR, /* language validator */ - prosrc[i], /* prosrc */ + F_FMGR_INTERNAL_VALIDATOR, /* language validator */ + prosrc[i], /* prosrc */ NULL, /* probin */ false, /* isAgg */ false, /* isWindowFunc */ @@ -1606,8 +1606,8 @@ makeRangeConstructors(const char *name, Oid namespace, false, /* leakproof */ false, /* isStrict */ PROVOLATILE_IMMUTABLE, /* volatility */ - PROPARALLEL_SAFE, /* parallel safety */ - constructorArgTypesVector, /* parameterTypes */ + PROPARALLEL_SAFE, /* parallel safety */ + constructorArgTypesVector, /* parameterTypes */ PointerGetDatum(NULL), /* allParameterTypes */ PointerGetDatum(NULL), /* parameterModes */ PointerGetDatum(NULL), /* parameterNames */ @@ -2131,7 +2131,7 @@ AlterDomainDefault(List *names, Node *defaultRaw) ParseState *pstate; Relation rel; char *defaultValue; - Node *defaultExpr = NULL; /* NULL if no default specified */ + Node *defaultExpr = NULL; /* NULL if no default specified */ Datum new_record[Natts_pg_type]; bool new_record_nulls[Natts_pg_type]; bool new_record_repl[Natts_pg_type]; @@ -2226,7 +2226,7 @@ AlterDomainDefault(List *names, Node *defaultRaw) /* Rebuild dependencies */ GenerateTypeDependencies(typTup->typnamespace, domainoid, - InvalidOid, /* typrelid is n/a */ + InvalidOid, /* typrelid is n/a */ 0, /* relation kind is n/a */ typTup->typowner, typTup->typinput, @@ -2237,11 +2237,11 @@ AlterDomainDefault(List *names, Node *defaultRaw) typTup->typmodout, typTup->typanalyze, InvalidOid, - false, /* a domain isn't an implicit array */ + false, /* a domain isn't an implicit array */ typTup->typbasetype, typTup->typcollation, defaultExpr, - true); /* Rebuild is true */ + true); /* Rebuild is true */ InvokeObjectPostAlterHook(TypeRelationId, domainoid, 0); @@ -3065,12 +3065,12 @@ domainAddConstraint(Oid domainOid, Oid domainNamespace, Oid baseTypeOid, false, /* Is Deferrable */ false, /* Is Deferred */ !constr->skip_validation, /* Is Validated */ - InvalidOid, /* not a relation constraint */ + InvalidOid, /* not a relation constraint */ NULL, 0, - domainOid, /* domain constraint */ - InvalidOid, /* no associated index */ - InvalidOid, /* Foreign key fields */ + domainOid, /* domain constraint */ + InvalidOid, /* no associated index */ + InvalidOid, /* Foreign key fields */ NULL, NULL, NULL, @@ -3079,11 +3079,11 @@ domainAddConstraint(Oid domainOid, Oid domainNamespace, Oid baseTypeOid, ' ', ' ', ' ', - NULL, /* not an exclusion constraint */ - expr, /* Tree form of check constraint */ + NULL, /* not an exclusion constraint */ + expr, /* Tree form of check constraint */ ccbin, /* Binary form of check constraint */ ccsrc, /* Source form of check constraint */ - true, /* is local */ + true, /* is local */ 0, /* inhcount */ false, /* connoinherit */ false); /* is_internal */ diff --git a/src/backend/commands/user.c b/src/backend/commands/user.c index 10d6ba9e04..24608c27c3 100644 --- a/src/backend/commands/user.c +++ b/src/backend/commands/user.c @@ -82,18 +82,17 @@ CreateRole(ParseState *pstate, CreateRoleStmt *stmt) char *password = NULL; /* user password */ bool issuper = false; /* Make the user a superuser? */ bool inherit = true; /* Auto inherit privileges? */ - bool createrole = false; /* Can this user create roles? */ - bool createdb = false; /* Can the user create databases? */ - bool canlogin = false; /* Can this user login? */ + bool createrole = false; /* Can this user create roles? */ + bool createdb = false; /* Can the user create databases? */ + bool canlogin = false; /* Can this user login? */ bool isreplication = false; /* Is this a replication role? */ - bool bypassrls = false; /* Is this a row security enabled - * role? */ + bool bypassrls = false; /* Is this a row security enabled role? */ int connlimit = -1; /* maximum connections allowed */ List *addroleto = NIL; /* roles to make this a member of */ - List *rolemembers = NIL; /* roles to be members of this role */ - List *adminmembers = NIL; /* roles to be admins of this role */ - char *validUntil = NULL; /* time the login is valid until */ - Datum validUntil_datum; /* same, as timestamptz Datum */ + List *rolemembers = NIL; /* roles to be members of this role */ + List *adminmembers = NIL; /* roles to be admins of this role */ + char *validUntil = NULL; /* time the login is valid until */ + Datum validUntil_datum; /* same, as timestamptz Datum */ bool validUntil_null; DefElem *dpassword = NULL; DefElem *dissuper = NULL; @@ -497,11 +496,11 @@ AlterRole(AlterRoleStmt *stmt) int createrole = -1; /* Can this user create roles? */ int createdb = -1; /* Can the user create databases? */ int canlogin = -1; /* Can this user login? */ - int isreplication = -1; /* Is this a replication role? */ + int isreplication = -1; /* Is this a replication role? */ int connlimit = -1; /* maximum connections allowed */ - List *rolemembers = NIL; /* roles to be added/removed */ - char *validUntil = NULL; /* time the login is valid until */ - Datum validUntil_datum; /* same, as timestamptz Datum */ + List *rolemembers = NIL; /* roles to be added/removed */ + char *validUntil = NULL; /* time the login is valid until */ + Datum validUntil_datum; /* same, as timestamptz Datum */ bool validUntil_null; int bypassrls = -1; DefElem *dpassword = NULL; diff --git a/src/backend/commands/vacuumlazy.c b/src/backend/commands/vacuumlazy.c index 153a360861..7978c062d7 100644 --- a/src/backend/commands/vacuumlazy.c +++ b/src/backend/commands/vacuumlazy.c @@ -81,8 +81,8 @@ * that the potential for improvement was great enough to merit the cost of * supporting them. */ -#define VACUUM_TRUNCATE_LOCK_CHECK_INTERVAL 20 /* ms */ -#define VACUUM_TRUNCATE_LOCK_WAIT_INTERVAL 50 /* ms */ +#define VACUUM_TRUNCATE_LOCK_CHECK_INTERVAL 20 /* ms */ +#define VACUUM_TRUNCATE_LOCK_WAIT_INTERVAL 50 /* ms */ #define VACUUM_TRUNCATE_LOCK_TIMEOUT 5000 /* ms */ /* @@ -112,7 +112,7 @@ typedef struct LVRelStats BlockNumber old_rel_pages; /* previous value of pg_class.relpages */ BlockNumber rel_pages; /* total number of pages */ BlockNumber scanned_pages; /* number of pages we examined */ - BlockNumber pinskipped_pages; /* # of pages we skipped due to a pin */ + BlockNumber pinskipped_pages; /* # of pages we skipped due to a pin */ BlockNumber frozenskipped_pages; /* # of frozen pages we skipped */ BlockNumber tupcount_pages; /* pages whose tuples we counted */ double scanned_tuples; /* counts only tuples on tupcount_pages */ diff --git a/src/backend/commands/view.c b/src/backend/commands/view.c index a5d6574eaf..e83e4f455f 100644 --- a/src/backend/commands/view.c +++ b/src/backend/commands/view.c @@ -546,7 +546,7 @@ DefineView(ViewStmt *stmt, const char *queryString, * long as the CREATE command is consistent with that --- no explicit * schema name. */ - view = copyObject(stmt->view); /* don't corrupt original command */ + view = copyObject(stmt->view); /* don't corrupt original command */ if (view->relpersistence == RELPERSISTENCE_PERMANENT && isQueryUsingTempRelation(viewParse)) { diff --git a/src/backend/executor/execExpr.c b/src/backend/executor/execExpr.c index fe12326336..61c90a1600 100644 --- a/src/backend/executor/execExpr.c +++ b/src/backend/executor/execExpr.c @@ -344,7 +344,7 @@ ExecBuildProjectionInfo(List *targetList, attnum = variable->varattno; if (inputDesc == NULL) - isSafeVar = true; /* can't check, just assume OK */ + isSafeVar = true; /* can't check, just assume OK */ else if (attnum <= inputDesc->natts) { Form_pg_attribute attr = inputDesc->attrs[attnum - 1]; @@ -1362,7 +1362,7 @@ ExecInitExprRec(Expr *node, PlanState *parent, ExprState *state, /* If WHEN result isn't true, jump to next CASE arm */ scratch.opcode = EEOP_JUMP_IF_NOT_TRUE; - scratch.d.jump.jumpdone = -1; /* computed later */ + scratch.d.jump.jumpdone = -1; /* computed later */ ExprEvalPushStep(state, &scratch); whenstep = state->steps_len - 1; @@ -1374,7 +1374,7 @@ ExecInitExprRec(Expr *node, PlanState *parent, ExprState *state, /* Emit JUMP step to jump to end of CASE's code */ scratch.opcode = EEOP_JUMP; - scratch.d.jump.jumpdone = -1; /* computed later */ + scratch.d.jump.jumpdone = -1; /* computed later */ ExprEvalPushStep(state, &scratch); /* @@ -1720,7 +1720,7 @@ ExecInitExprRec(Expr *node, PlanState *parent, ExprState *state, /* if it's not null, skip to end of COALESCE expr */ scratch.opcode = EEOP_JUMP_IF_NOT_NULL; - scratch.d.jump.jumpdone = -1; /* adjust later */ + scratch.d.jump.jumpdone = -1; /* adjust later */ ExprEvalPushStep(state, &scratch); adjust_jumps = lappend_int(adjust_jumps, diff --git a/src/backend/executor/execExprInterp.c b/src/backend/executor/execExprInterp.c index fed0052fc6..146d1a0bec 100644 --- a/src/backend/executor/execExprInterp.c +++ b/src/backend/executor/execExprInterp.c @@ -83,7 +83,7 @@ */ #ifdef HAVE_COMPUTED_GOTO #define EEO_USE_COMPUTED_GOTO -#endif /* HAVE_COMPUTED_GOTO */ +#endif /* HAVE_COMPUTED_GOTO */ /* * Macros for opcode dispatch. @@ -112,7 +112,7 @@ static const void **dispatch_table = NULL; #define EEO_DISPATCH() goto starteval #define EEO_OPCODE(opcode) (opcode) -#endif /* EEO_USE_COMPUTED_GOTO */ +#endif /* EEO_USE_COMPUTED_GOTO */ #define EEO_NEXT() \ do { \ @@ -256,7 +256,7 @@ ExecReadyInterpretedExpr(ExprState *state) state->flags |= EEO_FLAG_DIRECT_THREADED; } -#endif /* EEO_USE_COMPUTED_GOTO */ +#endif /* EEO_USE_COMPUTED_GOTO */ state->evalfunc = ExecInterpExpr; } @@ -373,7 +373,7 @@ ExecInterpExpr(ExprState *state, ExprContext *econtext, bool *isnull) return PointerGetDatum(dispatch_table); #else Assert(state != NULL); -#endif /* EEO_USE_COMPUTED_GOTO */ +#endif /* EEO_USE_COMPUTED_GOTO */ /* setup state */ op = state->steps; @@ -1559,7 +1559,7 @@ CheckVarSlotCompatibility(TupleTableSlot *slot, int attnum, Oid vartype) TupleDesc slot_tupdesc = slot->tts_tupleDescriptor; Form_pg_attribute attr; - if (attnum > slot_tupdesc->natts) /* should never happen */ + if (attnum > slot_tupdesc->natts) /* should never happen */ elog(ERROR, "attribute number %d exceeds number of columns %d", attnum, slot_tupdesc->natts); @@ -2475,7 +2475,7 @@ ExecEvalFieldSelect(ExprState *state, ExprEvalStep *op, ExprContext *econtext) if (fieldnum <= 0) /* should never happen */ elog(ERROR, "unsupported reference to system column %d in FieldSelect", fieldnum); - if (fieldnum > tupDesc->natts) /* should never happen */ + if (fieldnum > tupDesc->natts) /* should never happen */ elog(ERROR, "attribute number %d exceeds number of columns %d", fieldnum, tupDesc->natts); attr = tupDesc->attrs[fieldnum - 1]; diff --git a/src/backend/executor/execIndexing.c b/src/backend/executor/execIndexing.c index 108060ac0f..4d81830996 100644 --- a/src/backend/executor/execIndexing.c +++ b/src/backend/executor/execIndexing.c @@ -387,7 +387,7 @@ ExecInsertIndexTuples(TupleTableSlot *slot, index_insert(indexRelation, /* index relation */ values, /* array of index Datums */ isnull, /* null flags */ - tupleid, /* tid of heap tuple */ + tupleid, /* tid of heap tuple */ heapRelation, /* heap relation */ checkUnique, /* type of uniqueness check to do */ indexInfo); /* index AM may need this */ diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c index 9dbe17565b..2e3717d4dd 100644 --- a/src/backend/executor/execMain.c +++ b/src/backend/executor/execMain.c @@ -2570,7 +2570,7 @@ EvalPlanQualFetch(EState *estate, Relation relation, int lockmode, break; case LockWaitSkip: if (!ConditionalXactLockTableWait(SnapshotDirty.xmax)) - return NULL; /* skip instead of waiting */ + return NULL; /* skip instead of waiting */ break; case LockWaitError: if (!ConditionalXactLockTableWait(SnapshotDirty.xmax)) diff --git a/src/backend/executor/execTuples.c b/src/backend/executor/execTuples.c index c4a955332f..9abf0aa15d 100644 --- a/src/backend/executor/execTuples.c +++ b/src/backend/executor/execTuples.c @@ -244,8 +244,8 @@ ExecDropSingleTupleTableSlot(TupleTableSlot *slot) * -------------------------------- */ void -ExecSetSlotDescriptor(TupleTableSlot *slot, /* slot to change */ - TupleDesc tupdesc) /* new tuple descriptor */ +ExecSetSlotDescriptor(TupleTableSlot *slot, /* slot to change */ + TupleDesc tupdesc) /* new tuple descriptor */ { /* For safety, make sure slot is empty before changing it */ ExecClearTuple(slot); diff --git a/src/backend/executor/execUtils.c b/src/backend/executor/execUtils.c index cb2596cb31..25772fc603 100644 --- a/src/backend/executor/execUtils.c +++ b/src/backend/executor/execUtils.c @@ -102,7 +102,7 @@ CreateExecutorState(void) * Initialize all fields of the Executor State structure */ estate->es_direction = ForwardScanDirection; - estate->es_snapshot = InvalidSnapshot; /* caller must initialize this */ + estate->es_snapshot = InvalidSnapshot; /* caller must initialize this */ estate->es_crosscheck_snapshot = InvalidSnapshot; /* no crosscheck */ estate->es_range_table = NIL; estate->es_plannedstmt = NULL; diff --git a/src/backend/executor/functions.c b/src/backend/executor/functions.c index f15ff64a3b..7199ff6fd7 100644 --- a/src/backend/executor/functions.c +++ b/src/backend/executor/functions.c @@ -93,7 +93,7 @@ typedef struct char *fname; /* function name (for error msgs) */ char *src; /* function body text (for error msgs) */ - SQLFunctionParseInfoPtr pinfo; /* data for parser callback hooks */ + SQLFunctionParseInfoPtr pinfo; /* data for parser callback hooks */ Oid rettype; /* actual return type */ int16 typlen; /* length of the return type */ @@ -245,13 +245,13 @@ prepare_sql_fn_parse_info(HeapTuple procedureTuple, Anum_pg_proc_proargnames, &isNull); if (isNull) - proargnames = PointerGetDatum(NULL); /* just to be sure */ + proargnames = PointerGetDatum(NULL); /* just to be sure */ proargmodes = SysCacheGetAttr(PROCNAMEARGSNSP, procedureTuple, Anum_pg_proc_proargmodes, &isNull); if (isNull) - proargmodes = PointerGetDatum(NULL); /* just to be sure */ + proargmodes = PointerGetDatum(NULL); /* just to be sure */ n_arg_names = get_func_input_arg_names(proargnames, proargmodes, &pinfo->argnames); @@ -648,7 +648,7 @@ init_sql_fcache(FmgrInfo *finfo, Oid collation, bool lazyEvalOK) if (IsPolymorphicType(rettype)) { rettype = get_fn_expr_rettype(finfo); - if (rettype == InvalidOid) /* this probably should not happen */ + if (rettype == InvalidOid) /* this probably should not happen */ ereport(ERROR, (errcode(ERRCODE_DATATYPE_MISMATCH), errmsg("could not determine actual result type for function declared to return type %s", @@ -1544,7 +1544,7 @@ check_sql_fn_retval(Oid func_id, Oid rettype, List *queryTreeList, AssertArg(!IsPolymorphicType(rettype)); if (modifyTargetList) - *modifyTargetList = false; /* initialize for no change */ + *modifyTargetList = false; /* initialize for no change */ if (junkFilter) *junkFilter = NULL; /* initialize in case of VOID result */ @@ -1770,7 +1770,7 @@ check_sql_fn_retval(Oid func_id, Oid rettype, List *queryTreeList, InvalidOid, sizeof(int32), (Datum) 0, - true, /* isnull */ + true, /* isnull */ true /* byval */ ); newtlist = lappend(newtlist, makeTargetEntry(null_expr, diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c index 96cdfb7ad2..b0f9520e53 100644 --- a/src/backend/executor/nodeAgg.c +++ b/src/backend/executor/nodeAgg.c @@ -511,9 +511,9 @@ typedef struct AggStatePerHashData FmgrInfo *eqfunctions; /* per-grouping-field equality fns */ int numCols; /* number of hash key columns */ int numhashGrpCols; /* number of columns in hash table */ - int largestGrpColIdx; /* largest col required for hashing */ - AttrNumber *hashGrpColIdxInput; /* hash col indices in input slot */ - AttrNumber *hashGrpColIdxHash; /* indices in hashtbl tuples */ + int largestGrpColIdx; /* largest col required for hashing */ + AttrNumber *hashGrpColIdxInput; /* hash col indices in input slot */ + AttrNumber *hashGrpColIdxHash; /* indices in hashtbl tuples */ Agg *aggnode; /* original Agg node, for numGroups etc. */ } AggStatePerHashData; @@ -2373,8 +2373,7 @@ agg_retrieve_direct(AggState *aggstate) firstSlot, InvalidBuffer, true); - aggstate->grp_firstTuple = NULL; /* don't keep two - * pointers */ + aggstate->grp_firstTuple = NULL; /* don't keep two pointers */ /* set up for first advance_aggregates call */ tmpcontext->ecxt_outertuple = firstSlot; diff --git a/src/backend/executor/nodeBitmapHeapscan.c b/src/backend/executor/nodeBitmapHeapscan.c index 77f65db0ca..7e0ba030b7 100644 --- a/src/backend/executor/nodeBitmapHeapscan.c +++ b/src/backend/executor/nodeBitmapHeapscan.c @@ -129,7 +129,7 @@ BitmapHeapNext(BitmapHeapScanState *node) node->prefetch_pages = 0; node->prefetch_target = -1; } -#endif /* USE_PREFETCH */ +#endif /* USE_PREFETCH */ } else { @@ -182,7 +182,7 @@ BitmapHeapNext(BitmapHeapScanState *node) node->shared_prefetch_iterator = tbm_attach_shared_iterate(dsa, pstate->prefetch_iterator); } -#endif /* USE_PREFETCH */ +#endif /* USE_PREFETCH */ } node->initialized = true; } @@ -265,7 +265,7 @@ BitmapHeapNext(BitmapHeapScanState *node) pstate->prefetch_target++; SpinLockRelease(&pstate->mutex); } -#endif /* USE_PREFETCH */ +#endif /* USE_PREFETCH */ } /* @@ -514,7 +514,7 @@ BitmapAdjustPrefetchIterator(BitmapHeapScanState *node, tbm_shared_iterate(prefetch_iterator); } } -#endif /* USE_PREFETCH */ +#endif /* USE_PREFETCH */ } /* @@ -558,7 +558,7 @@ BitmapAdjustPrefetchTarget(BitmapHeapScanState *node) pstate->prefetch_target++; SpinLockRelease(&pstate->mutex); } -#endif /* USE_PREFETCH */ +#endif /* USE_PREFETCH */ } /* @@ -634,7 +634,7 @@ BitmapPrefetch(BitmapHeapScanState *node, HeapScanDesc scan) } } } -#endif /* USE_PREFETCH */ +#endif /* USE_PREFETCH */ } /* diff --git a/src/backend/executor/nodeBitmapIndexscan.c b/src/backend/executor/nodeBitmapIndexscan.c index ce2f3210a4..c9f8b7c7fb 100644 --- a/src/backend/executor/nodeBitmapIndexscan.c +++ b/src/backend/executor/nodeBitmapIndexscan.c @@ -73,7 +73,7 @@ MultiExecBitmapIndexScan(BitmapIndexScanState *node) if (node->biss_result) { tbm = node->biss_result; - node->biss_result = NULL; /* reset for next time */ + node->biss_result = NULL; /* reset for next time */ } else { diff --git a/src/backend/executor/nodeBitmapOr.c b/src/backend/executor/nodeBitmapOr.c index c0f261407b..4f0ddc6dff 100644 --- a/src/backend/executor/nodeBitmapOr.c +++ b/src/backend/executor/nodeBitmapOr.c @@ -150,7 +150,7 @@ MultiExecBitmapOr(BitmapOrState *node) elog(ERROR, "unrecognized result from subplan"); if (result == NULL) - result = subresult; /* first subplan */ + result = subresult; /* first subplan */ else { tbm_union(result, subresult); diff --git a/src/backend/executor/nodeGather.c b/src/backend/executor/nodeGather.c index c1db2e263b..f83cd584d7 100644 --- a/src/backend/executor/nodeGather.c +++ b/src/backend/executor/nodeGather.c @@ -258,7 +258,7 @@ gather_getnext(GatherState *gatherstate) if (HeapTupleIsValid(tup)) { - ExecStoreTuple(tup, /* tuple to store */ + ExecStoreTuple(tup, /* tuple to store */ fslot, /* slot in which to store the tuple */ InvalidBuffer, /* buffer associated with this * tuple */ diff --git a/src/backend/executor/nodeGatherMerge.c b/src/backend/executor/nodeGatherMerge.c index e066574836..b1965f5e1c 100644 --- a/src/backend/executor/nodeGatherMerge.c +++ b/src/backend/executor/nodeGatherMerge.c @@ -597,7 +597,7 @@ gather_merge_readnext(GatherMergeState *gm_state, int reader, bool nowait) ExecStoreTuple(tup, /* tuple to store */ gm_state->gm_slots[reader], /* slot in which to store the * tuple */ - InvalidBuffer, /* buffer associated with this tuple */ + InvalidBuffer, /* buffer associated with this tuple */ true); /* pfree this pointer if not from heap */ return true; diff --git a/src/backend/executor/nodeHash.c b/src/backend/executor/nodeHash.c index d9789d0719..6c84ad9989 100644 --- a/src/backend/executor/nodeHash.c +++ b/src/backend/executor/nodeHash.c @@ -1176,7 +1176,7 @@ ExecScanHashTableForUnmatched(HashJoinState *hjstate, ExprContext *econtext) /* insert hashtable's tuple into exec slot */ inntuple = ExecStoreMinimalTuple(HJTUPLE_MINTUPLE(hashTuple), hjstate->hj_HashTupleSlot, - false); /* do not pfree */ + false); /* do not pfree */ econtext->ecxt_innertuple = inntuple; /* diff --git a/src/backend/executor/nodeHashjoin.c b/src/backend/executor/nodeHashjoin.c index 907090395c..8d2325398b 100644 --- a/src/backend/executor/nodeHashjoin.c +++ b/src/backend/executor/nodeHashjoin.c @@ -618,7 +618,7 @@ ExecHashJoinOuterGetTuple(PlanState *outerNode, econtext->ecxt_outertuple = slot; if (ExecHashGetHashValue(hashtable, econtext, hjstate->hj_OuterHashKeys, - true, /* outer tuple */ + true, /* outer tuple */ HJ_FILL_OUTER(hjstate), hashvalue)) { diff --git a/src/backend/executor/nodeIndexscan.c b/src/backend/executor/nodeIndexscan.c index 0fb3fb5e7e..7e123758b4 100644 --- a/src/backend/executor/nodeIndexscan.c +++ b/src/backend/executor/nodeIndexscan.c @@ -138,7 +138,7 @@ IndexNext(IndexScanState *node) */ ExecStoreTuple(tuple, /* tuple to store */ slot, /* slot to store in */ - scandesc->xs_cbuf, /* buffer containing tuple */ + scandesc->xs_cbuf, /* buffer containing tuple */ false); /* don't pfree */ /* @@ -284,7 +284,7 @@ next_indextuple: */ ExecStoreTuple(tuple, /* tuple to store */ slot, /* slot to store in */ - scandesc->xs_cbuf, /* buffer containing tuple */ + scandesc->xs_cbuf, /* buffer containing tuple */ false); /* don't pfree */ /* @@ -1296,7 +1296,7 @@ ExecIndexBuildScanKeys(PlanState *planstate, Relation index, flags, varattno, /* attribute number to scan */ op_strategy, /* op's strategy */ - op_righttype, /* strategy subtype */ + op_righttype, /* strategy subtype */ ((OpExpr *) clause)->inputcollid, /* collation */ opfuncid, /* reg proc to use */ scanvalue); /* constant */ @@ -1421,12 +1421,12 @@ ExecIndexBuildScanKeys(PlanState *planstate, Relation index, */ ScanKeyEntryInitialize(this_sub_key, flags, - varattno, /* attribute number */ - op_strategy, /* op's strategy */ + varattno, /* attribute number */ + op_strategy, /* op's strategy */ op_righttype, /* strategy subtype */ inputcollation, /* collation */ - opfuncid, /* reg proc to use */ - scanvalue); /* constant */ + opfuncid, /* reg proc to use */ + scanvalue); /* constant */ n_sub_key++; } @@ -1558,7 +1558,7 @@ ExecIndexBuildScanKeys(PlanState *planstate, Relation index, flags, varattno, /* attribute number to scan */ op_strategy, /* op's strategy */ - op_righttype, /* strategy subtype */ + op_righttype, /* strategy subtype */ saop->inputcollid, /* collation */ opfuncid, /* reg proc to use */ scanvalue); /* constant */ @@ -1608,7 +1608,7 @@ ExecIndexBuildScanKeys(PlanState *planstate, Relation index, ScanKeyEntryInitialize(this_scan_key, flags, varattno, /* attribute number to scan */ - InvalidStrategy, /* no strategy */ + InvalidStrategy, /* no strategy */ InvalidOid, /* no strategy subtype */ InvalidOid, /* no collation */ InvalidOid, /* no reg proc for this */ diff --git a/src/backend/executor/nodeLockRows.c b/src/backend/executor/nodeLockRows.c index 5630eae53d..f519794cf3 100644 --- a/src/backend/executor/nodeLockRows.c +++ b/src/backend/executor/nodeLockRows.c @@ -172,7 +172,7 @@ lnext: break; default: elog(ERROR, "unsupported rowmark type"); - lockmode = LockTupleNoKeyExclusive; /* keep compiler quiet */ + lockmode = LockTupleNoKeyExclusive; /* keep compiler quiet */ break; } diff --git a/src/backend/executor/nodeMergejoin.c b/src/backend/executor/nodeMergejoin.c index 336270f02a..94a5e98e3e 100644 --- a/src/backend/executor/nodeMergejoin.c +++ b/src/backend/executor/nodeMergejoin.c @@ -225,7 +225,7 @@ MJExamineQuals(List *mergeclauses, &op_strategy, &op_lefttype, &op_righttype); - if (op_strategy != BTEqualStrategyNumber) /* should not happen */ + if (op_strategy != BTEqualStrategyNumber) /* should not happen */ elog(ERROR, "cannot merge using non-equality operator %u", qual->opno); @@ -849,7 +849,7 @@ ExecMergeJoin(MergeJoinState *node) */ TupleTableSlot *result; - node->mj_MatchedInner = true; /* do it only once */ + node->mj_MatchedInner = true; /* do it only once */ result = MJFillInner(node); if (result) @@ -951,7 +951,7 @@ ExecMergeJoin(MergeJoinState *node) */ TupleTableSlot *result; - node->mj_MatchedOuter = true; /* do it only once */ + node->mj_MatchedOuter = true; /* do it only once */ result = MJFillOuter(node); if (result) @@ -1212,7 +1212,7 @@ ExecMergeJoin(MergeJoinState *node) */ TupleTableSlot *result; - node->mj_MatchedOuter = true; /* do it only once */ + node->mj_MatchedOuter = true; /* do it only once */ result = MJFillOuter(node); if (result) @@ -1274,7 +1274,7 @@ ExecMergeJoin(MergeJoinState *node) */ TupleTableSlot *result; - node->mj_MatchedInner = true; /* do it only once */ + node->mj_MatchedInner = true; /* do it only once */ result = MJFillInner(node); if (result) @@ -1344,7 +1344,7 @@ ExecMergeJoin(MergeJoinState *node) */ TupleTableSlot *result; - node->mj_MatchedInner = true; /* do it only once */ + node->mj_MatchedInner = true; /* do it only once */ result = MJFillInner(node); if (result) @@ -1390,7 +1390,7 @@ ExecMergeJoin(MergeJoinState *node) */ TupleTableSlot *result; - node->mj_MatchedOuter = true; /* do it only once */ + node->mj_MatchedOuter = true; /* do it only once */ result = MJFillOuter(node); if (result) diff --git a/src/backend/executor/nodeModifyTable.c b/src/backend/executor/nodeModifyTable.c index ff5ad98a91..11594b58b5 100644 --- a/src/backend/executor/nodeModifyTable.c +++ b/src/backend/executor/nodeModifyTable.c @@ -1561,8 +1561,7 @@ ExecModifyTable(ModifyTableState *node) elog(ERROR, "ctid is NULL"); tupleid = (ItemPointer) DatumGetPointer(datum); - tuple_ctid = *tupleid; /* be sure we don't free - * ctid!! */ + tuple_ctid = *tupleid; /* be sure we don't free ctid!! */ tupleid = &tuple_ctid; } @@ -1775,7 +1774,7 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags) root_rti = linitial_int(node->partitioned_rels); root_oid = getrelid(root_rti, estate->es_range_table); - rel = heap_open(root_oid, NoLock); /* locked by InitPlan */ + rel = heap_open(root_oid, NoLock); /* locked by InitPlan */ } else rel = mtstate->resultRelInfo->ri_RelationDesc; diff --git a/src/backend/executor/nodeSamplescan.c b/src/backend/executor/nodeSamplescan.c index 0247bd2347..428fd98665 100644 --- a/src/backend/executor/nodeSamplescan.c +++ b/src/backend/executor/nodeSamplescan.c @@ -415,7 +415,7 @@ tablesample_getnext(SampleScanState *scanstate) else { /* continue from previously returned page/tuple */ - blockno = scan->rs_cblock; /* current page */ + blockno = scan->rs_cblock; /* current page */ } /* diff --git a/src/backend/executor/nodeSeqscan.c b/src/backend/executor/nodeSeqscan.c index c0e37dcd83..822c6bf20a 100644 --- a/src/backend/executor/nodeSeqscan.c +++ b/src/backend/executor/nodeSeqscan.c @@ -90,8 +90,8 @@ SeqNext(SeqScanState *node) if (tuple) ExecStoreTuple(tuple, /* tuple to store */ slot, /* slot to store in */ - scandesc->rs_cbuf, /* buffer associated with this - * tuple */ + scandesc->rs_cbuf, /* buffer associated with this + * tuple */ false); /* don't pfree this pointer */ else ExecClearTuple(slot); diff --git a/src/backend/executor/nodeSetOp.c b/src/backend/executor/nodeSetOp.c index 0fb5615da3..9c7812e519 100644 --- a/src/backend/executor/nodeSetOp.c +++ b/src/backend/executor/nodeSetOp.c @@ -263,7 +263,7 @@ setop_retrieve_direct(SetOpState *setopstate) resultTupleSlot, InvalidBuffer, true); - setopstate->grp_firstTuple = NULL; /* don't keep two pointers */ + setopstate->grp_firstTuple = NULL; /* don't keep two pointers */ /* Initialize working state for a new input tuple group */ initialize_counts(pergroup); diff --git a/src/backend/executor/nodeTidscan.c b/src/backend/executor/nodeTidscan.c index 4860ec0f4d..64be613693 100644 --- a/src/backend/executor/nodeTidscan.c +++ b/src/backend/executor/nodeTidscan.c @@ -382,10 +382,10 @@ TidNext(TidScanState *node) * pointers onto disk pages and were not created with palloc() and * so should not be pfree()'d. */ - ExecStoreTuple(tuple, /* tuple to store */ + ExecStoreTuple(tuple, /* tuple to store */ slot, /* slot to store in */ - buffer, /* buffer associated with tuple */ - false); /* don't pfree */ + buffer, /* buffer associated with tuple */ + false); /* don't pfree */ /* * At this point we have an extra pin on the buffer, because @@ -551,7 +551,7 @@ ExecInitTidScan(TidScan *node, EState *estate, int eflags) currentRelation = ExecOpenScanRelation(estate, node->scan.scanrelid, eflags); tidstate->ss.ss_currentRelation = currentRelation; - tidstate->ss.ss_currentScanDesc = NULL; /* no heap scan here */ + tidstate->ss.ss_currentScanDesc = NULL; /* no heap scan here */ /* * get the scan type from the relation descriptor. diff --git a/src/backend/executor/nodeWindowAgg.c b/src/backend/executor/nodeWindowAgg.c index 433d97c8b4..1f2cbdde36 100644 --- a/src/backend/executor/nodeWindowAgg.c +++ b/src/backend/executor/nodeWindowAgg.c @@ -1895,7 +1895,7 @@ ExecInitWindowAgg(WindowAgg *node, EState *estate, int eflags) AclResult aclresult; int i; - if (wfunc->winref != node->winref) /* planner screwed up? */ + if (wfunc->winref != node->winref) /* planner screwed up? */ elog(ERROR, "WindowFunc with winref %u assigned to WindowAgg with winref %u", wfunc->winref, node->winref); @@ -2209,7 +2209,7 @@ initialize_peragg(WindowAggState *winstate, WindowFunc *wfunc, /* build expression trees using actual argument & result types */ build_aggregate_transfn_expr(inputTypes, numArguments, - 0, /* no ordered-set window functions yet */ + 0, /* no ordered-set window functions yet */ false, /* no variadic window functions yet */ aggtranstype, wfunc->inputcollid, diff --git a/src/backend/executor/spi.c b/src/backend/executor/spi.c index 97c3925874..9db41813d5 100644 --- a/src/backend/executor/spi.c +++ b/src/backend/executor/spi.c @@ -43,7 +43,7 @@ int SPI_result; static _SPI_connection *_SPI_stack = NULL; static _SPI_connection *_SPI_current = NULL; -static int _SPI_stack_depth = 0; /* allocated size of _SPI_stack */ +static int _SPI_stack_depth = 0; /* allocated size of _SPI_stack */ static int _SPI_connected = -1; /* current stack index */ static Portal SPI_cursor_open_internal(const char *name, SPIPlanPtr plan, @@ -119,7 +119,7 @@ SPI_connect(void) _SPI_current->lastoid = InvalidOid; _SPI_current->tuptable = NULL; slist_init(&_SPI_current->tuptables); - _SPI_current->procCxt = NULL; /* in case we fail to create 'em */ + _SPI_current->procCxt = NULL; /* in case we fail to create 'em */ _SPI_current->execCxt = NULL; _SPI_current->connectSubid = GetCurrentSubTransactionId(); _SPI_current->queryEnv = NULL; @@ -149,7 +149,7 @@ SPI_finish(void) { int res; - res = _SPI_begin_call(false); /* live in procedure memory */ + res = _SPI_begin_call(false); /* live in procedure memory */ if (res < 0) return res; @@ -594,7 +594,7 @@ SPI_saveplan(SPIPlanPtr plan) return NULL; } - SPI_result = _SPI_begin_call(false); /* don't change context */ + SPI_result = _SPI_begin_call(false); /* don't change context */ if (SPI_result < 0) return NULL; @@ -1813,7 +1813,7 @@ _SPI_prepare_plan(const char *src, SPIPlanPtr plan) plan->parserSetup, plan->parserSetupArg, plan->cursor_options, - false); /* not fixed result */ + false); /* not fixed result */ plancache_list = lappend(plancache_list, plansource); } @@ -2668,7 +2668,7 @@ SPI_register_relation(EphemeralNamedRelation enr) if (enr == NULL || enr->md.name == NULL) return SPI_ERROR_ARGUMENT; - res = _SPI_begin_call(false); /* keep current memory context */ + res = _SPI_begin_call(false); /* keep current memory context */ if (res < 0) return res; @@ -2702,7 +2702,7 @@ SPI_unregister_relation(const char *name) if (name == NULL) return SPI_ERROR_ARGUMENT; - res = _SPI_begin_call(false); /* keep current memory context */ + res = _SPI_begin_call(false); /* keep current memory context */ if (res < 0) return res; diff --git a/src/backend/executor/tqueue.c b/src/backend/executor/tqueue.c index 8d7e711b3b..c086b5b682 100644 --- a/src/backend/executor/tqueue.c +++ b/src/backend/executor/tqueue.c @@ -95,7 +95,7 @@ typedef struct ArrayRemapInfo int16 typlen; /* array element type's storage properties */ bool typbyval; char typalign; - TupleRemapInfo *element_remap; /* array element type's remap info */ + TupleRemapInfo *element_remap; /* array element type's remap info */ } ArrayRemapInfo; typedef struct RangeRemapInfo @@ -113,7 +113,7 @@ typedef struct RecordRemapInfo int32 localtypmod; /* If no fields of the record require remapping, these are NULL: */ TupleDesc tupledesc; /* copy of record's tupdesc */ - TupleRemapInfo **field_remap; /* each field's remap info */ + TupleRemapInfo **field_remap; /* each field's remap info */ } RecordRemapInfo; struct TupleRemapInfo diff --git a/src/backend/lib/ilist.c b/src/backend/lib/ilist.c index a108cd150b..af8d656d3e 100644 --- a/src/backend/lib/ilist.c +++ b/src/backend/lib/ilist.c @@ -108,4 +108,4 @@ slist_check(slist_head *head) ; } -#endif /* ILIST_DEBUG */ +#endif /* ILIST_DEBUG */ diff --git a/src/backend/libpq/auth.c b/src/backend/libpq/auth.c index 28893d3519..b348bce3e2 100644 --- a/src/backend/libpq/auth.c +++ b/src/backend/libpq/auth.c @@ -103,7 +103,7 @@ static struct pam_conv pam_passw_conv = { static char *pam_passwd = NULL; /* Workaround for Solaris 2.6 brokenness */ static Port *pam_port_cludge; /* Workaround for passing "Port *port" into * pam_passwd_conv_proc */ -#endif /* USE_PAM */ +#endif /* USE_PAM */ /*---------------------------------------------------------------- @@ -114,7 +114,7 @@ static Port *pam_port_cludge; /* Workaround for passing "Port *port" into #include <bsd_auth.h> static int CheckBSDAuth(Port *port, char *user); -#endif /* USE_BSD_AUTH */ +#endif /* USE_BSD_AUTH */ /*---------------------------------------------------------------- @@ -141,7 +141,7 @@ ULONG (*__ldap_start_tls_sA) ( #endif static int CheckLDAPAuth(Port *port); -#endif /* USE_LDAP */ +#endif /* USE_LDAP */ /*---------------------------------------------------------------- * Cert authentication @@ -172,7 +172,7 @@ bool pg_krb_caseins_users; #endif static int pg_GSS_recvauth(Port *port); -#endif /* ENABLE_GSS */ +#endif /* ENABLE_GSS */ /*---------------------------------------------------------------- @@ -558,7 +558,7 @@ ClientAuthentication(Port *port) status = CheckPAMAuth(port, port->user_name, ""); #else Assert(false); -#endif /* USE_PAM */ +#endif /* USE_PAM */ break; case uaBSD: @@ -566,7 +566,7 @@ ClientAuthentication(Port *port) status = CheckBSDAuth(port, port->user_name); #else Assert(false); -#endif /* USE_BSD_AUTH */ +#endif /* USE_BSD_AUTH */ break; case uaLDAP: @@ -671,7 +671,7 @@ recv_password_packet(Port *port) } initStringInfo(&buf); - if (pq_getmessage(&buf, 1000)) /* receive password */ + if (pq_getmessage(&buf, 1000)) /* receive password */ { /* EOF - pq_getmessage already logged a suitable message */ pfree(buf.data); @@ -1287,7 +1287,7 @@ pg_GSS_recvauth(Port *port) return ret; } -#endif /* ENABLE_GSS */ +#endif /* ENABLE_GSS */ /*---------------------------------------------------------------- @@ -1696,7 +1696,7 @@ pg_SSPI_make_upn(char *accountname, pfree(upname); return STATUS_OK; } -#endif /* ENABLE_SSPI */ +#endif /* ENABLE_SSPI */ @@ -1715,7 +1715,7 @@ static bool interpret_ident_response(const char *ident_response, char *ident_user) { - const char *cursor = ident_response; /* Cursor into *ident_response */ + const char *cursor = ident_response; /* Cursor into *ident_response */ /* * Ident's response, in the telnet tradition, should end in crlf (\r\n). @@ -1769,7 +1769,7 @@ interpret_ident_response(const char *ident_response, { int i; /* Index into *ident_user */ - cursor++; /* Go over colon */ + cursor++; /* Go over colon */ while (pg_isblank(*cursor)) cursor++; /* skip blanks */ /* Rest of line is user name. Copy it over. */ @@ -1805,7 +1805,7 @@ ident_inet(hbaPort *port) const SockAddr remote_addr = port->raddr; const SockAddr local_addr = port->laddr; char ident_user[IDENT_USERNAME_MAX + 1]; - pgsocket sock_fd = PGINVALID_SOCKET; /* for talking to Ident server */ + pgsocket sock_fd = PGINVALID_SOCKET; /* for talking to Ident server */ int rc; /* Return code from a locally called function */ bool ident_return; char remote_addr_s[NI_MAXHOST]; @@ -2010,7 +2010,7 @@ auth_peer(hbaPort *port) return check_usermap(port->hba->usermap, port->user_name, ident_user, false); } -#endif /* HAVE_UNIX_SOCKETS */ +#endif /* HAVE_UNIX_SOCKETS */ /*---------------------------------------------------------------- @@ -2161,8 +2161,8 @@ CheckPAMAuth(Port *port, char *user, char *password) * later used inside the PAM conversation to pass the password to the * authentication module. */ - pam_passw_conv.appdata_ptr = (char *) password; /* from password above, - * not allocated */ + pam_passw_conv.appdata_ptr = (char *) password; /* from password above, + * not allocated */ /* Optionally, one can set the service name in pg_hba.conf */ if (port->hba->pamservice && port->hba->pamservice[0] != '\0') @@ -2249,7 +2249,7 @@ CheckPAMAuth(Port *port, char *user, char *password) return (retval == PAM_SUCCESS ? STATUS_OK : STATUS_ERROR); } -#endif /* USE_PAM */ +#endif /* USE_PAM */ /*---------------------------------------------------------------- @@ -2282,7 +2282,7 @@ CheckBSDAuth(Port *port, char *user) return STATUS_OK; } -#endif /* USE_BSD_AUTH */ +#endif /* USE_BSD_AUTH */ /*---------------------------------------------------------------- @@ -2581,7 +2581,7 @@ CheckLDAPAuth(Port *port) return STATUS_OK; } -#endif /* USE_LDAP */ +#endif /* USE_LDAP */ /*---------------------------------------------------------------- @@ -3071,8 +3071,8 @@ PerformRadiusTransaction(char *server, char *secret, char *portstr, char *identi memcpy(cryptvector + 4, packet->vector, RADIUS_VECTOR_LENGTH); /* request * authenticator, from * original packet */ - if (packetlength > RADIUS_HEADER_LENGTH) /* there may be no - * attributes at all */ + if (packetlength > RADIUS_HEADER_LENGTH) /* there may be no + * attributes at all */ memcpy(cryptvector + RADIUS_HEADER_LENGTH, receive_buffer + RADIUS_HEADER_LENGTH, packetlength - RADIUS_HEADER_LENGTH); memcpy(cryptvector + packetlength, secret, strlen(secret)); diff --git a/src/backend/libpq/be-fsstubs.c b/src/backend/libpq/be-fsstubs.c index 9033dd4da8..3a0bb4ca0a 100644 --- a/src/backend/libpq/be-fsstubs.c +++ b/src/backend/libpq/be-fsstubs.c @@ -796,7 +796,7 @@ lo_get_fragment_internal(Oid loOid, int64 offset, int32 nbytes) if (loSize > offset) { if (nbytes >= 0 && nbytes <= loSize - offset) - result_length = nbytes; /* request is wholly inside LO */ + result_length = nbytes; /* request is wholly inside LO */ else result_length = loSize - offset; /* adjust to end of LO */ } diff --git a/src/backend/libpq/hba.c b/src/backend/libpq/hba.c index 4532434140..a1d77969cc 100644 --- a/src/backend/libpq/hba.c +++ b/src/backend/libpq/hba.c @@ -664,7 +664,7 @@ ipv6eq(struct sockaddr_in6 *a, struct sockaddr_in6 *b) return true; } -#endif /* HAVE_IPV6 */ +#endif /* HAVE_IPV6 */ /* * Check whether host name matches pattern. @@ -1022,7 +1022,7 @@ parse_hba_line(TokenizedLine *tok_line, int elevel) *err_msg = "hostssl record cannot match because SSL is not supported by this build"; #endif } - else if (token->string[4] == 'n') /* "hostnossl" */ + else if (token->string[4] == 'n') /* "hostnossl" */ { parsedline->conntype = ctHostNoSSL; } @@ -1726,7 +1726,7 @@ parse_hba_auth_opt(char *name, char *val, HbaLine *hbaline, hbaline->ldapbasedn = pstrdup(urldata->lud_dn); if (urldata->lud_attrs) - hbaline->ldapsearchattribute = pstrdup(urldata->lud_attrs[0]); /* only use first one */ + hbaline->ldapsearchattribute = pstrdup(urldata->lud_attrs[0]); /* only use first one */ hbaline->ldapscope = urldata->lud_scope; if (urldata->lud_filter) { @@ -1743,7 +1743,7 @@ parse_hba_auth_opt(char *name, char *val, HbaLine *hbaline, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("LDAP URLs not supported on this platform"))); *err_msg = "LDAP URLs not supported on this platform"; -#endif /* not OpenLDAP */ +#endif /* not OpenLDAP */ } else if (strcmp(name, "ldaptls") == 0) { diff --git a/src/backend/libpq/ifaddr.c b/src/backend/libpq/ifaddr.c index b5f3243410..53bf6bcd80 100644 --- a/src/backend/libpq/ifaddr.c +++ b/src/backend/libpq/ifaddr.c @@ -99,7 +99,7 @@ range_sockaddr_AF_INET6(const struct sockaddr_in6 *addr, return 1; } -#endif /* HAVE_IPV6 */ +#endif /* HAVE_IPV6 */ /* * pg_sockaddr_cidr_mask - make a network mask of the appropriate family @@ -471,7 +471,7 @@ pg_foreach_ifaddr(PgIfAddrCallback callback, void *cb_data) #define _SIZEOF_ADDR_IFREQ(ifr) \ sizeof (struct ifreq) #endif -#endif /* !_SIZEOF_ADDR_IFREQ */ +#endif /* !_SIZEOF_ADDR_IFREQ */ /* * Enumerate the system's network interface addresses and call the callback @@ -589,6 +589,6 @@ pg_foreach_ifaddr(PgIfAddrCallback callback, void *cb_data) return 0; } -#endif /* !defined(SIOCGIFCONF) */ +#endif /* !defined(SIOCGIFCONF) */ -#endif /* !HAVE_GETIFADDRS */ +#endif /* !HAVE_GETIFADDRS */ diff --git a/src/backend/libpq/pqcomm.c b/src/backend/libpq/pqcomm.c index 1dffa98c44..98e408100d 100644 --- a/src/backend/libpq/pqcomm.c +++ b/src/backend/libpq/pqcomm.c @@ -149,7 +149,7 @@ static int internal_flush(void); #ifdef HAVE_UNIX_SOCKETS static int Lock_AF_UNIX(char *unixSocketDir, char *unixSocketPath); static int Setup_AF_UNIX(char *sock_path); -#endif /* HAVE_UNIX_SOCKETS */ +#endif /* HAVE_UNIX_SOCKETS */ static PQcommMethods PqCommSocketMethods = { socket_comm_reset, @@ -253,7 +253,7 @@ socket_close(int code, Datum arg) if (MyProcPort->gss->cred != GSS_C_NO_CREDENTIAL) gss_release_cred(&min_s, &MyProcPort->gss->cred); -#endif /* ENABLE_GSS */ +#endif /* ENABLE_GSS */ /* * GSS and SSPI share the port->gss struct. Since nowhere else does a @@ -261,7 +261,7 @@ socket_close(int code, Datum arg) * BackendInitialize(). */ free(MyProcPort->gss); -#endif /* ENABLE_GSS || ENABLE_SSPI */ +#endif /* ENABLE_GSS || ENABLE_SSPI */ /* * Cleanly shut down SSL layer. Nowhere else does a postmaster child @@ -362,7 +362,7 @@ StreamServerPort(int family, char *hostName, unsigned short portNumber, service = unixSocketPath; } else -#endif /* HAVE_UNIX_SOCKETS */ +#endif /* HAVE_UNIX_SOCKETS */ { snprintf(portNumberStr, sizeof(portNumberStr), "%d", portNumber); service = portNumberStr; @@ -680,7 +680,7 @@ Setup_AF_UNIX(char *sock_path) } return STATUS_OK; } -#endif /* HAVE_UNIX_SOCKETS */ +#endif /* HAVE_UNIX_SOCKETS */ /* @@ -858,8 +858,8 @@ TouchSocketFiles(void) #else /* !HAVE_UTIME */ #ifdef HAVE_UTIMES utimes(sock_path, NULL); -#endif /* HAVE_UTIMES */ -#endif /* HAVE_UTIME */ +#endif /* HAVE_UTIMES */ +#endif /* HAVE_UTIME */ } } @@ -1704,11 +1704,11 @@ pq_getkeepalivesidle(Port *port) elog(LOG, "getsockopt(TCP_KEEPALIVE) failed: %m"); port->default_keepalives_idle = -1; /* don't know */ } -#endif /* TCP_KEEPIDLE */ +#endif /* TCP_KEEPIDLE */ #else /* WIN32 */ /* We can't get the defaults on Windows, so return "don't know" */ port->default_keepalives_idle = -1; -#endif /* WIN32 */ +#endif /* WIN32 */ } return port->default_keepalives_idle; @@ -1733,7 +1733,7 @@ pq_setkeepalivesidle(int idle, Port *port) if (pq_getkeepalivesidle(port) < 0) { if (idle == 0) - return STATUS_OK; /* default is set but unknown */ + return STATUS_OK; /* default is set but unknown */ else return STATUS_ERROR; } @@ -1792,12 +1792,12 @@ pq_getkeepalivesinterval(Port *port) &size) < 0) { elog(LOG, "getsockopt(TCP_KEEPINTVL) failed: %m"); - port->default_keepalives_interval = -1; /* don't know */ + port->default_keepalives_interval = -1; /* don't know */ } #else /* We can't get the defaults on Windows, so return "don't know" */ port->default_keepalives_interval = -1; -#endif /* WIN32 */ +#endif /* WIN32 */ } return port->default_keepalives_interval; @@ -1822,7 +1822,7 @@ pq_setkeepalivesinterval(int interval, Port *port) if (pq_getkeepalivesinterval(port) < 0) { if (interval == 0) - return STATUS_OK; /* default is set but unknown */ + return STATUS_OK; /* default is set but unknown */ else return STATUS_ERROR; } @@ -1872,7 +1872,7 @@ pq_getkeepalivescount(Port *port) &size) < 0) { elog(LOG, "getsockopt(TCP_KEEPCNT) failed: %m"); - port->default_keepalives_count = -1; /* don't know */ + port->default_keepalives_count = -1; /* don't know */ } } @@ -1897,7 +1897,7 @@ pq_setkeepalivescount(int count, Port *port) if (pq_getkeepalivescount(port) < 0) { if (count == 0) - return STATUS_OK; /* default is set but unknown */ + return STATUS_OK; /* default is set but unknown */ else return STATUS_ERROR; } diff --git a/src/backend/main/main.c b/src/backend/main/main.c index 8846865ba3..7c7cddbdb1 100644 --- a/src/backend/main/main.c +++ b/src/backend/main/main.c @@ -217,7 +217,7 @@ main(int argc, char *argv[]) #endif if (argc > 1 && strcmp(argv[1], "--boot") == 0) - AuxiliaryProcessMain(argc, argv); /* does not return */ + AuxiliaryProcessMain(argc, argv); /* does not return */ else if (argc > 1 && strcmp(argv[1], "--describe-config") == 0) GucInfoMain(); /* does not return */ else if (argc > 1 && strcmp(argv[1], "--single") == 0) @@ -225,7 +225,7 @@ main(int argc, char *argv[]) NULL, /* no dbname */ strdup(get_user_name_or_exit(progname))); /* does not return */ else - PostmasterMain(argc, argv); /* does not return */ + PostmasterMain(argc, argv); /* does not return */ abort(); /* should not get here */ } @@ -283,10 +283,10 @@ startup_hacks(const char *progname) { _set_FMA3_enable(0); } -#endif /* defined(_M_AMD64) && _MSC_VER == 1800 */ +#endif /* defined(_M_AMD64) && _MSC_VER == 1800 */ } -#endif /* WIN32 */ +#endif /* WIN32 */ /* * Initialize dummy_spinlock, in case we are on a platform where we have @@ -419,5 +419,5 @@ check_root(const char *progname) "more information on how to properly start the server.\n"); exit(1); } -#endif /* WIN32 */ +#endif /* WIN32 */ } diff --git a/src/backend/nodes/equalfuncs.c b/src/backend/nodes/equalfuncs.c index ed51e1f6e0..91d64b7331 100644 --- a/src/backend/nodes/equalfuncs.c +++ b/src/backend/nodes/equalfuncs.c @@ -2311,7 +2311,7 @@ _equalParamRef(const ParamRef *a, const ParamRef *b) static bool _equalAConst(const A_Const *a, const A_Const *b) { - if (!equal(&a->val, &b->val)) /* hack for in-line Value field */ + if (!equal(&a->val, &b->val)) /* hack for in-line Value field */ return false; COMPARE_LOCATION_FIELD(location); diff --git a/src/backend/nodes/list.c b/src/backend/nodes/list.c index f09aa248d8..acaf4b5315 100644 --- a/src/backend/nodes/list.c +++ b/src/backend/nodes/list.c @@ -52,7 +52,7 @@ check_list_invariants(const List *list) } #else #define check_list_invariants(l) -#endif /* USE_ASSERT_CHECKING */ +#endif /* USE_ASSERT_CHECKING */ /* * Return a freshly allocated List. Since empty non-NIL lists are diff --git a/src/backend/nodes/makefuncs.c b/src/backend/nodes/makefuncs.c index f5fde1533f..0755039da9 100644 --- a/src/backend/nodes/makefuncs.c +++ b/src/backend/nodes/makefuncs.c @@ -522,8 +522,8 @@ makeFuncExpr(Oid funcid, Oid rettype, List *args, funcexpr = makeNode(FuncExpr); funcexpr->funcid = funcid; funcexpr->funcresulttype = rettype; - funcexpr->funcretset = false; /* only allowed case here */ - funcexpr->funcvariadic = false; /* only allowed case here */ + funcexpr->funcretset = false; /* only allowed case here */ + funcexpr->funcvariadic = false; /* only allowed case here */ funcexpr->funcformat = fformat; funcexpr->funccollid = funccollid; funcexpr->inputcollid = inputcollid; diff --git a/src/backend/nodes/nodeFuncs.c b/src/backend/nodes/nodeFuncs.c index 2cceb99fd9..c87fb300d6 100644 --- a/src/backend/nodes/nodeFuncs.c +++ b/src/backend/nodes/nodeFuncs.c @@ -1007,10 +1007,10 @@ exprSetCollation(Node *expr, Oid collation) ((NullIfExpr *) expr)->opcollid = collation; break; case T_ScalarArrayOpExpr: - Assert(!OidIsValid(collation)); /* result is always boolean */ + Assert(!OidIsValid(collation)); /* result is always boolean */ break; case T_BoolExpr: - Assert(!OidIsValid(collation)); /* result is always boolean */ + Assert(!OidIsValid(collation)); /* result is always boolean */ break; case T_SubLink: #ifdef USE_ASSERT_CHECKING @@ -1036,13 +1036,13 @@ exprSetCollation(Node *expr, Oid collation) Assert(!OidIsValid(collation)); } } -#endif /* USE_ASSERT_CHECKING */ +#endif /* USE_ASSERT_CHECKING */ break; case T_FieldSelect: ((FieldSelect *) expr)->resultcollid = collation; break; case T_FieldStore: - Assert(!OidIsValid(collation)); /* result is always composite */ + Assert(!OidIsValid(collation)); /* result is always composite */ break; case T_RelabelType: ((RelabelType *) expr)->resultcollid = collation; @@ -1054,7 +1054,7 @@ exprSetCollation(Node *expr, Oid collation) ((ArrayCoerceExpr *) expr)->resultcollid = collation; break; case T_ConvertRowtypeExpr: - Assert(!OidIsValid(collation)); /* result is always composite */ + Assert(!OidIsValid(collation)); /* result is always composite */ break; case T_CaseExpr: ((CaseExpr *) expr)->casecollid = collation; @@ -1063,10 +1063,10 @@ exprSetCollation(Node *expr, Oid collation) ((ArrayExpr *) expr)->array_collid = collation; break; case T_RowExpr: - Assert(!OidIsValid(collation)); /* result is always composite */ + Assert(!OidIsValid(collation)); /* result is always composite */ break; case T_RowCompareExpr: - Assert(!OidIsValid(collation)); /* result is always boolean */ + Assert(!OidIsValid(collation)); /* result is always boolean */ break; case T_CoalesceExpr: ((CoalesceExpr *) expr)->coalescecollid = collation; @@ -1075,7 +1075,7 @@ exprSetCollation(Node *expr, Oid collation) ((MinMaxExpr *) expr)->minmaxcollid = collation; break; case T_SQLValueFunction: - Assert(!OidIsValid(collation)); /* no collatable results */ + Assert(!OidIsValid(collation)); /* no collatable results */ break; case T_XmlExpr: Assert((((XmlExpr *) expr)->op == IS_XMLSERIALIZE) ? @@ -1083,10 +1083,10 @@ exprSetCollation(Node *expr, Oid collation) (collation == InvalidOid)); break; case T_NullTest: - Assert(!OidIsValid(collation)); /* result is always boolean */ + Assert(!OidIsValid(collation)); /* result is always boolean */ break; case T_BooleanTest: - Assert(!OidIsValid(collation)); /* result is always boolean */ + Assert(!OidIsValid(collation)); /* result is always boolean */ break; case T_CoerceToDomain: ((CoerceToDomain *) expr)->resultcollid = collation; @@ -1098,11 +1098,11 @@ exprSetCollation(Node *expr, Oid collation) ((SetToDefault *) expr)->collation = collation; break; case T_CurrentOfExpr: - Assert(!OidIsValid(collation)); /* result is always boolean */ + Assert(!OidIsValid(collation)); /* result is always boolean */ break; case T_NextValueExpr: - Assert(!OidIsValid(collation)); /* result is always an integer - * type */ + Assert(!OidIsValid(collation)); /* result is always an integer + * type */ break; default: elog(ERROR, "unrecognized node type: %d", (int) nodeTag(expr)); diff --git a/src/backend/nodes/params.c b/src/backend/nodes/params.c index 0fb08b94db..ac0cb3bc22 100644 --- a/src/backend/nodes/params.c +++ b/src/backend/nodes/params.c @@ -120,7 +120,7 @@ EstimateParamListSpace(ParamListInfo paramLI) } sz = add_size(sz, sizeof(Oid)); /* space for type OID */ - sz = add_size(sz, sizeof(uint16)); /* space for pflags */ + sz = add_size(sz, sizeof(uint16)); /* space for pflags */ /* space for datum/isnull */ if (OidIsValid(typeOid)) diff --git a/src/backend/nodes/readfuncs.c b/src/backend/nodes/readfuncs.c index 84147f9754..2988e8bd16 100644 --- a/src/backend/nodes/readfuncs.c +++ b/src/backend/nodes/readfuncs.c @@ -446,8 +446,7 @@ _readRangeVar(void) { READ_LOCALS(RangeVar); - local_node->catalogname = NULL; /* not currently saved in output - * format */ + local_node->catalogname = NULL; /* not currently saved in output format */ READ_STRING_FIELD(schemaname); READ_STRING_FIELD(relname); @@ -539,7 +538,7 @@ _readConst(void) token = pg_strtok(&length); /* skip :constvalue */ if (local_node->constisnull) - token = pg_strtok(&length); /* skip "<>" */ + token = pg_strtok(&length); /* skip "<>" */ else local_node->constvalue = readDatum(local_node->constbyval); diff --git a/src/backend/nodes/tidbitmap.c b/src/backend/nodes/tidbitmap.c index bbd39a2ed9..06f20a2148 100644 --- a/src/backend/nodes/tidbitmap.c +++ b/src/backend/nodes/tidbitmap.c @@ -216,7 +216,7 @@ typedef struct PTIterationArray */ struct TBMSharedIterator { - TBMSharedIteratorState *state; /* shared state */ + TBMSharedIteratorState *state; /* shared state */ PTEntryArray *ptbase; /* pagetable element array */ PTIterationArray *ptpages; /* sorted exact page index list */ PTIterationArray *ptchunks; /* sorted lossy page index list */ @@ -297,8 +297,8 @@ tbm_create(long maxbytes, dsa_area *dsa) */ nbuckets = maxbytes / (sizeof(PagetableEntry) + sizeof(Pointer) + sizeof(Pointer)); - nbuckets = Min(nbuckets, INT_MAX - 1); /* safety limit */ - nbuckets = Max(nbuckets, 16); /* sanity limit */ + nbuckets = Min(nbuckets, INT_MAX - 1); /* safety limit */ + nbuckets = Max(nbuckets, 16); /* sanity limit */ tbm->maxentries = (int) nbuckets; tbm->lossify_start = 0; tbm->dsa = dsa; diff --git a/src/backend/optimizer/geqo/geqo_cx.c b/src/backend/optimizer/geqo/geqo_cx.c index c72081e81a..d05327d8ab 100644 --- a/src/backend/optimizer/geqo/geqo_cx.c +++ b/src/backend/optimizer/geqo/geqo_cx.c @@ -121,4 +121,4 @@ cx(PlannerInfo *root, Gene *tour1, Gene *tour2, Gene *offspring, return num_diffs; } -#endif /* defined(CX) */ +#endif /* defined(CX) */ diff --git a/src/backend/optimizer/geqo/geqo_erx.c b/src/backend/optimizer/geqo/geqo_erx.c index 173be44409..fbabe2e25a 100644 --- a/src/backend/optimizer/geqo/geqo_erx.c +++ b/src/backend/optimizer/geqo/geqo_erx.c @@ -468,4 +468,4 @@ edge_failure(PlannerInfo *root, Gene *gene, int index, Edge *edge_table, int num return 0; /* to keep the compiler quiet */ } -#endif /* defined(ERX) */ +#endif /* defined(ERX) */ diff --git a/src/backend/optimizer/geqo/geqo_misc.c b/src/backend/optimizer/geqo/geqo_misc.c index 503a19f6d6..937cb5fe0f 100644 --- a/src/backend/optimizer/geqo/geqo_misc.c +++ b/src/backend/optimizer/geqo/geqo_misc.c @@ -129,4 +129,4 @@ print_edge_table(FILE *fp, Edge *edge_table, int num_gene) fflush(fp); } -#endif /* GEQO_DEBUG */ +#endif /* GEQO_DEBUG */ diff --git a/src/backend/optimizer/geqo/geqo_mutation.c b/src/backend/optimizer/geqo/geqo_mutation.c index c6af00a2a7..2af0295d69 100644 --- a/src/backend/optimizer/geqo/geqo_mutation.c +++ b/src/backend/optimizer/geqo/geqo_mutation.c @@ -63,4 +63,4 @@ geqo_mutation(PlannerInfo *root, Gene *tour, int num_gene) } } -#endif /* defined(CX) */ +#endif /* defined(CX) */ diff --git a/src/backend/optimizer/geqo/geqo_ox1.c b/src/backend/optimizer/geqo/geqo_ox1.c index 891cfa2403..53dacb811f 100644 --- a/src/backend/optimizer/geqo/geqo_ox1.c +++ b/src/backend/optimizer/geqo/geqo_ox1.c @@ -92,4 +92,4 @@ ox1(PlannerInfo *root, Gene *tour1, Gene *tour2, Gene *offspring, int num_gene, } -#endif /* defined(OX1) */ +#endif /* defined(OX1) */ diff --git a/src/backend/optimizer/geqo/geqo_ox2.c b/src/backend/optimizer/geqo/geqo_ox2.c index b43455d3eb..8d5baa9826 100644 --- a/src/backend/optimizer/geqo/geqo_ox2.c +++ b/src/backend/optimizer/geqo/geqo_ox2.c @@ -109,4 +109,4 @@ ox2(PlannerInfo *root, Gene *tour1, Gene *tour2, Gene *offspring, int num_gene, } -#endif /* defined(OX2) */ +#endif /* defined(OX2) */ diff --git a/src/backend/optimizer/geqo/geqo_pmx.c b/src/backend/optimizer/geqo/geqo_pmx.c index e9485cc8b5..ddbc78172c 100644 --- a/src/backend/optimizer/geqo/geqo_pmx.c +++ b/src/backend/optimizer/geqo/geqo_pmx.c @@ -221,4 +221,4 @@ pmx(PlannerInfo *root, Gene *tour1, Gene *tour2, Gene *offspring, int num_gene) pfree(check_list); } -#endif /* defined(PMX) */ +#endif /* defined(PMX) */ diff --git a/src/backend/optimizer/geqo/geqo_pool.c b/src/backend/optimizer/geqo/geqo_pool.c index 0f7a26c9a1..596a2cda20 100644 --- a/src/backend/optimizer/geqo/geqo_pool.c +++ b/src/backend/optimizer/geqo/geqo_pool.c @@ -54,7 +54,7 @@ alloc_pool(PlannerInfo *root, int pool_size, int string_length) new_pool->data = (Chromosome *) palloc(pool_size * sizeof(Chromosome)); /* all gene */ - chromo = (Chromosome *) new_pool->data; /* vector of all chromos */ + chromo = (Chromosome *) new_pool->data; /* vector of all chromos */ for (i = 0; i < pool_size; i++) chromo[i].string = palloc((string_length + 1) * sizeof(Gene)); diff --git a/src/backend/optimizer/geqo/geqo_px.c b/src/backend/optimizer/geqo/geqo_px.c index f7f615462c..2e7748c5aa 100644 --- a/src/backend/optimizer/geqo/geqo_px.c +++ b/src/backend/optimizer/geqo/geqo_px.c @@ -107,4 +107,4 @@ px(PlannerInfo *root, Gene *tour1, Gene *tour2, Gene *offspring, int num_gene, } -#endif /* defined(PX) */ +#endif /* defined(PX) */ diff --git a/src/backend/optimizer/geqo/geqo_recombination.c b/src/backend/optimizer/geqo/geqo_recombination.c index a61547c16d..eb6ab42808 100644 --- a/src/backend/optimizer/geqo/geqo_recombination.c +++ b/src/backend/optimizer/geqo/geqo_recombination.c @@ -89,4 +89,4 @@ free_city_table(PlannerInfo *root, City *city_table) pfree(city_table); } -#endif /* CX || PX || OX1 || OX2 */ +#endif /* CX || PX || OX1 || OX2 */ diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c index 78ca55bbd6..23b524fce5 100644 --- a/src/backend/optimizer/path/allpaths.c +++ b/src/backend/optimizer/path/allpaths.c @@ -159,7 +159,7 @@ make_one_rel(PlannerInfo *root, List *joinlist) if (brel == NULL) continue; - Assert(brel->relid == rti); /* sanity check on array */ + Assert(brel->relid == rti); /* sanity check on array */ /* ignore RTEs that are "other rels" */ if (brel->reloptkind != RELOPT_BASEREL) @@ -258,7 +258,7 @@ set_base_rel_sizes(PlannerInfo *root) if (rel == NULL) continue; - Assert(rel->relid == rti); /* sanity check on array */ + Assert(rel->relid == rti); /* sanity check on array */ /* ignore RTEs that are "other rels" */ if (rel->reloptkind != RELOPT_BASEREL) @@ -300,7 +300,7 @@ set_base_rel_pathlists(PlannerInfo *root) if (rel == NULL) continue; - Assert(rel->relid == rti); /* sanity check on array */ + Assert(rel->relid == rti); /* sanity check on array */ /* ignore RTEs that are "other rels" */ if (rel->reloptkind != RELOPT_BASEREL) @@ -3442,4 +3442,4 @@ debug_print_rel(PlannerInfo *root, RelOptInfo *rel) fflush(stdout); } -#endif /* OPTIMIZER_DEBUG */ +#endif /* OPTIMIZER_DEBUG */ diff --git a/src/backend/optimizer/path/clausesel.c b/src/backend/optimizer/path/clausesel.c index 758ddea4a5..8d09f0b32b 100644 --- a/src/backend/optimizer/path/clausesel.c +++ b/src/backend/optimizer/path/clausesel.c @@ -31,7 +31,7 @@ */ typedef struct RangeQueryClause { - struct RangeQueryClause *next; /* next in linked list */ + struct RangeQueryClause *next; /* next in linked list */ Node *var; /* The common variable of the clauses */ bool have_lobound; /* found a low-bound clause yet? */ bool have_hibound; /* found a high-bound clause yet? */ @@ -848,7 +848,7 @@ clause_selectivity(PlannerInfo *root, #ifdef SELECTIVITY_DEBUG elog(DEBUG4, "clause_selectivity: s1 %f", s1); -#endif /* SELECTIVITY_DEBUG */ +#endif /* SELECTIVITY_DEBUG */ return s1; } diff --git a/src/backend/optimizer/path/costsize.c b/src/backend/optimizer/path/costsize.c index 6ed3c634b8..c5c4580bc0 100644 --- a/src/backend/optimizer/path/costsize.c +++ b/src/backend/optimizer/path/costsize.c @@ -2963,7 +2963,7 @@ initial_cost_hashjoin(PlannerInfo *root, JoinCostWorkspace *workspace, */ ExecChooseHashTableSize(inner_path_rows, inner_path->pathtarget->width, - true, /* useskew */ + true, /* useskew */ &numbuckets, &numbatches, &num_skew_mcvs); @@ -4047,7 +4047,7 @@ get_parameterized_baserel_size(PlannerInfo *root, RelOptInfo *rel, nrows = rel->tuples * clauselist_selectivity(root, allclauses, - rel->relid, /* do not use 0! */ + rel->relid, /* do not use 0! */ JOIN_INNER, NULL); nrows = clamp_row_est(nrows); diff --git a/src/backend/optimizer/path/equivclass.c b/src/backend/optimizer/path/equivclass.c index 67bd760fb4..b65bf818b5 100644 --- a/src/backend/optimizer/path/equivclass.c +++ b/src/backend/optimizer/path/equivclass.c @@ -244,7 +244,7 @@ process_equivalence(PlannerInfo *root, RestrictInfo *restrictinfo, { EquivalenceMember *cur_em = (EquivalenceMember *) lfirst(lc2); - Assert(!cur_em->em_is_child); /* no children yet */ + Assert(!cur_em->em_is_child); /* no children yet */ /* * If below an outer join, don't match constants: they're not as @@ -1704,7 +1704,7 @@ reconsider_outer_join_clause(PlannerInfo *root, RestrictInfo *rinfo, { EquivalenceMember *cur_em = (EquivalenceMember *) lfirst(lc2); - Assert(!cur_em->em_is_child); /* no children yet */ + Assert(!cur_em->em_is_child); /* no children yet */ if (equal(outervar, cur_em->em_expr)) { match = true; @@ -1834,7 +1834,7 @@ reconsider_full_join_clause(PlannerInfo *root, RestrictInfo *rinfo) foreach(lc2, cur_ec->ec_members) { coal_em = (EquivalenceMember *) lfirst(lc2); - Assert(!coal_em->em_is_child); /* no children yet */ + Assert(!coal_em->em_is_child); /* no children yet */ if (IsA(coal_em->em_expr, CoalesceExpr)) { CoalesceExpr *cexpr = (CoalesceExpr *) coal_em->em_expr; @@ -1997,7 +1997,7 @@ match_eclasses_to_foreign_key_col(PlannerInfo *root, Index var2varno = fkinfo->ref_relid; AttrNumber var2attno = fkinfo->confkey[colno]; Oid eqop = fkinfo->conpfeqop[colno]; - List *opfamilies = NIL; /* compute only if needed */ + List *opfamilies = NIL; /* compute only if needed */ ListCell *lc1; foreach(lc1, root->eq_classes) diff --git a/src/backend/optimizer/path/indxpath.c b/src/backend/optimizer/path/indxpath.c index 07ab33902b..97611211f0 100644 --- a/src/backend/optimizer/path/indxpath.c +++ b/src/backend/optimizer/path/indxpath.c @@ -1170,7 +1170,7 @@ build_paths_for_OR(PlannerInfo *root, RelOptInfo *rel, List *clauses, List *other_clauses) { List *result = NIL; - List *all_clauses = NIL; /* not computed till needed */ + List *all_clauses = NIL; /* not computed till needed */ ListCell *lc; foreach(lc, rel->indexlist) @@ -1383,7 +1383,7 @@ choose_bitmap_and(PlannerInfo *root, RelOptInfo *rel, List *paths) Assert(npaths > 0); /* else caller error */ if (npaths == 1) - return (Path *) linitial(paths); /* easy case */ + return (Path *) linitial(paths); /* easy case */ /* * In theory we should consider every nonempty subset of the given paths. @@ -1650,7 +1650,7 @@ bitmap_and_cost_est(PlannerInfo *root, RelOptInfo *rel, List *paths) apath.path.pathtype = T_BitmapAnd; apath.path.parent = rel; apath.path.pathtarget = rel->reltarget; - apath.path.param_info = NULL; /* not used in bitmap trees */ + apath.path.param_info = NULL; /* not used in bitmap trees */ apath.path.pathkeys = NIL; apath.bitmapquals = paths; cost_bitmap_and_node(&apath, root); @@ -1982,7 +1982,7 @@ get_loop_count(PlannerInfo *root, Index cur_relid, Relids outer_relids) outer_rel = root->simple_rel_array[outer_relid]; if (outer_rel == NULL) continue; - Assert(outer_rel->relid == outer_relid); /* sanity check on array */ + Assert(outer_rel->relid == outer_relid); /* sanity check on array */ /* Other relation could be proven empty, if so ignore */ if (IS_DUMMY_REL(outer_rel)) @@ -2632,7 +2632,7 @@ match_pathkeys_to_index(IndexOptInfo *index, List *pathkeys, return; } - *orderby_clauses_p = orderby_clauses; /* success! */ + *orderby_clauses_p = orderby_clauses; /* success! */ *clause_columns_p = clause_columns; } @@ -3062,7 +3062,7 @@ relation_has_unique_index_for(PlannerInfo *root, RelOptInfo *rel, if (match_index_to_operand(rexpr, c, ind)) { - matched = true; /* column is unique */ + matched = true; /* column is unique */ break; } } @@ -3983,7 +3983,7 @@ adjust_rowcompare_for_index(RowCompareExpr *clause, if (!var_on_left) { expr_op = get_commutator(expr_op); - if (!OidIsValid(expr_op)) /* should not happen */ + if (!OidIsValid(expr_op)) /* should not happen */ elog(ERROR, "could not find commutator of member %d(%u,%u) of opfamily %u", op_strategy, lefttype, righttype, opfam); } diff --git a/src/backend/optimizer/path/joinpath.c b/src/backend/optimizer/path/joinpath.c index c130d2f17f..23aa735296 100644 --- a/src/backend/optimizer/path/joinpath.c +++ b/src/backend/optimizer/path/joinpath.c @@ -1104,7 +1104,7 @@ generate_mergejoin_paths(PlannerInfo *root, } num_sortkeys = list_length(innersortkeys); if (num_sortkeys > 1 && !useallclauses) - trialsortkeys = list_copy(innersortkeys); /* need modifiable copy */ + trialsortkeys = list_copy(innersortkeys); /* need modifiable copy */ else trialsortkeys = innersortkeys; /* won't really truncate */ @@ -1732,7 +1732,7 @@ hash_inner_and_outer(PlannerInfo *root, if (outerpath == cheapest_startup_outer && innerpath == cheapest_total_inner) - continue; /* already tried it */ + continue; /* already tried it */ try_hashjoin_path(root, joinrel, diff --git a/src/backend/optimizer/path/pathkeys.c b/src/backend/optimizer/path/pathkeys.c index 2c269062ec..6933e73018 100644 --- a/src/backend/optimizer/path/pathkeys.c +++ b/src/backend/optimizer/path/pathkeys.c @@ -196,7 +196,7 @@ make_pathkey_from_sortinfo(PlannerInfo *root, opcintype, opcintype, BTEqualStrategyNumber); - if (!OidIsValid(equality_op)) /* shouldn't happen */ + if (!OidIsValid(equality_op)) /* shouldn't happen */ elog(ERROR, "could not find equality operator for opfamily %u", opfamily); opfamilies = get_mergejoin_opfamilies(equality_op); diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c index 19aa4575a9..b510faa3e1 100644 --- a/src/backend/optimizer/plan/createplan.c +++ b/src/backend/optimizer/plan/createplan.c @@ -63,9 +63,9 @@ * ressortgroupref labels. This is passed down by parent nodes such as Sort * and Group, which need these values to be available in their inputs. */ -#define CP_EXACT_TLIST 0x0001 /* Plan must return specified tlist */ -#define CP_SMALL_TLIST 0x0002 /* Prefer narrower tlists */ -#define CP_LABEL_TLIST 0x0004 /* tlist must contain sortgrouprefs */ +#define CP_EXACT_TLIST 0x0001 /* Plan must return specified tlist */ +#define CP_SMALL_TLIST 0x0002 /* Prefer narrower tlists */ +#define CP_LABEL_TLIST 0x0004 /* tlist must contain sortgrouprefs */ static Plan *create_plan_recurse(PlannerInfo *root, Path *best_path, @@ -1418,7 +1418,7 @@ create_unique_plan(PlannerInfo *root, UniquePath *best_path, int flags) * for the IN clause operators' RHS datatype. */ eqop = get_equality_op_for_ordering_op(sortop, NULL); - if (!OidIsValid(eqop)) /* shouldn't happen */ + if (!OidIsValid(eqop)) /* shouldn't happen */ elog(ERROR, "could not find equality operator for ordering operator %u", sortop); @@ -2908,7 +2908,7 @@ create_bitmap_subplan(PlannerInfo *root, Path *bitmapqual, plan->total_cost = opath->path.total_cost; plan->plan_rows = clamp_row_est(opath->bitmapselectivity * opath->path.parent->tuples); - plan->plan_width = 0; /* meaningless */ + plan->plan_width = 0; /* meaningless */ plan->parallel_aware = false; plan->parallel_safe = opath->path.parallel_safe; } @@ -3394,7 +3394,7 @@ create_worktablescan_plan(PlannerInfo *root, Path *best_path, if (!cteroot) /* shouldn't happen */ elog(ERROR, "bad levelsup for CTE \"%s\"", rte->ctename); } - if (cteroot->wt_param_id < 0) /* shouldn't happen */ + if (cteroot->wt_param_id < 0) /* shouldn't happen */ elog(ERROR, "could not find param ID for CTE \"%s\"", rte->ctename); /* Sort clauses into best execution order */ @@ -5726,7 +5726,7 @@ prepare_sort_from_pathkeys(Plan *lefttree, List *pathkeys, NULL, true); tlist = lappend(tlist, tle); - lefttree->targetlist = tlist; /* just in case NIL before */ + lefttree->targetlist = tlist; /* just in case NIL before */ } /* @@ -6426,7 +6426,7 @@ make_modifytable(PlannerInfo *root, node->partitioned_rels = partitioned_rels; node->resultRelations = resultRelations; node->resultRelIndex = -1; /* will be set correctly in setrefs.c */ - node->rootResultRelIndex = -1; /* will be set correctly in setrefs.c */ + node->rootResultRelIndex = -1; /* will be set correctly in setrefs.c */ node->plans = subplans; if (!onconflict) { diff --git a/src/backend/optimizer/plan/initsplan.c b/src/backend/optimizer/plan/initsplan.c index ebd442ad4d..63cb055ef0 100644 --- a/src/backend/optimizer/plan/initsplan.c +++ b/src/backend/optimizer/plan/initsplan.c @@ -287,7 +287,7 @@ find_lateral_references(PlannerInfo *root) if (brel == NULL) continue; - Assert(brel->relid == rti); /* sanity check on array */ + Assert(brel->relid == rti); /* sanity check on array */ /* * This bit is less obvious than it might look. We ignore appendrel @@ -436,7 +436,7 @@ create_lateral_join_info(PlannerInfo *root) if (brel == NULL) continue; - Assert(brel->relid == rti); /* sanity check on array */ + Assert(brel->relid == rti); /* sanity check on array */ /* ignore RTEs that are "other rels" */ if (brel->reloptkind != RELOPT_BASEREL) @@ -945,7 +945,7 @@ deconstruct_recurse(PlannerInfo *root, Node *jtnode, bool below_outer_join, /* JOIN_RIGHT was eliminated during reduce_outer_joins() */ elog(ERROR, "unrecognized join type: %d", (int) j->jointype); - nonnullable_rels = NULL; /* keep compiler quiet */ + nonnullable_rels = NULL; /* keep compiler quiet */ nullable_rels = NULL; leftjoinlist = rightjoinlist = NIL; break; @@ -1214,7 +1214,7 @@ make_outerjoininfo(PlannerInfo *root, { sjinfo->min_lefthand = bms_copy(left_rels); sjinfo->min_righthand = bms_copy(right_rels); - sjinfo->lhs_strict = false; /* don't care about this */ + sjinfo->lhs_strict = false; /* don't care about this */ return sjinfo; } @@ -2047,7 +2047,7 @@ distribute_qual_to_rels(PlannerInfo *root, Node *clause, static bool check_outerjoin_delay(PlannerInfo *root, Relids *relids_p, /* in/out parameter */ - Relids *nullable_relids_p, /* output parameter */ + Relids *nullable_relids_p, /* output parameter */ bool is_pushed_down) { Relids relids; @@ -2304,8 +2304,8 @@ process_implied_equality(PlannerInfo *root, * original (this is necessary in case there are subselects in there...) */ clause = make_opclause(opno, - BOOLOID, /* opresulttype */ - false, /* opretset */ + BOOLOID, /* opresulttype */ + false, /* opretset */ copyObject(item1), copyObject(item2), InvalidOid, @@ -2367,8 +2367,8 @@ build_implied_join_equality(Oid opno, * original (this is necessary in case there are subselects in there...) */ clause = make_opclause(opno, - BOOLOID, /* opresulttype */ - false, /* opretset */ + BOOLOID, /* opresulttype */ + false, /* opretset */ copyObject(item1), copyObject(item2), InvalidOid, @@ -2378,12 +2378,12 @@ build_implied_join_equality(Oid opno, * Build the RestrictInfo node itself. */ restrictinfo = make_restrictinfo(clause, - true, /* is_pushed_down */ - false, /* outerjoin_delayed */ - false, /* pseudoconstant */ + true, /* is_pushed_down */ + false, /* outerjoin_delayed */ + false, /* pseudoconstant */ security_level, /* security_level */ qualscope, /* required_relids */ - NULL, /* outer_relids */ + NULL, /* outer_relids */ nullable_relids); /* nullable_relids */ /* Set mergejoinability/hashjoinability flags */ diff --git a/src/backend/optimizer/plan/planagg.c b/src/backend/optimizer/plan/planagg.c index 55657360fc..6d5969cd44 100644 --- a/src/backend/optimizer/plan/planagg.c +++ b/src/backend/optimizer/plan/planagg.c @@ -89,8 +89,8 @@ preprocess_minmax_aggregates(PlannerInfo *root, List *tlist) if (!parse->hasAggs) return; - Assert(!parse->setOperations); /* shouldn't get here if a setop */ - Assert(parse->rowMarks == NIL); /* nor if FOR UPDATE */ + Assert(!parse->setOperations); /* shouldn't get here if a setop */ + Assert(parse->rowMarks == NIL); /* nor if FOR UPDATE */ /* * Reject unoptimizable cases. diff --git a/src/backend/optimizer/plan/planmain.c b/src/backend/optimizer/plan/planmain.c index 74de3b818f..f4e0a6ea3d 100644 --- a/src/backend/optimizer/plan/planmain.c +++ b/src/backend/optimizer/plan/planmain.c @@ -246,7 +246,7 @@ query_planner(PlannerInfo *root, List *tlist, if (brel == NULL) continue; - Assert(brel->relid == rti); /* sanity check on array */ + Assert(brel->relid == rti); /* sanity check on array */ if (IS_SIMPLE_REL(brel)) total_pages += (double) brel->pages; diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c index 40cb79d4cd..4b32f59128 100644 --- a/src/backend/optimizer/plan/planner.c +++ b/src/backend/optimizer/plan/planner.c @@ -2412,7 +2412,7 @@ preprocess_rowmarks(PlannerInfo *root) newrc->markType = select_rowmark_type(rte, LCS_NONE); newrc->allMarkTypes = (1 << newrc->markType); newrc->strength = LCS_NONE; - newrc->waitPolicy = LockWaitBlock; /* doesn't matter */ + newrc->waitPolicy = LockWaitBlock; /* doesn't matter */ newrc->isParent = false; prowmarks = lappend(prowmarks, newrc); @@ -2469,7 +2469,7 @@ select_rowmark_type(RangeTblEntry *rte, LockClauseStrength strength) break; } elog(ERROR, "unrecognized LockClauseStrength %d", (int) strength); - return ROW_MARK_EXCLUSIVE; /* keep compiler quiet */ + return ROW_MARK_EXCLUSIVE; /* keep compiler quiet */ } } @@ -2519,7 +2519,7 @@ preprocess_limit(PlannerInfo *root, double tuple_fraction, { *count_est = DatumGetInt64(((Const *) est)->constvalue); if (*count_est <= 0) - *count_est = 1; /* force to at least 1 */ + *count_est = 1; /* force to at least 1 */ } } else @@ -2653,7 +2653,7 @@ preprocess_limit(PlannerInfo *root, double tuple_fraction, /* both fractional, so add them together */ tuple_fraction += limit_fraction; if (tuple_fraction >= 1.0) - tuple_fraction = 0.0; /* assume fetch all */ + tuple_fraction = 0.0; /* assume fetch all */ } } } @@ -3514,7 +3514,7 @@ create_grouping_paths(PlannerInfo *root, RelOptInfo *grouped_rel; PathTarget *partial_grouping_target = NULL; AggClauseCosts agg_partial_costs; /* parallel only */ - AggClauseCosts agg_final_costs; /* parallel only */ + AggClauseCosts agg_final_costs; /* parallel only */ Size hashaggtablesize; double dNumGroups; double dNumPartialGroups = 0; @@ -5626,7 +5626,7 @@ make_sort_input_target(PlannerInfo *root, /* Shouldn't get here unless query has ORDER BY */ Assert(parse->sortClause); - *have_postponed_srfs = false; /* default result */ + *have_postponed_srfs = false; /* default result */ /* Inspect tlist and collect per-column information */ ncols = list_length(final_target->exprs); diff --git a/src/backend/optimizer/plan/setrefs.c b/src/backend/optimizer/plan/setrefs.c index 5cac171cb6..01b06848af 100644 --- a/src/backend/optimizer/plan/setrefs.c +++ b/src/backend/optimizer/plan/setrefs.c @@ -297,7 +297,7 @@ add_rtes_to_flat_rtable(PlannerInfo *root, bool recursing) if (rel != NULL) { - Assert(rel->relid == rti); /* sanity check on array */ + Assert(rel->relid == rti); /* sanity check on array */ /* * The subquery might never have been planned at all, if it @@ -1908,7 +1908,7 @@ set_dummy_tlist_references(Plan *plan, int rtoffset) } else { - newvar->varnoold = 0; /* wasn't ever a plain Var */ + newvar->varnoold = 0; /* wasn't ever a plain Var */ newvar->varoattno = 0; } @@ -2137,7 +2137,7 @@ search_indexed_tlist_for_sortgroupref(Expr *node, Var *newvar; newvar = makeVarFromTargetEntry(newvarno, tle); - newvar->varnoold = 0; /* wasn't ever a plain Var */ + newvar->varnoold = 0; /* wasn't ever a plain Var */ newvar->varoattno = 0; return newvar; } diff --git a/src/backend/optimizer/prep/prepjointree.c b/src/backend/optimizer/prep/prepjointree.c index cfdd770f6a..08033183e7 100644 --- a/src/backend/optimizer/prep/prepjointree.c +++ b/src/backend/optimizer/prep/prepjointree.c @@ -44,7 +44,7 @@ typedef struct pullup_replace_vars_context RangeTblEntry *target_rte; /* RTE of subquery */ Relids relids; /* relids within subquery, as numbered after * pullup (set only if target_rte->lateral) */ - bool *outer_hasSubLinks; /* -> outer query's hasSubLinks */ + bool *outer_hasSubLinks; /* -> outer query's hasSubLinks */ int varno; /* varno of subquery */ bool need_phvs; /* do we need PlaceHolderVars? */ bool wrap_non_vars; /* do we need 'em on *all* non-Vars? */ @@ -772,7 +772,7 @@ pull_up_subqueries_recurse(PlannerInfo *root, Node *jtnode, if (deletion_ok && !have_undeleted_child) { /* OK to delete this FromExpr entirely */ - root->hasDeletedRTEs = true; /* probably is set already */ + root->hasDeletedRTEs = true; /* probably is set already */ return NULL; } } @@ -2088,7 +2088,7 @@ pullup_replace_vars_callback(Var *var, &colnames, &fields); /* Adjust the generated per-field Vars, but don't insert PHVs */ rcon->need_phvs = false; - context->sublevels_up = 0; /* to match the expandRTE output */ + context->sublevels_up = 0; /* to match the expandRTE output */ fields = (List *) replace_rte_variables_mutator((Node *) fields, context); rcon->need_phvs = save_need_phvs; @@ -2784,7 +2784,7 @@ reduce_outer_joins_pass2(Node *jtnode, if (right_state->contains_outer) { - if (jointype != JOIN_FULL) /* ie, INNER/LEFT/SEMI/ANTI */ + if (jointype != JOIN_FULL) /* ie, INNER/LEFT/SEMI/ANTI */ { /* pass appropriate constraints, per comment above */ pass_nonnullable_rels = local_nonnullable_rels; diff --git a/src/backend/optimizer/prep/preptlist.c b/src/backend/optimizer/prep/preptlist.c index de47153bac..afc733f183 100644 --- a/src/backend/optimizer/prep/preptlist.c +++ b/src/backend/optimizer/prep/preptlist.c @@ -301,7 +301,7 @@ expand_targetlist(List *tlist, int command_type, attcollation, att_tup->attlen, (Datum) 0, - true, /* isnull */ + true, /* isnull */ att_tup->attbyval); new_expr = coerce_to_domain(new_expr, InvalidOid, -1, @@ -319,7 +319,7 @@ expand_targetlist(List *tlist, int command_type, InvalidOid, sizeof(int32), (Datum) 0, - true, /* isnull */ + true, /* isnull */ true /* byval */ ); } break; @@ -341,7 +341,7 @@ expand_targetlist(List *tlist, int command_type, InvalidOid, sizeof(int32), (Datum) 0, - true, /* isnull */ + true, /* isnull */ true /* byval */ ); } break; diff --git a/src/backend/optimizer/util/clauses.c b/src/backend/optimizer/util/clauses.c index a1dafc8e0f..b9e5dc25eb 100644 --- a/src/backend/optimizer/util/clauses.c +++ b/src/backend/optimizer/util/clauses.c @@ -1399,7 +1399,7 @@ contain_context_dependent_node(Node *clause) return contain_context_dependent_node_walker(clause, &flags); } -#define CCDN_IN_CASEEXPR 0x0001 /* CaseTestExpr okay here? */ +#define CCDN_IN_CASEEXPR 0x0001 /* CaseTestExpr okay here? */ static bool contain_context_dependent_node_walker(Node *node, int *flags) @@ -2434,7 +2434,7 @@ estimate_expression_value(PlannerInfo *root, Node *node) { eval_const_expressions_context context; - context.boundParams = root->glob->boundParams; /* bound Params */ + context.boundParams = root->glob->boundParams; /* bound Params */ /* we do not need to mark the plan as depending on inlined functions */ context.root = NULL; context.active_fns = NIL; /* nothing being recursively simplified */ @@ -2712,8 +2712,8 @@ eval_const_expressions_mutator(Node *node, * Need to get OID of underlying function. Okay to * scribble on input to this extent. */ - set_opfuncid((OpExpr *) expr); /* rely on struct - * equivalence */ + set_opfuncid((OpExpr *) expr); /* rely on struct + * equivalence */ /* * Code for op/func reduction is pretty bulky, so split it @@ -3114,7 +3114,7 @@ eval_const_expressions_mutator(Node *node, if (newarg && IsA(newarg, Const)) { context->case_val = newarg; - newarg = NULL; /* not needed anymore, see above */ + newarg = NULL; /* not needed anymore, see above */ } else context->case_val = NULL; @@ -3463,7 +3463,7 @@ eval_const_expressions_mutator(Node *node, default: elog(ERROR, "unrecognized nulltesttype: %d", (int) ntest->nulltesttype); - result = false; /* keep compiler quiet */ + result = false; /* keep compiler quiet */ break; } @@ -3517,7 +3517,7 @@ eval_const_expressions_mutator(Node *node, default: elog(ERROR, "unrecognized booltesttype: %d", (int) btest->booltesttype); - result = false; /* keep compiler quiet */ + result = false; /* keep compiler quiet */ break; } @@ -4263,7 +4263,7 @@ evaluate_function(Oid funcid, Oid result_type, int32 result_typmod, newexpr->funcretset = false; newexpr->funcvariadic = funcvariadic; newexpr->funcformat = COERCE_EXPLICIT_CALL; /* doesn't matter */ - newexpr->funccollid = result_collid; /* doesn't matter */ + newexpr->funccollid = result_collid; /* doesn't matter */ newexpr->inputcollid = input_collid; newexpr->args = args; newexpr->location = -1; diff --git a/src/backend/optimizer/util/orclauses.c b/src/backend/optimizer/util/orclauses.c index b6867e3001..dd7cfc94b8 100644 --- a/src/backend/optimizer/util/orclauses.c +++ b/src/backend/optimizer/util/orclauses.c @@ -84,7 +84,7 @@ extract_restriction_or_clauses(PlannerInfo *root) if (rel == NULL) continue; - Assert(rel->relid == rti); /* sanity check on array */ + Assert(rel->relid == rti); /* sanity check on array */ /* ignore RTEs that are "other rels" */ if (rel->reloptkind != RELOPT_BASEREL) diff --git a/src/backend/optimizer/util/pathnode.c b/src/backend/optimizer/util/pathnode.c index ec4a093d9f..63afc04b62 100644 --- a/src/backend/optimizer/util/pathnode.c +++ b/src/backend/optimizer/util/pathnode.c @@ -411,7 +411,7 @@ set_cheapest(RelOptInfo *parent_rel) void add_path(RelOptInfo *parent_rel, Path *new_path) { - bool accept_new = true; /* unless we find a superior old path */ + bool accept_new = true; /* unless we find a superior old path */ ListCell *insert_after = NULL; /* where to insert new item */ List *new_path_pathkeys; ListCell *p1; @@ -484,7 +484,7 @@ add_path(RelOptInfo *parent_rel, Path *new_path) outercmp == BMS_SUBSET1) && new_path->rows <= old_path->rows && new_path->parallel_safe >= old_path->parallel_safe) - remove_old = true; /* new dominates old */ + remove_old = true; /* new dominates old */ } else if (keyscmp == PATHKEYS_BETTER2) { @@ -492,7 +492,7 @@ add_path(RelOptInfo *parent_rel, Path *new_path) outercmp == BMS_SUBSET2) && new_path->rows >= old_path->rows && new_path->parallel_safe <= old_path->parallel_safe) - accept_new = false; /* old dominates new */ + accept_new = false; /* old dominates new */ } else /* keyscmp == PATHKEYS_EQUAL */ { @@ -534,11 +534,11 @@ add_path(RelOptInfo *parent_rel, Path *new_path) else if (outercmp == BMS_SUBSET1 && new_path->rows <= old_path->rows && new_path->parallel_safe >= old_path->parallel_safe) - remove_old = true; /* new dominates old */ + remove_old = true; /* new dominates old */ else if (outercmp == BMS_SUBSET2 && new_path->rows >= old_path->rows && new_path->parallel_safe <= old_path->parallel_safe) - accept_new = false; /* old dominates new */ + accept_new = false; /* old dominates new */ /* else different parameterizations, keep both */ } break; @@ -551,7 +551,7 @@ add_path(RelOptInfo *parent_rel, Path *new_path) outercmp == BMS_SUBSET1) && new_path->rows <= old_path->rows && new_path->parallel_safe >= old_path->parallel_safe) - remove_old = true; /* new dominates old */ + remove_old = true; /* new dominates old */ } break; case COSTS_BETTER2: @@ -563,7 +563,7 @@ add_path(RelOptInfo *parent_rel, Path *new_path) outercmp == BMS_SUBSET2) && new_path->rows >= old_path->rows && new_path->parallel_safe <= old_path->parallel_safe) - accept_new = false; /* old dominates new */ + accept_new = false; /* old dominates new */ } break; case COSTS_DIFFERENT: @@ -751,7 +751,7 @@ add_path_precheck(RelOptInfo *parent_rel, void add_partial_path(RelOptInfo *parent_rel, Path *new_path) { - bool accept_new = true; /* unless we find a superior old path */ + bool accept_new = true; /* unless we find a superior old path */ ListCell *insert_after = NULL; /* where to insert new item */ ListCell *p1; ListCell *p1_prev; @@ -1081,7 +1081,7 @@ create_bitmap_heap_path(PlannerInfo *root, pathnode->path.parallel_aware = parallel_degree > 0 ? true : false; pathnode->path.parallel_safe = rel->consider_parallel; pathnode->path.parallel_workers = parallel_degree; - pathnode->path.pathkeys = NIL; /* always unordered */ + pathnode->path.pathkeys = NIL; /* always unordered */ pathnode->bitmapqual = bitmapqual; @@ -1118,7 +1118,7 @@ create_bitmap_and_path(PlannerInfo *root, pathnode->path.parallel_safe = rel->consider_parallel; pathnode->path.parallel_workers = 0; - pathnode->path.pathkeys = NIL; /* always unordered */ + pathnode->path.pathkeys = NIL; /* always unordered */ pathnode->bitmapquals = bitmapquals; @@ -1154,7 +1154,7 @@ create_bitmap_or_path(PlannerInfo *root, pathnode->path.parallel_safe = rel->consider_parallel; pathnode->path.parallel_workers = 0; - pathnode->path.pathkeys = NIL; /* always unordered */ + pathnode->path.pathkeys = NIL; /* always unordered */ pathnode->bitmapquals = bitmapquals; @@ -1182,7 +1182,7 @@ create_tidscan_path(PlannerInfo *root, RelOptInfo *rel, List *tidquals, pathnode->path.parallel_aware = false; pathnode->path.parallel_safe = rel->consider_parallel; pathnode->path.parallel_workers = 0; - pathnode->path.pathkeys = NIL; /* always unordered */ + pathnode->path.pathkeys = NIL; /* always unordered */ pathnode->tidquals = tidquals; @@ -1214,8 +1214,7 @@ create_append_path(RelOptInfo *rel, List *subpaths, Relids required_outer, pathnode->path.parallel_aware = false; pathnode->path.parallel_safe = rel->consider_parallel; pathnode->path.parallel_workers = parallel_workers; - pathnode->path.pathkeys = NIL; /* result is always considered - * unsorted */ + pathnode->path.pathkeys = NIL; /* result is always considered unsorted */ pathnode->partitioned_rels = list_copy(partitioned_rels); pathnode->subpaths = subpaths; @@ -1311,7 +1310,7 @@ create_merge_append_path(PlannerInfo *root, else { /* We'll need to insert a Sort node, so include cost for that */ - Path sort_path; /* dummy for result of cost_sort */ + Path sort_path; /* dummy for result of cost_sort */ cost_sort(&sort_path, root, @@ -1743,7 +1742,7 @@ create_gather_path(PlannerInfo *root, RelOptInfo *rel, Path *subpath, pathnode->path.parallel_aware = false; pathnode->path.parallel_safe = false; pathnode->path.parallel_workers = 0; - pathnode->path.pathkeys = NIL; /* Gather has unordered result */ + pathnode->path.pathkeys = NIL; /* Gather has unordered result */ pathnode->subpath = subpath; pathnode->num_workers = subpath->parallel_workers; @@ -2818,8 +2817,8 @@ create_groupingsets_path(PlannerInfo *root, } else { - Path sort_path; /* dummy for result of cost_sort */ - Path agg_path; /* dummy for result of cost_agg */ + Path sort_path; /* dummy for result of cost_sort */ + Path agg_path; /* dummy for result of cost_agg */ if (rollup->is_hashed || is_first_sort) { diff --git a/src/backend/optimizer/util/placeholder.c b/src/backend/optimizer/util/placeholder.c index 698a387ac2..970542dde5 100644 --- a/src/backend/optimizer/util/placeholder.c +++ b/ |