In a similar effort to
f01592f91, here we're targetting fixing the
warnings where we've deemed the shadowing variable to serve a close enough
purpose to the shadowed variable just to reuse the shadowed version and
not declare the shadowing variable at all.
By my count, this takes the warning count from 106 down to 71.
Author: Justin Pryzby
Discussion: https://postgr.es/m/
20220825020839.GT2342@telsasoft.com
{
Page mappage = (Page) BufferGetPage(mapbuffer);
uint32 *freep = NULL;
- char *data;
uint32 *bitmap_page_bit;
freep = HashPageGetBitmap(mappage);
if (MXactCacheMembers++ >= MAX_CACHE_ENTRIES)
{
dlist_node *node;
- mXactCacheEnt *entry;
node = dlist_tail_node(&MXactCache);
dlist_delete(node);
pgstat_report_wait_start(WAIT_EVENT_WAL_INIT_SYNC);
if (pg_fsync(fd) != 0)
{
- int save_errno = errno;
-
+ save_errno = errno;
close(fd);
errno = save_errno;
ereport(ERROR,
if (close(fd) != 0)
{
- char xlogfname[MAXFNAMELEN];
int save_errno = errno;
XLogFileName(xlogfname, newTLI, startLogSegNo, wal_segment_size);
{
char *typnam = TypeNameToString(returnType);
Oid namespaceId;
- AclResult aclresult;
char *typname;
ObjectAddress address;
if (languageStruct->lanpltrusted)
{
/* if trusted language, need USAGE privilege */
- AclResult aclresult;
-
aclresult = pg_language_aclcheck(languageOid, GetUserId(), ACL_USAGE);
if (aclresult != ACLCHECK_OK)
aclcheck_error(aclresult, OBJECT_LANGUAGE,
if (oids_to_drop != NIL)
{
ObjectAddresses *targetObjects = new_object_addresses();
- ListCell *l;
foreach(l, oids_to_drop)
{
*/
if (!(params.options & VACOPT_ANALYZE))
{
- ListCell *lc;
-
foreach(lc, vacstmt->rels)
{
VacuumRelation *vrel = lfirst_node(VacuumRelation, lc);
{
List *onconflset;
List *onconflcols;
- bool found_whole_row;
/*
* Translate expressions in onConflictSet to account for
if (winstate->all_first)
{
int frameOptions = winstate->frameOptions;
- ExprContext *econtext = winstate->ss.ps.ps_ExprContext;
Datum value;
bool isnull;
int16 len;
bool byval;
+ econtext = winstate->ss.ps.ps_ExprContext;
+
if (frameOptions & FRAMEOPTION_START_OFFSET)
{
Assert(winstate->startOffset != NULL);
*/
if (intset->num_buffered_values > 0 && x >= intset->buffered_values[0])
{
- int itemno;
-
itemno = intset_binsrch_uint64(x,
intset->buffered_values,
intset->num_buffered_values,
return false;
else
{
- int i; /* Index into *ident_user */
-
cursor++; /* Go over colon */
while (pg_isblank(*cursor))
cursor++; /* skip blanks */
if (bitjoinpaths != NIL)
{
List *all_path_outers;
- ListCell *lc;
/* Identify each distinct parameterization seen in bitjoinpaths */
all_path_outers = NIL;
/* Ignore duplicates */
foreach(lc, clauseset->indexclauses[indexcol])
{
- IndexClause *iclause = (IndexClause *) lfirst(lc);
+ iclause = (IndexClause *) lfirst(lc);
if (iclause->rinfo == rinfo)
return;
if (gd->hash_sets_idx)
{
- ListCell *lc;
-
gd->dNumHashGroups = 0;
groupExprs = get_sortgrouplist_exprs(parse->groupClause,
Path *cheapest_input_path = input_rel->cheapest_total_path;
double numDistinctRows;
bool allow_hash;
- Path *path;
- ListCell *lc;
/* Estimate number of distinct rows there will be */
if (parse->groupClause || parse->groupingSets || parse->hasAggs ||
* the other.)
*/
List *needed_pathkeys;
+ Path *path;
+ ListCell *lc;
if (parse->hasDistinctOn &&
list_length(root->distinct_pathkeys) <
foreach(lc, input_rel->pathlist)
{
- Path *path = (Path *) lfirst(lc);
+ path = (Path *) lfirst(lc);
if (pathkeys_contained_in(needed_pathkeys, path->pathkeys))
{
*/
if (enable_incremental_sort && list_length(root->sort_pathkeys) > 1)
{
- ListCell *lc;
-
foreach(lc, input_rel->partial_pathlist)
{
Path *input_path = (Path *) lfirst(lc);
AppendRelInfo **appinfos;
int nappinfos;
List *child_scanjoin_targets = NIL;
- ListCell *lc;
Assert(child_rel != NULL);
case T_Append:
{
- ListCell *l;
-
foreach(l, ((Append *) plan)->appendplans)
{
context.paramids =
case T_MergeAppend:
{
- ListCell *l;
-
foreach(l, ((MergeAppend *) plan)->mergeplans)
{
context.paramids =
case T_BitmapAnd:
{
- ListCell *l;
-
foreach(l, ((BitmapAnd *) plan)->bitmapplans)
{
context.paramids =
case T_BitmapOr:
{
- ListCell *l;
-
foreach(l, ((BitmapOr *) plan)->bitmapplans)
{
context.paramids =
case T_NestLoop:
{
- ListCell *l;
-
finalize_primnode((Node *) ((Join *) plan)->joinqual,
&context);
/* collect set of params that will be passed to right child */
if (partial_paths_valid)
{
Path *ppath;
- ListCell *lc;
int parallel_workers = 0;
/* Find the highest number of workers requested for any subpath. */
*/
for (i = 0; i < nelems; i++)
{
- avl_dbase *db = &(dbary[i]);
+ db = &(dbary[i]);
current_time = TimestampTzPlusMilliseconds(current_time,
millis_increment);
{
RowSecurityPolicy *policy = (RowSecurityPolicy *) lfirst(item);
Expr *qual = QUAL_FOR_WCO(policy);
- WithCheckOption *wco;
if (qual != NULL)
{
else if (is_orclause(clause))
{
BoolExpr *bool_expr = (BoolExpr *) clause;
- ListCell *lc;
/* start with no expression (we'll use the first match) */
*expr = NULL;
* quadrants if we're looking for a value strictly greater
* than the maximum.
*/
- int cmp;
cmp = range_cmp_bounds(typcache, ¢roidLower, maxLower);
if (cmp > 0 || (!inclusive && cmp == 0))
* quadrants if we're looking for a value strictly greater
* than the maximum.
*/
- int cmp;
cmp = range_cmp_bounds(typcache, ¢roidUpper, maxUpper);
if (cmp > 0 || (!inclusive && cmp == 0))
if (!heap_attisnull(ht_idx, Anum_pg_index_indexprs, NULL))
{
Datum exprsDatum;
- bool isnull;
char *exprsString;
exprsDatum = SysCacheGetAttr(INDEXRELID, ht_idx,
{
Node *node;
Datum predDatum;
- bool isnull;
char *predString;
/* Convert text string to node tree */
if (!heap_attisnull(tuple, Anum_pg_partitioned_table_partexprs, NULL))
{
Datum exprsDatum;
- bool isnull;
char *exprsString;
exprsDatum = SysCacheGetAttr(PARTRELID, tuple,
for (j = 0; commands[j] != NULL; j++)
{
PGresult *res;
- char name[MAX_PREPARE_NAME];
if (commands[j]->type != SQL_COMMAND)
continue;
/* quickly skip commands until something to do... */
while (true)
{
- Command *command;
-
command = sql_script[st->use_file].commands[st->command];
/* cannot reach end of script in that state */
*/
if (report_per_command)
{
- Command *command;
-
pg_time_now_lazy(&now);
command = sql_script[st->use_file].commands[st->command];