|
7 | 7 | *
|
8 | 8 | *
|
9 | 9 | * 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 $ |
11 | 11 | *
|
12 | 12 | *-------------------------------------------------------------------------
|
13 | 13 | */
|
@@ -269,33 +269,36 @@ ExecIndexReScan(IndexScan *node, ExprContext *exprCtxt, Plan *parent)
|
269 | 269 | {
|
270 | 270 | qual = nth(i, indxqual);
|
271 | 271 | n_keys = numScanKeys[i];
|
272 |
| - run_keys = (int *) runtimeKeyInfo[i]; |
273 | 272 | scan_keys = (ScanKey) scanKeys[i];
|
274 |
| - |
275 |
| - for (j = 0; j < n_keys; j++) |
| 273 | + |
| 274 | + if (runtimeKeyInfo) |
276 | 275 | {
|
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++) |
283 | 278 | {
|
284 |
| - clause = nth(j, qual); |
285 |
| - scanexpr = (run_keys[j] == RIGHT_OP) ? |
286 |
| - (Node *) get_rightop(clause) : (Node *) get_leftop(clause); |
287 |
| - |
288 | 279 | /*
|
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. |
291 | 283 | */
|
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 | + } |
299 | 302 | }
|
300 | 303 | }
|
301 | 304 | sdesc = scanDescs[i];
|
|
0 commit comments