Skip to content

Commit 1c9a125

Browse files
committed
OR processing cleanup.
1 parent f26e1d3 commit 1c9a125

File tree

2 files changed

+532
-528
lines changed

2 files changed

+532
-528
lines changed

src/backend/executor/nodeIndexscan.c

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.22 1998/08/03 19:41:29 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.23 1998/08/04 18:42:38 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -269,33 +269,36 @@ ExecIndexReScan(IndexScan *node, ExprContext *exprCtxt, Plan *parent)
269269
{
270270
qual = nth(i, indxqual);
271271
n_keys = numScanKeys[i];
272-
run_keys = (int *) runtimeKeyInfo[i];
273272
scan_keys = (ScanKey) scanKeys[i];
274-
275-
for (j = 0; j < n_keys; j++)
273+
274+
if (runtimeKeyInfo)
276275
{
277-
/*
278-
* If we have a run-time key, then extract the run-time
279-
* expression and evaluate it with respect to the current
280-
* outer tuple. We then stick the result into the scan key.
281-
*/
282-
if (run_keys[j] != NO_OP)
276+
run_keys = (int *) runtimeKeyInfo[i];
277+
for (j = 0; j < n_keys; j++)
283278
{
284-
clause = nth(j, qual);
285-
scanexpr = (run_keys[j] == RIGHT_OP) ?
286-
(Node *) get_rightop(clause) : (Node *) get_leftop(clause);
287-
288279
/*
289-
* pass in isDone but ignore it. We don't iterate in
290-
* quals
280+
* If we have a run-time key, then extract the run-time
281+
* expression and evaluate it with respect to the current
282+
* outer tuple. We then stick the result into the scan key.
291283
*/
292-
scanvalue = (Datum)
293-
ExecEvalExpr(scanexpr, exprCtxt, &isNull, &isDone);
294-
scan_keys[j].sk_argument = scanvalue;
295-
if (isNull)
296-
scan_keys[j].sk_flags |= SK_ISNULL;
297-
else
298-
scan_keys[j].sk_flags &= ~SK_ISNULL;
284+
if (run_keys[j] != NO_OP)
285+
{
286+
clause = nth(j, qual);
287+
scanexpr = (run_keys[j] == RIGHT_OP) ?
288+
(Node *) get_rightop(clause) : (Node *) get_leftop(clause);
289+
290+
/*
291+
* pass in isDone but ignore it. We don't iterate in
292+
* quals
293+
*/
294+
scanvalue = (Datum)
295+
ExecEvalExpr(scanexpr, exprCtxt, &isNull, &isDone);
296+
scan_keys[j].sk_argument = scanvalue;
297+
if (isNull)
298+
scan_keys[j].sk_flags |= SK_ISNULL;
299+
else
300+
scan_keys[j].sk_flags &= ~SK_ISNULL;
301+
}
299302
}
300303
}
301304
sdesc = scanDescs[i];

0 commit comments

Comments
 (0)