mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +03:00
Harmonize parameter names in storage and AM code.
Make sure that function declarations use names that exactly match the corresponding names from function definitions in storage, catalog, access method, executor, and logical replication code, as well as in miscellaneous utility/library code. Like other recent commits that cleaned up function parameter names, this commit was written with help from clang-tidy. Later commits will do the same for other parts of the codebase. Author: Peter Geoghegan <pg@bowt.ie> Reviewed-By: David Rowley <dgrowleyml@gmail.com> Discussion: https://postgr.es/m/CAH2-WznJt9CMM9KJTMjJh_zbL5hD9oX44qdJ4aqZtjFi-zA3Tg@mail.gmail.com
This commit is contained in:
@@ -223,7 +223,8 @@ typedef struct SerializedRanges
|
||||
|
||||
static SerializedRanges *brin_range_serialize(Ranges *range);
|
||||
|
||||
static Ranges *brin_range_deserialize(int maxvalues, SerializedRanges *range);
|
||||
static Ranges *brin_range_deserialize(int maxvalues,
|
||||
SerializedRanges *serialized);
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -733,11 +733,11 @@ add_reloption(relopt_gen *newoption)
|
||||
* 'relopt_struct_size'.
|
||||
*/
|
||||
void
|
||||
init_local_reloptions(local_relopts *opts, Size relopt_struct_size)
|
||||
init_local_reloptions(local_relopts *relopts, Size relopt_struct_size)
|
||||
{
|
||||
opts->options = NIL;
|
||||
opts->validators = NIL;
|
||||
opts->relopt_struct_size = relopt_struct_size;
|
||||
relopts->options = NIL;
|
||||
relopts->validators = NIL;
|
||||
relopts->relopt_struct_size = relopt_struct_size;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -746,9 +746,9 @@ init_local_reloptions(local_relopts *opts, Size relopt_struct_size)
|
||||
* build_local_reloptions().
|
||||
*/
|
||||
void
|
||||
register_reloptions_validator(local_relopts *opts, relopts_validator validator)
|
||||
register_reloptions_validator(local_relopts *relopts, relopts_validator validator)
|
||||
{
|
||||
opts->validators = lappend(opts->validators, validator);
|
||||
relopts->validators = lappend(relopts->validators, validator);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -281,11 +281,11 @@ ginCompressPostingList(const ItemPointer ipd, int nipd, int maxsize,
|
||||
* The number of items is returned in *ndecoded.
|
||||
*/
|
||||
ItemPointer
|
||||
ginPostingListDecode(GinPostingList *plist, int *ndecoded)
|
||||
ginPostingListDecode(GinPostingList *plist, int *ndecoded_out)
|
||||
{
|
||||
return ginPostingListDecodeAllSegments(plist,
|
||||
SizeOfGinPostingList(plist),
|
||||
ndecoded);
|
||||
ndecoded_out);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -162,7 +162,7 @@ static BlockNumber gistbufferinginserttuples(GISTBuildState *buildstate,
|
||||
BlockNumber parentblk, OffsetNumber downlinkoffnum);
|
||||
static Buffer gistBufferingFindCorrectParent(GISTBuildState *buildstate,
|
||||
BlockNumber childblkno, int level,
|
||||
BlockNumber *parentblk,
|
||||
BlockNumber *parentblkno,
|
||||
OffsetNumber *downlinkoffnum);
|
||||
static void gistProcessEmptyingQueue(GISTBuildState *buildstate);
|
||||
static void gistEmptyAllBuffers(GISTBuildState *buildstate);
|
||||
@@ -171,7 +171,8 @@ static int gistGetMaxLevel(Relation index);
|
||||
static void gistInitParentMap(GISTBuildState *buildstate);
|
||||
static void gistMemorizeParent(GISTBuildState *buildstate, BlockNumber child,
|
||||
BlockNumber parent);
|
||||
static void gistMemorizeAllDownlinks(GISTBuildState *buildstate, Buffer parent);
|
||||
static void gistMemorizeAllDownlinks(GISTBuildState *buildstate,
|
||||
Buffer parentbuf);
|
||||
static BlockNumber gistGetParent(GISTBuildState *buildstate, BlockNumber child);
|
||||
|
||||
|
||||
|
||||
@@ -31,9 +31,9 @@ static void gistLoadNodeBuffer(GISTBuildBuffers *gfbb,
|
||||
static void gistUnloadNodeBuffer(GISTBuildBuffers *gfbb,
|
||||
GISTNodeBuffer *nodeBuffer);
|
||||
static void gistPlaceItupToPage(GISTNodeBufferPage *pageBuffer,
|
||||
IndexTuple item);
|
||||
IndexTuple itup);
|
||||
static void gistGetItupFromPage(GISTNodeBufferPage *pageBuffer,
|
||||
IndexTuple *item);
|
||||
IndexTuple *itup);
|
||||
static long gistBuffersGetFreeBlock(GISTBuildBuffers *gfbb);
|
||||
static void gistBuffersReleaseBlock(GISTBuildBuffers *gfbb, long blocknum);
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ static void gistvacuumpage(GistVacState *vstate, BlockNumber blkno,
|
||||
static void gistvacuum_delete_empty_pages(IndexVacuumInfo *info,
|
||||
GistVacState *vstate);
|
||||
static bool gistdeletepage(IndexVacuumInfo *info, IndexBulkDeleteResult *stats,
|
||||
Buffer buffer, OffsetNumber downlink,
|
||||
Buffer parentBuffer, OffsetNumber downlink,
|
||||
Buffer leafBuffer);
|
||||
|
||||
/*
|
||||
|
||||
@@ -69,7 +69,7 @@ struct GenericXLogState
|
||||
};
|
||||
|
||||
static void writeFragment(PageData *pageData, OffsetNumber offset,
|
||||
OffsetNumber len, const char *data);
|
||||
OffsetNumber length, const char *data);
|
||||
static void computeRegionDelta(PageData *pageData,
|
||||
const char *curpage, const char *targetpage,
|
||||
int targetStart, int targetEnd,
|
||||
|
||||
@@ -354,7 +354,7 @@ static void AtSubStart_Memory(void);
|
||||
static void AtSubStart_ResourceOwner(void);
|
||||
|
||||
static void ShowTransactionState(const char *str);
|
||||
static void ShowTransactionStateRec(const char *str, TransactionState state);
|
||||
static void ShowTransactionStateRec(const char *str, TransactionState s);
|
||||
static const char *BlockStateAsString(TBlockState blockState);
|
||||
static const char *TransStateAsString(TransState state);
|
||||
|
||||
|
||||
@@ -648,7 +648,7 @@ static void XLogReportParameters(void);
|
||||
static int LocalSetXLogInsertAllowed(void);
|
||||
static void CreateEndOfRecoveryRecord(void);
|
||||
static XLogRecPtr CreateOverwriteContrecordRecord(XLogRecPtr aborted_lsn,
|
||||
XLogRecPtr missingContrecPtr,
|
||||
XLogRecPtr pagePtr,
|
||||
TimeLineID newTLI);
|
||||
static void CheckPointGuts(XLogRecPtr checkPointRedo, int flags);
|
||||
static void KeepLogSeg(XLogRecPtr recptr, XLogSegNo *logSegNo);
|
||||
|
||||
@@ -1094,7 +1094,7 @@ XLogSaveBufferForHint(Buffer buffer, bool buffer_std)
|
||||
* the unused space to be left out from the WAL record, making it smaller.
|
||||
*/
|
||||
XLogRecPtr
|
||||
log_newpage(RelFileLocator *rlocator, ForkNumber forkNum, BlockNumber blkno,
|
||||
log_newpage(RelFileLocator *rlocator, ForkNumber forknum, BlockNumber blkno,
|
||||
Page page, bool page_std)
|
||||
{
|
||||
int flags;
|
||||
@@ -1105,7 +1105,7 @@ log_newpage(RelFileLocator *rlocator, ForkNumber forkNum, BlockNumber blkno,
|
||||
flags |= REGBUF_STANDARD;
|
||||
|
||||
XLogBeginInsert();
|
||||
XLogRegisterBlock(0, rlocator, forkNum, blkno, page, flags);
|
||||
XLogRegisterBlock(0, rlocator, forknum, blkno, page, flags);
|
||||
recptr = XLogInsert(RM_XLOG_ID, XLOG_FPI);
|
||||
|
||||
/*
|
||||
@@ -1126,7 +1126,7 @@ log_newpage(RelFileLocator *rlocator, ForkNumber forkNum, BlockNumber blkno,
|
||||
* because we can write multiple pages in a single WAL record.
|
||||
*/
|
||||
void
|
||||
log_newpages(RelFileLocator *rlocator, ForkNumber forkNum, int num_pages,
|
||||
log_newpages(RelFileLocator *rlocator, ForkNumber forknum, int num_pages,
|
||||
BlockNumber *blknos, Page *pages, bool page_std)
|
||||
{
|
||||
int flags;
|
||||
@@ -1156,7 +1156,7 @@ log_newpages(RelFileLocator *rlocator, ForkNumber forkNum, int num_pages,
|
||||
nbatch = 0;
|
||||
while (nbatch < XLR_MAX_BLOCK_ID && i < num_pages)
|
||||
{
|
||||
XLogRegisterBlock(nbatch, rlocator, forkNum, blknos[i], pages[i], flags);
|
||||
XLogRegisterBlock(nbatch, rlocator, forknum, blknos[i], pages[i], flags);
|
||||
i++;
|
||||
nbatch++;
|
||||
}
|
||||
@@ -1192,15 +1192,15 @@ log_newpage_buffer(Buffer buffer, bool page_std)
|
||||
{
|
||||
Page page = BufferGetPage(buffer);
|
||||
RelFileLocator rlocator;
|
||||
ForkNumber forkNum;
|
||||
ForkNumber forknum;
|
||||
BlockNumber blkno;
|
||||
|
||||
/* Shared buffers should be modified in a critical section. */
|
||||
Assert(CritSectionCount > 0);
|
||||
|
||||
BufferGetTag(buffer, &rlocator, &forkNum, &blkno);
|
||||
BufferGetTag(buffer, &rlocator, &forknum, &blkno);
|
||||
|
||||
return log_newpage(&rlocator, forkNum, blkno, page, page_std);
|
||||
return log_newpage(&rlocator, forknum, blkno, page, page_std);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1221,7 +1221,7 @@ log_newpage_buffer(Buffer buffer, bool page_std)
|
||||
* cause a deadlock through some other means.
|
||||
*/
|
||||
void
|
||||
log_newpage_range(Relation rel, ForkNumber forkNum,
|
||||
log_newpage_range(Relation rel, ForkNumber forknum,
|
||||
BlockNumber startblk, BlockNumber endblk,
|
||||
bool page_std)
|
||||
{
|
||||
@@ -1253,7 +1253,7 @@ log_newpage_range(Relation rel, ForkNumber forkNum,
|
||||
nbufs = 0;
|
||||
while (nbufs < XLR_MAX_BLOCK_ID && blkno < endblk)
|
||||
{
|
||||
Buffer buf = ReadBufferExtended(rel, forkNum, blkno,
|
||||
Buffer buf = ReadBufferExtended(rel, forknum, blkno,
|
||||
RBM_NORMAL, NULL);
|
||||
|
||||
LockBuffer(buf, BUFFER_LOCK_EXCLUSIVE);
|
||||
|
||||
@@ -47,7 +47,7 @@ static bool allocate_recordbuf(XLogReaderState *state, uint32 reclength);
|
||||
static int ReadPageInternal(XLogReaderState *state, XLogRecPtr pageptr,
|
||||
int reqLen);
|
||||
static void XLogReaderInvalReadState(XLogReaderState *state);
|
||||
static XLogPageReadResult XLogDecodeNextRecord(XLogReaderState *state, bool non_blocking);
|
||||
static XLogPageReadResult XLogDecodeNextRecord(XLogReaderState *state, bool nonblocking);
|
||||
static bool ValidXLogRecordHeader(XLogReaderState *state, XLogRecPtr RecPtr,
|
||||
XLogRecPtr PrevRecPtr, XLogRecord *record, bool randAccess);
|
||||
static bool ValidXLogRecord(XLogReaderState *state, XLogRecord *record,
|
||||
|
||||
@@ -104,17 +104,17 @@ typedef struct
|
||||
bool binary_upgrade_record_init_privs = false;
|
||||
|
||||
static void ExecGrantStmt_oids(InternalGrant *istmt);
|
||||
static void ExecGrant_Relation(InternalGrant *grantStmt);
|
||||
static void ExecGrant_Database(InternalGrant *grantStmt);
|
||||
static void ExecGrant_Fdw(InternalGrant *grantStmt);
|
||||
static void ExecGrant_ForeignServer(InternalGrant *grantStmt);
|
||||
static void ExecGrant_Function(InternalGrant *grantStmt);
|
||||
static void ExecGrant_Language(InternalGrant *grantStmt);
|
||||
static void ExecGrant_Largeobject(InternalGrant *grantStmt);
|
||||
static void ExecGrant_Namespace(InternalGrant *grantStmt);
|
||||
static void ExecGrant_Tablespace(InternalGrant *grantStmt);
|
||||
static void ExecGrant_Type(InternalGrant *grantStmt);
|
||||
static void ExecGrant_Parameter(InternalGrant *grantStmt);
|
||||
static void ExecGrant_Relation(InternalGrant *istmt);
|
||||
static void ExecGrant_Database(InternalGrant *istmt);
|
||||
static void ExecGrant_Fdw(InternalGrant *istmt);
|
||||
static void ExecGrant_ForeignServer(InternalGrant *istmt);
|
||||
static void ExecGrant_Function(InternalGrant *istmt);
|
||||
static void ExecGrant_Language(InternalGrant *istmt);
|
||||
static void ExecGrant_Largeobject(InternalGrant *istmt);
|
||||
static void ExecGrant_Namespace(InternalGrant *istmt);
|
||||
static void ExecGrant_Tablespace(InternalGrant *istmt);
|
||||
static void ExecGrant_Type(InternalGrant *istmt);
|
||||
static void ExecGrant_Parameter(InternalGrant *istmt);
|
||||
|
||||
static void SetDefaultACLsInSchemas(InternalDefaultACL *iacls, List *nspnames);
|
||||
static void SetDefaultACL(InternalDefaultACL *iacls);
|
||||
|
||||
@@ -3644,7 +3644,7 @@ PopOverrideSearchPath(void)
|
||||
* database's encoding.
|
||||
*/
|
||||
Oid
|
||||
get_collation_oid(List *name, bool missing_ok)
|
||||
get_collation_oid(List *collname, bool missing_ok)
|
||||
{
|
||||
char *schemaname;
|
||||
char *collation_name;
|
||||
@@ -3654,7 +3654,7 @@ get_collation_oid(List *name, bool missing_ok)
|
||||
ListCell *l;
|
||||
|
||||
/* deconstruct the name list */
|
||||
DeconstructQualifiedName(name, &schemaname, &collation_name);
|
||||
DeconstructQualifiedName(collname, &schemaname, &collation_name);
|
||||
|
||||
if (schemaname)
|
||||
{
|
||||
@@ -3690,7 +3690,7 @@ get_collation_oid(List *name, bool missing_ok)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_UNDEFINED_OBJECT),
|
||||
errmsg("collation \"%s\" for encoding \"%s\" does not exist",
|
||||
NameListToString(name), GetDatabaseEncodingName())));
|
||||
NameListToString(collname), GetDatabaseEncodingName())));
|
||||
return InvalidOid;
|
||||
}
|
||||
|
||||
@@ -3698,7 +3698,7 @@ get_collation_oid(List *name, bool missing_ok)
|
||||
* get_conversion_oid - find a conversion by possibly qualified name
|
||||
*/
|
||||
Oid
|
||||
get_conversion_oid(List *name, bool missing_ok)
|
||||
get_conversion_oid(List *conname, bool missing_ok)
|
||||
{
|
||||
char *schemaname;
|
||||
char *conversion_name;
|
||||
@@ -3707,7 +3707,7 @@ get_conversion_oid(List *name, bool missing_ok)
|
||||
ListCell *l;
|
||||
|
||||
/* deconstruct the name list */
|
||||
DeconstructQualifiedName(name, &schemaname, &conversion_name);
|
||||
DeconstructQualifiedName(conname, &schemaname, &conversion_name);
|
||||
|
||||
if (schemaname)
|
||||
{
|
||||
@@ -3745,7 +3745,7 @@ get_conversion_oid(List *name, bool missing_ok)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_UNDEFINED_OBJECT),
|
||||
errmsg("conversion \"%s\" does not exist",
|
||||
NameListToString(name))));
|
||||
NameListToString(conname))));
|
||||
return conoid;
|
||||
}
|
||||
|
||||
|
||||
@@ -125,9 +125,9 @@ static bool have_createdb_privilege(void);
|
||||
static void remove_dbtablespaces(Oid db_id);
|
||||
static bool check_db_file_conflict(Oid db_id);
|
||||
static int errdetail_busy_db(int notherbackends, int npreparedxacts);
|
||||
static void CreateDatabaseUsingWalLog(Oid src_dboid, Oid dboid, Oid src_tsid,
|
||||
static void CreateDatabaseUsingWalLog(Oid src_dboid, Oid dst_dboid, Oid src_tsid,
|
||||
Oid dst_tsid);
|
||||
static List *ScanSourceDatabasePgClass(Oid srctbid, Oid srcdbid, char *srcpath);
|
||||
static List *ScanSourceDatabasePgClass(Oid tbid, Oid dbid, char *srcpath);
|
||||
static List *ScanSourceDatabasePgClassPage(Page page, Buffer buf, Oid tbid,
|
||||
Oid dbid, char *srcpath,
|
||||
List *rlocatorlist, Snapshot snapshot);
|
||||
@@ -136,8 +136,8 @@ static CreateDBRelInfo *ScanSourceDatabasePgClassTuple(HeapTupleData *tuple,
|
||||
char *srcpath);
|
||||
static void CreateDirAndVersionFile(char *dbpath, Oid dbid, Oid tsid,
|
||||
bool isRedo);
|
||||
static void CreateDatabaseUsingFileCopy(Oid src_dboid, Oid dboid, Oid src_tsid,
|
||||
Oid dst_tsid);
|
||||
static void CreateDatabaseUsingFileCopy(Oid src_dboid, Oid dst_dboid,
|
||||
Oid src_tsid, Oid dst_tsid);
|
||||
static void recovery_create_dbdir(char *path, bool only_tblspc);
|
||||
|
||||
/*
|
||||
|
||||
@@ -130,7 +130,7 @@ static bool check_exclusion_or_unique_constraint(Relation heap, Relation index,
|
||||
Datum *values, bool *isnull,
|
||||
EState *estate, bool newIndex,
|
||||
CEOUC_WAIT_MODE waitMode,
|
||||
bool errorOK,
|
||||
bool violationOK,
|
||||
ItemPointer conflictTid);
|
||||
|
||||
static bool index_recheck_constraint(Relation index, Oid *constr_procs,
|
||||
|
||||
@@ -126,9 +126,9 @@ typedef struct ExecParallelInitializeDSMContext
|
||||
|
||||
/* Helper functions that run in the parallel leader. */
|
||||
static char *ExecSerializePlan(Plan *plan, EState *estate);
|
||||
static bool ExecParallelEstimate(PlanState *node,
|
||||
static bool ExecParallelEstimate(PlanState *planstate,
|
||||
ExecParallelEstimateContext *e);
|
||||
static bool ExecParallelInitializeDSM(PlanState *node,
|
||||
static bool ExecParallelInitializeDSM(PlanState *planstate,
|
||||
ExecParallelInitializeDSMContext *d);
|
||||
static shm_mq_handle **ExecParallelSetupTupleQueues(ParallelContext *pcxt,
|
||||
bool reinitialize);
|
||||
|
||||
@@ -396,7 +396,7 @@ static void prepare_projection_slot(AggState *aggstate,
|
||||
TupleTableSlot *slot,
|
||||
int currentSet);
|
||||
static void finalize_aggregates(AggState *aggstate,
|
||||
AggStatePerAgg peragg,
|
||||
AggStatePerAgg peraggs,
|
||||
AggStatePerGroup pergroup);
|
||||
static TupleTableSlot *project_aggregates(AggState *aggstate);
|
||||
static void find_cols(AggState *aggstate, Bitmapset **aggregated,
|
||||
@@ -407,12 +407,11 @@ static void build_hash_table(AggState *aggstate, int setno, long nbuckets);
|
||||
static void hashagg_recompile_expressions(AggState *aggstate, bool minslot,
|
||||
bool nullcheck);
|
||||
static long hash_choose_num_buckets(double hashentrysize,
|
||||
long estimated_nbuckets,
|
||||
Size memory);
|
||||
long ngroups, Size memory);
|
||||
static int hash_choose_num_partitions(double input_groups,
|
||||
double hashentrysize,
|
||||
int used_bits,
|
||||
int *log2_npartittions);
|
||||
int *log2_npartitions);
|
||||
static void initialize_hash_entry(AggState *aggstate,
|
||||
TupleHashTable hashtable,
|
||||
TupleHashEntry entry);
|
||||
@@ -432,11 +431,11 @@ static HashAggBatch *hashagg_batch_new(LogicalTape *input_tape, int setno,
|
||||
int64 input_tuples, double input_card,
|
||||
int used_bits);
|
||||
static MinimalTuple hashagg_batch_read(HashAggBatch *batch, uint32 *hashp);
|
||||
static void hashagg_spill_init(HashAggSpill *spill, LogicalTapeSet *lts,
|
||||
static void hashagg_spill_init(HashAggSpill *spill, LogicalTapeSet *tapeset,
|
||||
int used_bits, double input_groups,
|
||||
double hashentrysize);
|
||||
static Size hashagg_spill_tuple(AggState *aggstate, HashAggSpill *spill,
|
||||
TupleTableSlot *slot, uint32 hash);
|
||||
TupleTableSlot *inputslot, uint32 hash);
|
||||
static void hashagg_spill_finish(AggState *aggstate, HashAggSpill *spill,
|
||||
int setno);
|
||||
static Datum GetAggInitVal(Datum textInitVal, Oid transtype);
|
||||
|
||||
@@ -62,9 +62,9 @@ static HashJoinTuple ExecParallelHashTupleAlloc(HashJoinTable hashtable,
|
||||
dsa_pointer *shared);
|
||||
static void MultiExecPrivateHash(HashState *node);
|
||||
static void MultiExecParallelHash(HashState *node);
|
||||
static inline HashJoinTuple ExecParallelHashFirstTuple(HashJoinTable table,
|
||||
static inline HashJoinTuple ExecParallelHashFirstTuple(HashJoinTable hashtable,
|
||||
int bucketno);
|
||||
static inline HashJoinTuple ExecParallelHashNextTuple(HashJoinTable table,
|
||||
static inline HashJoinTuple ExecParallelHashNextTuple(HashJoinTable hashtable,
|
||||
HashJoinTuple tuple);
|
||||
static inline void ExecParallelHashPushTuple(dsa_pointer_atomic *head,
|
||||
HashJoinTuple tuple,
|
||||
@@ -73,7 +73,7 @@ static void ExecParallelHashJoinSetUpBatches(HashJoinTable hashtable, int nbatch
|
||||
static void ExecParallelHashEnsureBatchAccessors(HashJoinTable hashtable);
|
||||
static void ExecParallelHashRepartitionFirst(HashJoinTable hashtable);
|
||||
static void ExecParallelHashRepartitionRest(HashJoinTable hashtable);
|
||||
static HashMemoryChunk ExecParallelHashPopChunkQueue(HashJoinTable table,
|
||||
static HashMemoryChunk ExecParallelHashPopChunkQueue(HashJoinTable hashtable,
|
||||
dsa_pointer *shared);
|
||||
static bool ExecParallelHashTuplePrealloc(HashJoinTable hashtable,
|
||||
int batchno,
|
||||
|
||||
@@ -145,7 +145,7 @@ static TupleTableSlot *ExecHashJoinGetSavedTuple(HashJoinState *hjstate,
|
||||
TupleTableSlot *tupleSlot);
|
||||
static bool ExecHashJoinNewBatch(HashJoinState *hjstate);
|
||||
static bool ExecParallelHashJoinNewBatch(HashJoinState *hjstate);
|
||||
static void ExecParallelHashJoinPartitionOuter(HashJoinState *node);
|
||||
static void ExecParallelHashJoinPartitionOuter(HashJoinState *hjstate);
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------
|
||||
@@ -1502,11 +1502,11 @@ ExecHashJoinInitializeDSM(HashJoinState *state, ParallelContext *pcxt)
|
||||
* ----------------------------------------------------------------
|
||||
*/
|
||||
void
|
||||
ExecHashJoinReInitializeDSM(HashJoinState *state, ParallelContext *cxt)
|
||||
ExecHashJoinReInitializeDSM(HashJoinState *state, ParallelContext *pcxt)
|
||||
{
|
||||
int plan_node_id = state->js.ps.plan->plan_node_id;
|
||||
ParallelHashJoinState *pstate =
|
||||
shm_toc_lookup(cxt->toc, plan_node_id, false);
|
||||
shm_toc_lookup(pcxt->toc, plan_node_id, false);
|
||||
|
||||
/*
|
||||
* It would be possible to reuse the shared hash table in single-batch
|
||||
|
||||
@@ -133,8 +133,8 @@ typedef struct MemoizeEntry
|
||||
static uint32 MemoizeHash_hash(struct memoize_hash *tb,
|
||||
const MemoizeKey *key);
|
||||
static bool MemoizeHash_equal(struct memoize_hash *tb,
|
||||
const MemoizeKey *params1,
|
||||
const MemoizeKey *params2);
|
||||
const MemoizeKey *key1,
|
||||
const MemoizeKey *key2);
|
||||
|
||||
#define SH_PREFIX memoize
|
||||
#define SH_ELEMENT_TYPE MemoizeEntry
|
||||
|
||||
@@ -55,7 +55,7 @@ static int my_bloom_power(uint64 target_bitset_bits);
|
||||
static int optimal_k(uint64 bitset_bits, int64 total_elems);
|
||||
static void k_hashes(bloom_filter *filter, uint32 *hashes, unsigned char *elem,
|
||||
size_t len);
|
||||
static inline uint32 mod_m(uint32 a, uint64 m);
|
||||
static inline uint32 mod_m(uint32 val, uint64 m);
|
||||
|
||||
/*
|
||||
* Create Bloom filter in caller's memory context. We aim for a false positive
|
||||
|
||||
@@ -62,13 +62,13 @@ static void DecodePrepare(LogicalDecodingContext *ctx, XLogRecordBuffer *buf,
|
||||
|
||||
|
||||
/* common function to decode tuples */
|
||||
static void DecodeXLogTuple(char *data, Size len, ReorderBufferTupleBuf *tup);
|
||||
static void DecodeXLogTuple(char *data, Size len, ReorderBufferTupleBuf *tuple);
|
||||
|
||||
/* helper functions for decoding transactions */
|
||||
static inline bool FilterPrepare(LogicalDecodingContext *ctx,
|
||||
TransactionId xid, const char *gid);
|
||||
static bool DecodeTXNNeedSkip(LogicalDecodingContext *ctx,
|
||||
XLogRecordBuffer *buf, Oid dbId,
|
||||
XLogRecordBuffer *buf, Oid txn_dbid,
|
||||
RepOriginId origin_id);
|
||||
|
||||
/*
|
||||
|
||||
@@ -312,7 +312,8 @@ static inline void cleanup_subxact_info(void);
|
||||
* Serialize and deserialize changes for a toplevel transaction.
|
||||
*/
|
||||
static void stream_cleanup_files(Oid subid, TransactionId xid);
|
||||
static void stream_open_file(Oid subid, TransactionId xid, bool first);
|
||||
static void stream_open_file(Oid subid, TransactionId xid,
|
||||
bool first_segment);
|
||||
static void stream_write_change(char action, StringInfo s);
|
||||
static void stream_close_file(void);
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ static void pgoutput_begin_txn(LogicalDecodingContext *ctx,
|
||||
static void pgoutput_commit_txn(LogicalDecodingContext *ctx,
|
||||
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
|
||||
static void pgoutput_change(LogicalDecodingContext *ctx,
|
||||
ReorderBufferTXN *txn, Relation rel,
|
||||
ReorderBufferTXN *txn, Relation relation,
|
||||
ReorderBufferChange *change);
|
||||
static void pgoutput_truncate(LogicalDecodingContext *ctx,
|
||||
ReorderBufferTXN *txn, int nrelations, Relation relations[],
|
||||
@@ -212,7 +212,7 @@ typedef struct PGOutputTxnData
|
||||
/* Map used to remember which relation schemas we sent. */
|
||||
static HTAB *RelationSyncCache = NULL;
|
||||
|
||||
static void init_rel_sync_cache(MemoryContext decoding_context);
|
||||
static void init_rel_sync_cache(MemoryContext cachectx);
|
||||
static void cleanup_rel_sync_cache(TransactionId xid, bool is_commit);
|
||||
static RelationSyncEntry *get_rel_sync_entry(PGOutputData *data,
|
||||
Relation relation);
|
||||
|
||||
@@ -108,7 +108,7 @@ static void ReplicationSlotDropPtr(ReplicationSlot *slot);
|
||||
/* internal persistency functions */
|
||||
static void RestoreSlotFromDisk(const char *name);
|
||||
static void CreateSlotOnDisk(ReplicationSlot *slot);
|
||||
static void SaveSlotToPath(ReplicationSlot *slot, const char *path, int elevel);
|
||||
static void SaveSlotToPath(ReplicationSlot *slot, const char *dir, int elevel);
|
||||
|
||||
/*
|
||||
* Report shared-memory space needed by ReplicationSlotsShmemInit.
|
||||
|
||||
@@ -459,7 +459,7 @@ ForgetPrivateRefCountEntry(PrivateRefCountEntry *ref)
|
||||
)
|
||||
|
||||
|
||||
static Buffer ReadBuffer_common(SMgrRelation reln, char relpersistence,
|
||||
static Buffer ReadBuffer_common(SMgrRelation smgr, char relpersistence,
|
||||
ForkNumber forkNum, BlockNumber blockNum,
|
||||
ReadBufferMode mode, BufferAccessStrategy strategy,
|
||||
bool *hit);
|
||||
@@ -493,7 +493,7 @@ static void RelationCopyStorageUsingBuffer(RelFileLocator srclocator,
|
||||
static void AtProcExit_Buffers(int code, Datum arg);
|
||||
static void CheckForBufferLeaks(void);
|
||||
static int rlocator_comparator(const void *p1, const void *p2);
|
||||
static inline int buffertag_comparator(const BufferTag *a, const BufferTag *b);
|
||||
static inline int buffertag_comparator(const BufferTag *ba, const BufferTag *bb);
|
||||
static inline int ckpt_buforder_comparator(const CkptSortItem *a, const CkptSortItem *b);
|
||||
static int ts_ckpt_progress_comparator(Datum a, Datum b, void *arg);
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ static void extendBufFile(BufFile *file);
|
||||
static void BufFileLoadBuffer(BufFile *file);
|
||||
static void BufFileDumpBuffer(BufFile *file);
|
||||
static void BufFileFlush(BufFile *file);
|
||||
static File MakeNewFileSetSegment(BufFile *file, int segment);
|
||||
static File MakeNewFileSetSegment(BufFile *buffile, int segment);
|
||||
|
||||
/*
|
||||
* Create BufFile and perform the common initialization.
|
||||
|
||||
@@ -111,7 +111,7 @@ static int fsm_set_and_search(Relation rel, FSMAddress addr, uint16 slot,
|
||||
static BlockNumber fsm_search(Relation rel, uint8 min_cat);
|
||||
static uint8 fsm_vacuum_page(Relation rel, FSMAddress addr,
|
||||
BlockNumber start, BlockNumber end,
|
||||
bool *eof);
|
||||
bool *eof_p);
|
||||
|
||||
|
||||
/******** Public API ********/
|
||||
|
||||
@@ -1045,7 +1045,7 @@ dsm_unpin_segment(dsm_handle handle)
|
||||
* Find an existing mapping for a shared memory segment, if there is one.
|
||||
*/
|
||||
dsm_segment *
|
||||
dsm_find_mapping(dsm_handle h)
|
||||
dsm_find_mapping(dsm_handle handle)
|
||||
{
|
||||
dlist_iter iter;
|
||||
dsm_segment *seg;
|
||||
@@ -1053,7 +1053,7 @@ dsm_find_mapping(dsm_handle h)
|
||||
dlist_foreach(iter, &dsm_segment_list)
|
||||
{
|
||||
seg = dlist_container(dsm_segment, node, iter.cur);
|
||||
if (seg->handle == h)
|
||||
if (seg->handle == handle)
|
||||
return seg;
|
||||
}
|
||||
|
||||
|
||||
@@ -343,7 +343,7 @@ static bool KnownAssignedXidExists(TransactionId xid);
|
||||
static void KnownAssignedXidsRemove(TransactionId xid);
|
||||
static void KnownAssignedXidsRemoveTree(TransactionId xid, int nsubxids,
|
||||
TransactionId *subxids);
|
||||
static void KnownAssignedXidsRemovePreceding(TransactionId xid);
|
||||
static void KnownAssignedXidsRemovePreceding(TransactionId removeXid);
|
||||
static int KnownAssignedXidsGet(TransactionId *xarray, TransactionId xmax);
|
||||
static int KnownAssignedXidsGetAndSetXmin(TransactionId *xarray,
|
||||
TransactionId *xmin,
|
||||
|
||||
@@ -1913,13 +1913,13 @@ LWLockReleaseAll(void)
|
||||
* This is meant as debug support only.
|
||||
*/
|
||||
bool
|
||||
LWLockHeldByMe(LWLock *l)
|
||||
LWLockHeldByMe(LWLock *lock)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < num_held_lwlocks; i++)
|
||||
{
|
||||
if (held_lwlocks[i].lock == l)
|
||||
if (held_lwlocks[i].lock == lock)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -1931,14 +1931,14 @@ LWLockHeldByMe(LWLock *l)
|
||||
* This is meant as debug support only.
|
||||
*/
|
||||
bool
|
||||
LWLockAnyHeldByMe(LWLock *l, int nlocks, size_t stride)
|
||||
LWLockAnyHeldByMe(LWLock *lock, int nlocks, size_t stride)
|
||||
{
|
||||
char *held_lock_addr;
|
||||
char *begin;
|
||||
char *end;
|
||||
int i;
|
||||
|
||||
begin = (char *) l;
|
||||
begin = (char *) lock;
|
||||
end = begin + nlocks * stride;
|
||||
for (i = 0; i < num_held_lwlocks; i++)
|
||||
{
|
||||
@@ -1957,13 +1957,13 @@ LWLockAnyHeldByMe(LWLock *l, int nlocks, size_t stride)
|
||||
* This is meant as debug support only.
|
||||
*/
|
||||
bool
|
||||
LWLockHeldByMeInMode(LWLock *l, LWLockMode mode)
|
||||
LWLockHeldByMeInMode(LWLock *lock, LWLockMode mode)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < num_held_lwlocks; i++)
|
||||
{
|
||||
if (held_lwlocks[i].lock == l && held_lwlocks[i].mode == mode)
|
||||
if (held_lwlocks[i].lock == lock && held_lwlocks[i].mode == mode)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -446,7 +446,7 @@ static void SerialSetActiveSerXmin(TransactionId xid);
|
||||
|
||||
static uint32 predicatelock_hash(const void *key, Size keysize);
|
||||
static void SummarizeOldestCommittedSxact(void);
|
||||
static Snapshot GetSafeSnapshot(Snapshot snapshot);
|
||||
static Snapshot GetSafeSnapshot(Snapshot origSnapshot);
|
||||
static Snapshot GetSerializableTransactionSnapshotInt(Snapshot snapshot,
|
||||
VirtualTransactionId *sourcevxid,
|
||||
int sourcepid);
|
||||
|
||||
@@ -121,7 +121,7 @@ static MemoryContext MdCxt; /* context for all MdfdVec objects */
|
||||
|
||||
|
||||
/* local routines */
|
||||
static void mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forkNum,
|
||||
static void mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forknum,
|
||||
bool isRedo);
|
||||
static MdfdVec *mdopenfork(SMgrRelation reln, ForkNumber forknum, int behavior);
|
||||
static void register_dirty_segment(SMgrRelation reln, ForkNumber forknum,
|
||||
@@ -135,9 +135,9 @@ static void _fdvec_resize(SMgrRelation reln,
|
||||
int nseg);
|
||||
static char *_mdfd_segpath(SMgrRelation reln, ForkNumber forknum,
|
||||
BlockNumber segno);
|
||||
static MdfdVec *_mdfd_openseg(SMgrRelation reln, ForkNumber forkno,
|
||||
static MdfdVec *_mdfd_openseg(SMgrRelation reln, ForkNumber forknum,
|
||||
BlockNumber segno, int oflags);
|
||||
static MdfdVec *_mdfd_getseg(SMgrRelation reln, ForkNumber forkno,
|
||||
static MdfdVec *_mdfd_getseg(SMgrRelation reln, ForkNumber forknum,
|
||||
BlockNumber blkno, bool skipFsync, int behavior);
|
||||
static BlockNumber _mdnblocks(SMgrRelation reln, ForkNumber forknum,
|
||||
MdfdVec *seg);
|
||||
@@ -160,7 +160,7 @@ mdinit(void)
|
||||
* Note: this will return true for lingering files, with pending deletions
|
||||
*/
|
||||
bool
|
||||
mdexists(SMgrRelation reln, ForkNumber forkNum)
|
||||
mdexists(SMgrRelation reln, ForkNumber forknum)
|
||||
{
|
||||
/*
|
||||
* Close it first, to ensure that we notice if the fork has been unlinked
|
||||
@@ -168,9 +168,9 @@ mdexists(SMgrRelation reln, ForkNumber forkNum)
|
||||
* which already closes relations when dropping them.
|
||||
*/
|
||||
if (!InRecovery)
|
||||
mdclose(reln, forkNum);
|
||||
mdclose(reln, forknum);
|
||||
|
||||
return (mdopenfork(reln, forkNum, EXTENSION_RETURN_NULL) != NULL);
|
||||
return (mdopenfork(reln, forknum, EXTENSION_RETURN_NULL) != NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -179,16 +179,16 @@ mdexists(SMgrRelation reln, ForkNumber forkNum)
|
||||
* If isRedo is true, it's okay for the relation to exist already.
|
||||
*/
|
||||
void
|
||||
mdcreate(SMgrRelation reln, ForkNumber forkNum, bool isRedo)
|
||||
mdcreate(SMgrRelation reln, ForkNumber forknum, bool isRedo)
|
||||
{
|
||||
MdfdVec *mdfd;
|
||||
char *path;
|
||||
File fd;
|
||||
|
||||
if (isRedo && reln->md_num_open_segs[forkNum] > 0)
|
||||
if (isRedo && reln->md_num_open_segs[forknum] > 0)
|
||||
return; /* created and opened already... */
|
||||
|
||||
Assert(reln->md_num_open_segs[forkNum] == 0);
|
||||
Assert(reln->md_num_open_segs[forknum] == 0);
|
||||
|
||||
/*
|
||||
* We may be using the target table space for the first time in this
|
||||
@@ -203,7 +203,7 @@ mdcreate(SMgrRelation reln, ForkNumber forkNum, bool isRedo)
|
||||
reln->smgr_rlocator.locator.dbOid,
|
||||
isRedo);
|
||||
|
||||
path = relpath(reln->smgr_rlocator, forkNum);
|
||||
path = relpath(reln->smgr_rlocator, forknum);
|
||||
|
||||
fd = PathNameOpenFile(path, O_RDWR | O_CREAT | O_EXCL | PG_BINARY);
|
||||
|
||||
@@ -225,8 +225,8 @@ mdcreate(SMgrRelation reln, ForkNumber forkNum, bool isRedo)
|
||||
|
||||
pfree(path);
|
||||
|
||||
_fdvec_resize(reln, forkNum, 1);
|
||||
mdfd = &reln->md_seg_fds[forkNum][0];
|
||||
_fdvec_resize(reln, forknum, 1);
|
||||
mdfd = &reln->md_seg_fds[forknum][0];
|
||||
mdfd->mdfd_vfd = fd;
|
||||
mdfd->mdfd_segno = 0;
|
||||
}
|
||||
@@ -237,7 +237,7 @@ mdcreate(SMgrRelation reln, ForkNumber forkNum, bool isRedo)
|
||||
* Note that we're passed a RelFileLocatorBackend --- by the time this is called,
|
||||
* there won't be an SMgrRelation hashtable entry anymore.
|
||||
*
|
||||
* forkNum can be a fork number to delete a specific fork, or InvalidForkNumber
|
||||
* forknum can be a fork number to delete a specific fork, or InvalidForkNumber
|
||||
* to delete all forks.
|
||||
*
|
||||
* For regular relations, we don't unlink the first segment file of the rel,
|
||||
@@ -278,16 +278,16 @@ mdcreate(SMgrRelation reln, ForkNumber forkNum, bool isRedo)
|
||||
* we are usually not in a transaction anymore when this is called.
|
||||
*/
|
||||
void
|
||||
mdunlink(RelFileLocatorBackend rlocator, ForkNumber forkNum, bool isRedo)
|
||||
mdunlink(RelFileLocatorBackend rlocator, ForkNumber forknum, bool isRedo)
|
||||
{
|
||||
/* Now do the per-fork work */
|
||||
if (forkNum == InvalidForkNumber)
|
||||
if (forknum == InvalidForkNumber)
|
||||
{
|
||||
for (forkNum = 0; forkNum <= MAX_FORKNUM; forkNum++)
|
||||
mdunlinkfork(rlocator, forkNum, isRedo);
|
||||
for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
|
||||
mdunlinkfork(rlocator, forknum, isRedo);
|
||||
}
|
||||
else
|
||||
mdunlinkfork(rlocator, forkNum, isRedo);
|
||||
mdunlinkfork(rlocator, forknum, isRedo);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -315,18 +315,18 @@ do_truncate(const char *path)
|
||||
}
|
||||
|
||||
static void
|
||||
mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forkNum, bool isRedo)
|
||||
mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forknum, bool isRedo)
|
||||
{
|
||||
char *path;
|
||||
int ret;
|
||||
BlockNumber segno = 0;
|
||||
|
||||
path = relpath(rlocator, forkNum);
|
||||
path = relpath(rlocator, forknum);
|
||||
|
||||
/*
|
||||
* Delete or truncate the first segment.
|
||||
*/
|
||||
if (isRedo || forkNum != MAIN_FORKNUM || RelFileLocatorBackendIsTemp(rlocator))
|
||||
if (isRedo || forknum != MAIN_FORKNUM || RelFileLocatorBackendIsTemp(rlocator))
|
||||
{
|
||||
if (!RelFileLocatorBackendIsTemp(rlocator))
|
||||
{
|
||||
@@ -334,7 +334,7 @@ mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forkNum, bool isRedo)
|
||||
ret = do_truncate(path);
|
||||
|
||||
/* Forget any pending sync requests for the first segment */
|
||||
register_forget_request(rlocator, forkNum, 0 /* first seg */ );
|
||||
register_forget_request(rlocator, forknum, 0 /* first seg */ );
|
||||
}
|
||||
else
|
||||
ret = 0;
|
||||
@@ -367,7 +367,7 @@ mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forkNum, bool isRedo)
|
||||
*/
|
||||
if (!IsBinaryUpgrade)
|
||||
{
|
||||
register_unlink_segment(rlocator, forkNum, 0 /* first seg */ );
|
||||
register_unlink_segment(rlocator, forknum, 0 /* first seg */ );
|
||||
++segno;
|
||||
}
|
||||
}
|
||||
@@ -403,7 +403,7 @@ mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forkNum, bool isRedo)
|
||||
* Forget any pending sync requests for this segment before we
|
||||
* try to unlink.
|
||||
*/
|
||||
register_forget_request(rlocator, forkNum, segno);
|
||||
register_forget_request(rlocator, forknum, segno);
|
||||
}
|
||||
|
||||
if (unlink(segpath) < 0)
|
||||
|
||||
@@ -54,8 +54,8 @@ static int sjis2mic(const unsigned char *sjis, unsigned char *p, int len, bool n
|
||||
static int mic2sjis(const unsigned char *mic, unsigned char *p, int len, bool noError);
|
||||
static int euc_jp2mic(const unsigned char *euc, unsigned char *p, int len, bool noError);
|
||||
static int mic2euc_jp(const unsigned char *mic, unsigned char *p, int len, bool noError);
|
||||
static int euc_jp2sjis(const unsigned char *mic, unsigned char *p, int len, bool noError);
|
||||
static int sjis2euc_jp(const unsigned char *mic, unsigned char *p, int len, bool noError);
|
||||
static int euc_jp2sjis(const unsigned char *euc, unsigned char *p, int len, bool noError);
|
||||
static int sjis2euc_jp(const unsigned char *sjis, unsigned char *p, int len, bool noError);
|
||||
|
||||
Datum
|
||||
euc_jp_to_sjis(PG_FUNCTION_ARGS)
|
||||
|
||||
@@ -41,7 +41,7 @@ PG_FUNCTION_INFO_V1(mic_to_big5);
|
||||
*/
|
||||
|
||||
static int euc_tw2big5(const unsigned char *euc, unsigned char *p, int len, bool noError);
|
||||
static int big52euc_tw(const unsigned char *euc, unsigned char *p, int len, bool noError);
|
||||
static int big52euc_tw(const unsigned char *big5, unsigned char *p, int len, bool noError);
|
||||
static int big52mic(const unsigned char *big5, unsigned char *p, int len, bool noError);
|
||||
static int mic2big5(const unsigned char *mic, unsigned char *p, int len, bool noError);
|
||||
static int euc_tw2mic(const unsigned char *euc, unsigned char *p, int len, bool noError);
|
||||
|
||||
Reference in New Issue
Block a user