Skip to content

Commit 0e06e68

Browse files
committed
ExecRestrPos() really needs to raise ERROR, not a wimpy DEBUG message,
if given a node type it doesn't support. As is, wrong results from a mergejoin would go undetected.
1 parent 742cd87 commit 0e06e68

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

src/backend/executor/execAmi.c

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: execAmi.c,v 1.49 2000/07/12 02:37:00 tgl Exp $
9+
* $Id: execAmi.c,v 1.50 2000/07/25 23:43:38 tgl Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -356,7 +356,8 @@ ExecReScan(Plan *node, ExprContext *exprCtxt, Plan *parent)
356356
break;
357357

358358
default:
359-
elog(ERROR, "ExecReScan: node type %u not supported", nodeTag(node));
359+
elog(ERROR, "ExecReScan: node type %d not supported",
360+
nodeTag(node));
360361
return;
361362
}
362363

@@ -393,7 +394,8 @@ ExecReScanR(Relation relDesc, /* LLL relDesc unused */
393394
*
394395
* Marks the current scan position.
395396
*
396-
* XXX Needs to be extended to include all the node types.
397+
* XXX Needs to be extended to include all the node types,
398+
* or at least all the ones that can be directly below a mergejoin.
397399
* ----------------------------------------------------------------
398400
*/
399401
void
@@ -422,16 +424,20 @@ ExecMarkPos(Plan *node)
422424
break;
423425

424426
default:
425-
elog(DEBUG, "ExecMarkPos: node type %u not supported", nodeTag(node));
427+
/* don't make hard error unless caller asks to restore... */
428+
elog(DEBUG, "ExecMarkPos: node type %d not supported",
429+
nodeTag(node));
426430
break;
427431
}
428-
return;
429432
}
430433

431434
/* ----------------------------------------------------------------
432435
* ExecRestrPos
433436
*
434437
* restores the scan position previously saved with ExecMarkPos()
438+
*
439+
* XXX Needs to be extended to include all the node types,
440+
* or at least all the ones that can be directly below a mergejoin.
435441
* ----------------------------------------------------------------
436442
*/
437443
void
@@ -441,22 +447,23 @@ ExecRestrPos(Plan *node)
441447
{
442448
case T_SeqScan:
443449
ExecSeqRestrPos((SeqScan *) node);
444-
return;
450+
break;
445451

446452
case T_IndexScan:
447453
ExecIndexRestrPos((IndexScan *) node);
448-
return;
454+
break;
449455

450456
case T_Material:
451457
ExecMaterialRestrPos((Material *) node);
452-
return;
458+
break;
453459

454460
case T_Sort:
455461
ExecSortRestrPos((Sort *) node);
456-
return;
462+
break;
457463

458464
default:
459-
elog(DEBUG, "ExecRestrPos: node type %u not supported", nodeTag(node));
460-
return;
465+
elog(ERROR, "ExecRestrPos: node type %d not supported",
466+
nodeTag(node));
467+
break;
461468
}
462469
}

0 commit comments

Comments
 (0)