mirror of
https://github.com/postgres/postgres.git
synced 2025-04-21 12:05:57 +03:00
Fix inconsistencies in the code
This addresses a couple of issues in the code: - Typos and inconsistencies in comments and function declarations. - Removal of unreferenced function declarations. - Removal of unnecessary compile flags. - A cleanup error in regressplans.sh. Author: Alexander Lakhin Discussion: https://postgr.es/m/0c991fdf-2670-1997-c027-772a420c4604@gmail.com
This commit is contained in:
parent
7e9a4c5c3d
commit
6b8548964b
@ -590,7 +590,7 @@ g_cube_picksplit(PG_FUNCTION_ARGS)
|
||||
v->spl_nright++;
|
||||
}
|
||||
}
|
||||
*left = *right = FirstOffsetNumber; /* sentinel value, see dosplit() */
|
||||
*left = *right = FirstOffsetNumber; /* sentinel value */
|
||||
|
||||
v->spl_ldatum = PointerGetDatum(datum_l);
|
||||
v->spl_rdatum = PointerGetDatum(datum_r);
|
||||
|
@ -11036,7 +11036,7 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
|
||||
<entry><structfield>kinds</structfield></entry>
|
||||
<entry><type>text[]</type></entry>
|
||||
<entry></entry>
|
||||
<entry>Types of exdended statistics enabled for this record</entry>
|
||||
<entry>Types of extended statistics enabled for this record</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
|
@ -910,7 +910,7 @@ Datum
|
||||
my_fetch(PG_FUNCTION_ARGS)
|
||||
{
|
||||
GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
|
||||
input_data_type *in = DatumGetP(entry->key);
|
||||
input_data_type *in = DatumGetPointer(entry->key);
|
||||
fetched_data_type *fetched_data;
|
||||
GISTENTRY *retval;
|
||||
|
||||
|
@ -367,8 +367,10 @@ static bool SetOffsetVacuumLimit(bool is_startup);
|
||||
static bool find_multixact_start(MultiXactId multi, MultiXactOffset *result);
|
||||
static void WriteMZeroPageXlogRec(int pageno, uint8 info);
|
||||
static void WriteMTruncateXlogRec(Oid oldestMultiDB,
|
||||
MultiXactId startOff, MultiXactId endOff,
|
||||
MultiXactOffset startMemb, MultiXactOffset endMemb);
|
||||
MultiXactId startTruncOff,
|
||||
MultiXactId endTruncOff,
|
||||
MultiXactOffset startTruncMemb,
|
||||
MultiXactOffset endTruncMemb);
|
||||
|
||||
|
||||
/*
|
||||
@ -2784,7 +2786,7 @@ ReadMultiXactCounts(uint32 *multixacts, MultiXactOffset *members)
|
||||
|
||||
/*
|
||||
* Multixact members can be removed once the multixacts that refer to them
|
||||
* are older than every datminxmid. autovacuum_multixact_freeze_max_age and
|
||||
* are older than every datminmxid. autovacuum_multixact_freeze_max_age and
|
||||
* vacuum_multixact_freeze_table_age work together to make sure we never have
|
||||
* too many multixacts; we hope that, at least under normal circumstances,
|
||||
* this will also be sufficient to keep us from using too many offsets.
|
||||
|
@ -1641,7 +1641,7 @@ expand_all_col_privileges(Oid table_oid, Form_pg_class classForm,
|
||||
|
||||
/*
|
||||
* This processes attributes, but expects to be called from
|
||||
* ExecGrant_Relation, not directly from ExecGrantStmt.
|
||||
* ExecGrant_Relation, not directly from ExecuteGrantStmt.
|
||||
*/
|
||||
static void
|
||||
ExecGrant_Attribute(InternalGrant *istmt, Oid relOid, const char *relname,
|
||||
|
@ -504,9 +504,9 @@ RangeVarGetCreationNamespace(const RangeVar *newRelation)
|
||||
* permission on the target namespace, this function will instead signal
|
||||
* an ERROR.
|
||||
*
|
||||
* If non-NULL, *existing_oid is set to the OID of any existing relation with
|
||||
* the same name which already exists in that namespace, or to InvalidOid if
|
||||
* no such relation exists.
|
||||
* If non-NULL, *existing_relation_id is set to the OID of any existing relation
|
||||
* with the same name which already exists in that namespace, or to InvalidOid
|
||||
* if no such relation exists.
|
||||
*
|
||||
* If lockmode != NoLock, the specified lock mode is acquired on the existing
|
||||
* relation, if any, provided that the current user owns the target relation.
|
||||
|
@ -186,9 +186,9 @@ Expression Evaluation
|
||||
|
||||
To allow for different methods of expression evaluation, and for
|
||||
better branch/jump target prediction, expressions are evaluated by
|
||||
calling ExprState->evalfunc (via ExprEvalExpr() and friends).
|
||||
calling ExprState->evalfunc (via ExecEvalExpr() and friends).
|
||||
|
||||
ExprReadyExpr() can choose the method of interpretation by setting
|
||||
ExecReadyExpr() can choose the method of interpretation by setting
|
||||
evalfunc to an appropriate function. The default execution function,
|
||||
ExecInterpExpr, is implemented in execExprInterp.c; see its header
|
||||
comment for details. Special-case evalfuncs are used for certain
|
||||
|
@ -98,8 +98,7 @@ ExecScanFetch(ScanState *node,
|
||||
* ExecScan
|
||||
*
|
||||
* Scans the relation using the 'access method' indicated and
|
||||
* returns the next qualifying tuple in the direction specified
|
||||
* in the global variable ExecDirection.
|
||||
* returns the next qualifying tuple.
|
||||
* The access method returns the next tuple and ExecScan() is
|
||||
* responsible for checking the tuple returned against the qual-clause.
|
||||
*
|
||||
|
@ -1148,7 +1148,7 @@ ExecAllocTableSlot(List **tupleTable, TupleDesc desc,
|
||||
* This releases any resources (buffer pins, tupdesc refcounts)
|
||||
* held by the tuple table, and optionally releases the memory
|
||||
* occupied by the tuple table data structure.
|
||||
* It is expected that this routine be called by EndPlan().
|
||||
* It is expected that this routine be called by ExecEndPlan().
|
||||
* --------------------------------
|
||||
*/
|
||||
void
|
||||
|
@ -196,8 +196,8 @@ ExecProjectSRF(ProjectSetState *node, bool continuing)
|
||||
Assert(hassrf);
|
||||
|
||||
/*
|
||||
* If all the SRFs returned EndResult, we consider that as no row being
|
||||
* produced.
|
||||
* If all the SRFs returned ExprEndResult, we consider that as no row
|
||||
* being produced.
|
||||
*/
|
||||
if (hasresult)
|
||||
{
|
||||
|
@ -160,7 +160,7 @@ ExecRecursiveUnion(PlanState *pstate)
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------
|
||||
* ExecInitRecursiveUnionScan
|
||||
* ExecInitRecursiveUnion
|
||||
* ----------------------------------------------------------------
|
||||
*/
|
||||
RecursiveUnionState *
|
||||
@ -263,7 +263,7 @@ ExecInitRecursiveUnion(RecursiveUnion *node, EState *estate, int eflags)
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------
|
||||
* ExecEndRecursiveUnionScan
|
||||
* ExecEndRecursiveUnion
|
||||
*
|
||||
* frees any storage allocated through C routines.
|
||||
* ----------------------------------------------------------------
|
||||
|
@ -409,7 +409,7 @@ dshash_find(dshash_table *hash_table, const void *key, bool exclusive)
|
||||
}
|
||||
else
|
||||
{
|
||||
/* The caller will free the lock by calling dshash_release. */
|
||||
/* The caller will free the lock by calling dshash_release_lock. */
|
||||
hash_table->find_locked = true;
|
||||
hash_table->find_exclusively_locked = exclusive;
|
||||
return ENTRY_FROM_ITEM(item);
|
||||
|
@ -1069,7 +1069,7 @@ rebuild_database_list(Oid newdb)
|
||||
current_time = GetCurrentTimestamp();
|
||||
|
||||
/*
|
||||
* move the elements from the array into the dllist, setting the
|
||||
* move the elements from the array into the dlist, setting the
|
||||
* next_worker while walking the array
|
||||
*/
|
||||
for (i = 0; i < nelems; i++)
|
||||
|
@ -1074,7 +1074,7 @@ sendDir(const char *path, int basepathlen, bool sizeonly, List *tablespaces,
|
||||
* error in that case. The error handler further up will call
|
||||
* do_pg_abort_backup() for us. Also check that if the backup was
|
||||
* started while still in recovery, the server wasn't promoted.
|
||||
* dp_pg_stop_backup() will check that too, but it's better to stop
|
||||
* do_pg_stop_backup() will check that too, but it's better to stop
|
||||
* the backup early than continue to the end and fail there.
|
||||
*/
|
||||
CHECK_FOR_INTERRUPTS();
|
||||
|
@ -361,7 +361,7 @@ DropRelFileNodeLocalBuffers(RelFileNode rnode, ForkNumber forkNum,
|
||||
* This function removes from the buffer pool all pages of all forks
|
||||
* of the specified relation.
|
||||
*
|
||||
* See DropRelFileNodeAllBuffers in bufmgr.c for more notes.
|
||||
* See DropRelFileNodesAllBuffers in bufmgr.c for more notes.
|
||||
*/
|
||||
void
|
||||
DropRelFileNodeAllLocalBuffers(RelFileNode rnode)
|
||||
|
@ -1428,10 +1428,11 @@ GetOldestXmin(Relation rel, int flags)
|
||||
result = replication_slot_xmin;
|
||||
|
||||
/*
|
||||
* After locks have been released and defer_cleanup_age has been applied,
|
||||
* check whether we need to back up further to make logical decoding
|
||||
* possible. We need to do so if we're computing the global limit (rel =
|
||||
* NULL) or if the passed relation is a catalog relation of some kind.
|
||||
* After locks have been released and vacuum_defer_cleanup_age has been
|
||||
* applied, check whether we need to back up further to make logical
|
||||
* decoding possible. We need to do so if we're computing the global limit
|
||||
* (rel = NULL) or if the passed relation is a catalog relation of some
|
||||
* kind.
|
||||
*/
|
||||
if (!(flags & PROCARRAY_SLOTS_XMIN) &&
|
||||
(rel == NULL ||
|
||||
|
@ -4360,7 +4360,7 @@ CheckTargetForConflictsIn(PREDICATELOCKTARGETTAG *targettag)
|
||||
/*
|
||||
* If we found one of our own SIREAD locks to remove, remove it now.
|
||||
*
|
||||
* At this point our transaction already has an ExclusiveRowLock on the
|
||||
* At this point our transaction already has a RowExclusiveLock on the
|
||||
* relation, so we are OK to drop the predicate lock on the tuple, if
|
||||
* found, without fearing that another write against the tuple will occur
|
||||
* before the MVCC information makes it to the buffer.
|
||||
|
@ -1163,9 +1163,6 @@ _mdfd_getseg(SMgrRelation reln, ForkNumber forknum, BlockNumber blkno,
|
||||
* replaying WAL data that has a write into a high-numbered
|
||||
* segment of a relation that was later deleted. We want to go
|
||||
* ahead and create the segments so we can finish out the replay.
|
||||
* However if the caller has specified
|
||||
* EXTENSION_REALLY_RETURN_NULL, then extension is not desired
|
||||
* even in recovery; we won't reach this point in that case.
|
||||
*
|
||||
* We have to maintain the invariant that segments before the last
|
||||
* active segment are of size RELSEG_SIZE; therefore, if
|
||||
|
@ -738,7 +738,7 @@ get_docrep(TSVector txt, QueryRepresentation *qr, int *doclen)
|
||||
doc = (DocRepresentation *) palloc(sizeof(DocRepresentation) * len);
|
||||
|
||||
/*
|
||||
* Iterate through query to make DocRepresentaion for words and it's
|
||||
* Iterate through query to make DocRepresentation for words and it's
|
||||
* entries satisfied by query
|
||||
*/
|
||||
for (i = 0; i < qr->query->size; i++)
|
||||
|
@ -53,8 +53,7 @@ validateTzEntry(tzEntry *tzentry)
|
||||
unsigned char *p;
|
||||
|
||||
/*
|
||||
* Check restrictions imposed by datetkntbl storage format (see
|
||||
* datetime.c)
|
||||
* Check restrictions imposed by datetktbl storage format (see datetime.c)
|
||||
*/
|
||||
if (strlen(tzentry->abbrev) > TOKMAXLEN)
|
||||
{
|
||||
|
@ -378,7 +378,7 @@ notice_processor(void *arg, const char *message)
|
||||
pg_log_generic(PG_LOG_INFO, "%s", message);
|
||||
}
|
||||
|
||||
/* Like exit_fatal(), but with a complaint about a particular query. */
|
||||
/* Like fatal(), but with a complaint about a particular query. */
|
||||
static void
|
||||
die_on_query_failure(ArchiveHandle *AH, const char *query)
|
||||
{
|
||||
|
@ -112,7 +112,7 @@ extern TableScanDesc heap_beginscan(Relation relation, Snapshot snapshot,
|
||||
ParallelTableScanDesc parallel_scan,
|
||||
uint32 flags);
|
||||
extern void heap_setscanlimits(TableScanDesc scan, BlockNumber startBlk,
|
||||
BlockNumber endBlk);
|
||||
BlockNumber numBlks);
|
||||
extern void heapgetpage(TableScanDesc scan, BlockNumber page);
|
||||
extern void heap_rescan(TableScanDesc scan, ScanKey key, bool set_params,
|
||||
bool allow_strat, bool allow_sync, bool allow_pagemode);
|
||||
|
@ -36,7 +36,7 @@ extern void writeTimeLineHistory(TimeLineID newTLI, TimeLineID parentTLI,
|
||||
XLogRecPtr switchpoint, char *reason);
|
||||
extern void writeTimeLineHistoryFile(TimeLineID tli, char *content, int size);
|
||||
extern void restoreTimeLineHistoryFiles(TimeLineID begin, TimeLineID end);
|
||||
extern bool tliInHistory(TimeLineID tli, List *expectedTLIs);
|
||||
extern bool tliInHistory(TimeLineID tli, List *expectedTLEs);
|
||||
extern TimeLineID tliOfPointInHistory(XLogRecPtr ptr, List *history);
|
||||
extern XLogRecPtr tliSwitchPoint(TimeLineID tli, List *history,
|
||||
TimeLineID *nextTLI);
|
||||
|
@ -314,7 +314,7 @@ ExecEvalExprSwitchContext(ExprState *state,
|
||||
* ExecProject
|
||||
*
|
||||
* Projects a tuple based on projection info and stores it in the slot passed
|
||||
* to ExecBuildProjectInfo().
|
||||
* to ExecBuildProjectionInfo().
|
||||
*
|
||||
* Note: the result is always a virtual tuple; therefore it may reference
|
||||
* the contents of the exprContext's scan tuples and/or temporary results
|
||||
|
@ -20,11 +20,11 @@ struct TableFuncScanState;
|
||||
* TableFuncRoutine holds function pointers used for generating content of
|
||||
* table-producer functions, such as XMLTABLE.
|
||||
*
|
||||
* InitBuilder initialize table builder private objects. The output tuple
|
||||
* InitOpaque initializes table builder private objects. The output tuple
|
||||
* descriptor, input functions for the columns, and typioparams are passed
|
||||
* from executor state.
|
||||
*
|
||||
* SetDoc is called to define the input document. The table builder may
|
||||
* SetDocument is called to define the input document. The table builder may
|
||||
* apply additional transformations not exposed outside the table builder
|
||||
* context.
|
||||
*
|
||||
@ -45,7 +45,7 @@ struct TableFuncScanState;
|
||||
* builder context such that each subsequent GetValue call returns the values
|
||||
* for the indicated column for the row being processed.
|
||||
*
|
||||
* DestroyBuilder shall release all resources associated with a table builder
|
||||
* DestroyOpaque shall release all resources associated with a table builder
|
||||
* context. It may be called either because all rows have been consumed, or
|
||||
* because an error occurred while processing the table expression.
|
||||
*/
|
||||
|
@ -593,7 +593,7 @@ typedef struct EState
|
||||
* and with which options. es_jit is created on-demand when JITing is
|
||||
* performed.
|
||||
*
|
||||
* es_jit_combined_instr is the combined, on demand allocated,
|
||||
* es_jit_worker_instr is the combined, on demand allocated,
|
||||
* instrumentation from all workers. The leader's instrumentation is kept
|
||||
* separate, and is combined on demand by ExplainPrintJITSummary().
|
||||
*/
|
||||
|
@ -60,10 +60,10 @@ typedef struct PartitionPruneContext
|
||||
} PartitionPruneContext;
|
||||
|
||||
/*
|
||||
* PruneCxtStateIdx() computes the correct index into the stepcmpfuncs[],
|
||||
* exprstates[] and exprhasexecparam[] arrays for step step_id and
|
||||
* partition key column keyno. (Note: there is code that assumes the
|
||||
* entries for a given step are sequential, so this is not chosen freely.)
|
||||
* PruneCxtStateIdx() computes the correct index into the stepcmpfuncs[]
|
||||
* and exprstates[] arrays for step step_id and partition key column keyno.
|
||||
* (Note: there is code that assumes the entries for a given step are
|
||||
* sequential, so this is not chosen freely.)
|
||||
*/
|
||||
#define PruneCxtStateIdx(partnatts, step_id, keyno) \
|
||||
((partnatts) * (step_id) + (keyno))
|
||||
|
@ -68,7 +68,7 @@ pg_atomic_compare_exchange_u32_impl(volatile pg_atomic_uint32 *ptr,
|
||||
_Asm_mf();
|
||||
/*
|
||||
* Notes:
|
||||
* DOWN_MEM_FENCE | _UP_MEM_FENCE prevents reordering by the compiler
|
||||
* _DOWN_MEM_FENCE | _UP_MEM_FENCE prevents reordering by the compiler
|
||||
*/
|
||||
current = _Asm_cmpxchg(_SZ_W, /* word */
|
||||
_SEM_REL,
|
||||
|
@ -1,5 +1,5 @@
|
||||
# src/interfaces/ecpg/compatlib/exports.txt
|
||||
# Functions to be exported by ecpg_compatlib DLL
|
||||
# Functions to be exported by libecpg_compat DLL
|
||||
ECPG_informix_get_var 1
|
||||
ECPG_informix_set_var 2
|
||||
decadd 3
|
||||
|
@ -195,11 +195,8 @@ char *ecpg_strdup(const char *, int);
|
||||
const char *ecpg_type_name(enum ECPGttype);
|
||||
int ecpg_dynamic_type(Oid);
|
||||
int sqlda_dynamic_type(Oid, enum COMPAT_MODE);
|
||||
void ecpg_free_auto_mem(void);
|
||||
void ecpg_clear_auto_mem(void);
|
||||
|
||||
struct descriptor *ecpggetdescp(int, char *);
|
||||
|
||||
struct descriptor *ecpg_find_desc(int line, const char *name);
|
||||
|
||||
struct prepared_statement *ecpg_find_prepared_statement(const char *,
|
||||
|
@ -1899,7 +1899,7 @@ ecpg_process_output(struct statement *stmt, bool clear_result)
|
||||
|
||||
/*
|
||||
* execution should never reach this code because it is already
|
||||
* handled in ECPGcheck_PQresult()
|
||||
* handled in ecpg_check_PQresult()
|
||||
*/
|
||||
ecpg_log("ecpg_process_output on line %d: unknown execution status type\n",
|
||||
stmt->lineno);
|
||||
|
@ -63,8 +63,6 @@ char *ECPGprepared_statement(const char *, const char *, int);
|
||||
PGconn *ECPGget_PGconn(const char *);
|
||||
PGTransactionStatusType ECPGtransactionStatus(const char *);
|
||||
|
||||
char *ECPGerrmsg(void);
|
||||
|
||||
/* print an error message */
|
||||
void sqlprint(void);
|
||||
|
||||
|
@ -19,7 +19,6 @@ override CPPFLAGS := -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \
|
||||
-I. -I$(srcdir) \
|
||||
-I$(top_srcdir)/src/interfaces/ecpg/ecpglib \
|
||||
-I$(libpq_srcdir) \
|
||||
-DECPG_COMPILE \
|
||||
$(CPPFLAGS)
|
||||
|
||||
override CFLAGS += $(PTHREAD_CFLAGS)
|
||||
|
@ -30,7 +30,6 @@ extern int braces_open,
|
||||
struct_level,
|
||||
ecpg_internal_var;
|
||||
extern char *current_function;
|
||||
extern char *descriptor_index;
|
||||
extern char *descriptor_name;
|
||||
extern char *connection;
|
||||
extern char *input_filename;
|
||||
|
@ -3294,10 +3294,10 @@ exec_stmt_return_next(PLpgSQL_execstate *estate,
|
||||
* reference; in particular, this path is always taken in functions with
|
||||
* one or more OUT parameters.
|
||||
*
|
||||
* Unlike exec_statement_return, there's no special win here for R/W
|
||||
* expanded values, since they'll have to get flattened to go into the
|
||||
* tuplestore. Indeed, we'd better make them R/O to avoid any risk of the
|
||||
* casting step changing them in-place.
|
||||
* Unlike exec_stmt_return, there's no special win here for R/W expanded
|
||||
* values, since they'll have to get flattened to go into the tuplestore.
|
||||
* Indeed, we'd better make them R/O to avoid any risk of the casting step
|
||||
* changing them in-place.
|
||||
*/
|
||||
if (stmt->retvarno >= 0)
|
||||
{
|
||||
|
@ -72,7 +72,7 @@ mv -f regression.out planregress/out.in
|
||||
mv -f regression.diffs planregress/diffs.in
|
||||
PGOPTIONS="$PGOPTIONS -fi -fn -fh" $MAKE runtest
|
||||
mv -f regression.out planregress/out.inh
|
||||
mv -f regression.diffsregression.planregress/inh
|
||||
mv -f regression.diffs planregress/diffs.inh
|
||||
PGOPTIONS="$PGOPTIONS -fi -fn -fm " $MAKE runtest
|
||||
mv -f regression.out planregress/out.inm
|
||||
mv -f regression.diffs planregress/diffs.inm
|
||||
|
@ -309,7 +309,6 @@ sub mkvcbuild
|
||||
$ecpg->AddIncludeDir('src/interfaces/libpq');
|
||||
$ecpg->AddPrefixInclude('src/interfaces/ecpg/preproc');
|
||||
$ecpg->AddFiles('src/interfaces/ecpg/preproc', 'pgc.l', 'preproc.y');
|
||||
$ecpg->AddDefine('ECPG_COMPILE');
|
||||
$ecpg->AddReference($libpgcommon, $libpgport);
|
||||
|
||||
my $pgregress_ecpg =
|
||||
|
Loading…
x
Reference in New Issue
Block a user