if (metaData->nEnd > metaData->nStart)
{
- Page page;
-
blkno = metaData->notFullPage[metaData->nStart];
Assert(blkno != InvalidBlockNumber);
for (attnum = 1; attnum <= natts; attnum++)
{
Form_pg_attribute attr = TupleDescAttr(tupleDesc, attnum - 1);
- List *options;
+ List *column_options;
ListCell *lc;
/* Skip dropped attributes. */
if (attr->attisdropped)
continue;
- options = GetForeignColumnOptions(relid, attnum);
- foreach(lc, options)
+ column_options = GetForeignColumnOptions(relid, attnum);
+ foreach(lc, column_options)
{
DefElem *def = (DefElem *) lfirst(lc);
fncolumns = lappend(fncolumns, makeString(attname));
}
}
- /* maybe in future handle other options here */
+ /* maybe in future handle other column options here */
}
}
/* finalize a newly-constructed hstore */
#define HS_FINALIZE(hsp_,count_,buf_,ptr_) \
do { \
- int buflen = (ptr_) - (buf_); \
+ int _buflen = (ptr_) - (buf_); \
if ((count_)) \
ARRPTR(hsp_)[0].entry |= HENTRY_ISFIRST; \
if ((count_) != HS_COUNT((hsp_))) \
{ \
HS_SETCOUNT((hsp_),(count_)); \
- memmove(STRPTR(hsp_), (buf_), buflen); \
+ memmove(STRPTR(hsp_), (buf_), _buflen); \
} \
- SET_VARSIZE((hsp_), CALCDATASIZE((count_), buflen)); \
+ SET_VARSIZE((hsp_), CALCDATASIZE((count_), _buflen)); \
} while (0)
/* ensure the varlena size of an existing hstore is correct */
*/
if (agg->aggorder)
{
- ListCell *lc;
-
foreach(lc, agg->aggorder)
{
SortGroupClause *srt = (SortGroupClause *) lfirst(lc);
*/
if (outer_plan)
{
- ListCell *lc;
-
/*
* Right now, we only consider grouping and aggregation beyond
* joins. Queries involving aggregates or grouping do not require
*/
foreach(l, aggvars)
{
- Expr *expr = (Expr *) lfirst(l);
+ Expr *aggref = (Expr *) lfirst(l);
- if (IsA(expr, Aggref))
- tlist = add_to_flat_tlist(tlist, list_make1(expr));
+ if (IsA(aggref, Aggref))
+ tlist = add_to_flat_tlist(tlist, list_make1(aggref));
}
}
}
*/
if (havingQual)
{
- ListCell *lc;
-
foreach(lc, (List *) havingQual)
{
Expr *expr = (Expr *) lfirst(lc);
if (fpinfo->local_conds)
{
List *aggvars = NIL;
- ListCell *lc;
foreach(lc, fpinfo->local_conds)
{
*/
if (PqGSSSendLength)
{
- ssize_t ret;
+ ssize_t retval;
ssize_t amount = PqGSSSendLength - PqGSSSendNext;
- ret = pqsecure_raw_write(conn, PqGSSSendBuffer + PqGSSSendNext, amount);
- if (ret <= 0)
+ retval = pqsecure_raw_write(conn, PqGSSSendBuffer + PqGSSSendNext, amount);
+ if (retval <= 0)
{
/*
* Report any previously-sent data; if there was none, reflect
*/
if (bytes_sent)
return bytes_sent;
- return ret;
+ return retval;
}
/*
* Check if this was a partial write, and if so, move forward that
* far in our buffer and try again.
*/
- if (ret != amount)
+ if (retval != amount)
{
- PqGSSSendNext += ret;
+ PqGSSSendNext += retval;
continue;
}
PyObject *elem;
elem = PySequence_GetItem(args, j);
- PG_TRY();
+ PG_TRY(2);
{
bool isnull;
plan->values[j] = PLy_output_convert(arg, elem, &isnull);
nulls[j] = isnull ? 'n' : ' ';
}
- PG_FINALLY();
+ PG_FINALLY(2);
{
Py_DECREF(elem);
}
- PG_END_TRY();
+ PG_END_TRY(2);
}
portal = SPI_cursor_open(NULL, plan->plan, plan->values, nulls,
rv = NULL;
else if (pg_strcasecmp(srv, "MODIFY") == 0)
{
- TriggerData *tdata = (TriggerData *) fcinfo->context;
-
if (TRIGGER_FIRED_BY_INSERT(tdata->tg_event) ||
TRIGGER_FIRED_BY_UPDATE(tdata->tg_event))
rv = PLy_modify_tuple(proc, plargs, tdata, rv);
PyObject *elem;
elem = PySequence_GetItem(list, j);
- PG_TRY();
+ PG_TRY(2);
{
bool isnull;
plan->values[j] = PLy_output_convert(arg, elem, &isnull);
nulls[j] = isnull ? 'n' : ' ';
}
- PG_FINALLY();
+ PG_FINALLY(2);
{
Py_DECREF(elem);
}
- PG_END_TRY();
+ PG_END_TRY(2);
}
rv = SPI_execute_plan(plan->plan, plan->values, nulls,
*/
for (int i = 0; i < num_values; i++)
{
- uint64 x = values[i];
+ uint64 y = values[i];
bool expected;
bool result;
- if (x > 0)
+ if (y > 0)
{
- expected = (values[i - 1] == x - 1);
- result = intset_is_member(intset, x - 1);
+ expected = (values[i - 1] == y - 1);
+ result = intset_is_member(intset, y - 1);
if (result != expected)
- elog(ERROR, "intset_is_member failed for " UINT64_FORMAT, x - 1);
+ elog(ERROR, "intset_is_member failed for " UINT64_FORMAT, y - 1);
}
- result = intset_is_member(intset, x);
+ result = intset_is_member(intset, y);
if (result != true)
- elog(ERROR, "intset_is_member failed for " UINT64_FORMAT, x);
+ elog(ERROR, "intset_is_member failed for " UINT64_FORMAT, y);
- expected = (i != num_values - 1) ? (values[i + 1] == x + 1) : false;
- result = intset_is_member(intset, x + 1);
+ expected = (i != num_values - 1) ? (values[i + 1] == y + 1) : false;
+ result = intset_is_member(intset, y + 1);
if (result != expected)
- elog(ERROR, "intset_is_member failed for " UINT64_FORMAT, x + 1);
+ elog(ERROR, "intset_is_member failed for " UINT64_FORMAT, y + 1);
}
/*