uint32 ovflbitno;
int32 bitmappage,
bitmapbit;
- Bucket bucket;
+ Bucket bucket PG_USED_FOR_ASSERTS_ONLY;
/* Get information from the doomed page */
_hash_checkpage(rel, ovflbuf, LH_OVERFLOW_PAGE);
{
ScanState *scanstate;
bool lisnull;
- Oid tuple_tableoid;
+ Oid tuple_tableoid PG_USED_FOR_ASSERTS_ONLY;
ItemPointer tuple_tid;
/*
* Allocate a second read pointer to serve as the mark. We know it
* must have index 1, so needn't store that.
*/
- int ptrno;
+ int ptrno PG_USED_FOR_ASSERTS_ONLY;
ptrno = tuplestore_alloc_read_pointer(tuplestorestate,
node->eflags);
SetOp *node = (SetOp *) setopstate->ps.plan;
PlanState *outerPlan;
int firstFlag;
- bool in_first_rel;
+ bool in_first_rel PG_USED_FOR_ASSERTS_ONLY;
/*
* get state info from node
WorkTableScanNext(WorkTableScanState *node)
{
TupleTableSlot *slot;
- EState *estate;
Tuplestorestate *tuplestorestate;
/*
* worktable. Therefore, we don't need a private read pointer for the
* tuplestore, nor do we need to tell tuplestore_gettupleslot to copy.
*/
- estate = node->ss.ps.state;
- Assert(ScanDirectionIsForward(estate->es_direction));
+ Assert(ScanDirectionIsForward(node->ss.ps.state->es_direction));
tuplestorestate = node->rustate->working_table;
{
File fd;
int nbytes,
- tmp;
+ tmp PG_USED_FOR_ASSERTS_ONLY;
char buf[BUFSIZE];
char fnamebuf[MAXPGPATH];
LargeObjectDesc *lobj;
void
pq_putmessage_noblock(char msgtype, const char *s, size_t len)
{
- int res;
+ int res PG_USED_FOR_ASSERTS_ONLY;
int required;
/*
set_subquery_size_estimates(PlannerInfo *root, RelOptInfo *rel)
{
PlannerInfo *subroot = rel->subroot;
- RangeTblEntry *rte;
+ RangeTblEntry *rte PG_USED_FOR_ASSERTS_ONLY;
ListCell *lc;
/* Should only be applied to base relations that are subqueries */
/* Process leaf SELECT */
Query *selectQuery;
char selectName[32];
- RangeTblEntry *rte;
+ RangeTblEntry *rte PG_USED_FOR_ASSERTS_ONLY;
RangeTblRef *rtr;
ListCell *tl;
/* seek to the right position */
if (vfdP->seekPos != (off_t) 0)
{
- off_t returnValue;
+ off_t returnValue PG_USED_FOR_ASSERTS_ONLY;
returnValue = lseek(vfdP->fd, vfdP->seekPos, SEEK_SET);
Assert(returnValue != (off_t) -1);
static void
RemoveTargetIfNoLongerUsed(PREDICATELOCKTARGET *target, uint32 targettaghash)
{
- PREDICATELOCKTARGET *rmtarget;
+ PREDICATELOCKTARGET *rmtarget PG_USED_FOR_ASSERTS_ONLY;
Assert(LWLockHeldByMe(SerializablePredicateLockListLock));
{
uint32 oldtargettaghash;
LWLockId partitionLock;
- PREDICATELOCK *rmpredlock;
+ PREDICATELOCK *rmpredlock PG_USED_FOR_ASSERTS_ONLY;
oldtargettaghash = PredicateLockTargetTagHashCode(&oldtargettag);
partitionLock = PredicateLockHashPartitionLock(oldtargettaghash);
{
uint32 targettaghash;
LOCALPREDICATELOCK *parentlock,
- *rmlock;
+ *rmlock PG_USED_FOR_ASSERTS_ONLY;
parenttag = nexttag;
targettaghash = PredicateLockTargetTagHashCode(&parenttag);
AuxiliaryProcKill(int code, Datum arg)
{
int proctype = DatumGetInt32(arg);
- PGPROC *auxproc;
+ PGPROC *auxproc PG_USED_FOR_ASSERTS_ONLY;
Assert(proctype >= 0 && proctype < NUM_AUXILIARY_PROCS);
{
char *xfrmstr;
size_t xfrmlen;
- size_t xfrmlen2;
+ size_t xfrmlen2 PG_USED_FOR_ASSERTS_ONLY;
/*
* Note: originally we guessed at a suitable output buffer size, and
RestrictInfo *rinfo = (RestrictInfo *) lfirst(lcc);
Expr *clause;
Node *leftop,
- *rightop;
+ *rightop PG_USED_FOR_ASSERTS_ONLY;
Oid clause_op;
int op_strategy;
bool is_null_op = false;
bool semicolon)
{
PQExpBufferData mybuf;
- int lexresult;
+ int lexresult PG_USED_FOR_ASSERTS_ONLY;
char local_quote;
/* Must be scanning already */
#define STATUS_WAITING (2)
+/*
+ * Append PG_USED_FOR_ASSERTS_ONLY to definitions of variables that are only
+ * used in assert-enabled builds, to avoid compiler warnings about unused
+ * variables in assert-disabled builds.
+ */
+#ifdef USE_ASSERT_CHECKING
+#define PG_USED_FOR_ASSERTS_ONLY
+#else
+#define PG_USED_FOR_ASSERTS_ONLY __attribute__((unused))
+#endif
+
+
/* gettext domain name mangling */
/*