ExecRestrPos() really needs to raise ERROR, not a wimpy DEBUG message,
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 25 Jul 2000 23:43:38 +0000 (23:43 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 25 Jul 2000 23:43:38 +0000 (23:43 +0000)
if given a node type it doesn't support.  As is, wrong results from a
mergejoin would go undetected.

src/backend/executor/execAmi.c

index 6acae1b80e80d81fb867e33d58cc821347351a44..0741de5ef9be325ad0857b0617979b83dd0d8508 100644 (file)
@@ -356,7 +356,8 @@ ExecReScan(Plan *node, ExprContext *exprCtxt, Plan *parent)
                        break;
 
                default:
-                       elog(ERROR, "ExecReScan: node type %u not supported", nodeTag(node));
+                       elog(ERROR, "ExecReScan: node type %d not supported",
+                                nodeTag(node));
                        return;
        }
 
@@ -393,7 +394,8 @@ ExecReScanR(Relation relDesc,       /* LLL relDesc unused  */
  *
  *             Marks the current scan position.
  *
- *             XXX Needs to be extended to include all the node types.
+ *             XXX Needs to be extended to include all the node types,
+ *             or at least all the ones that can be directly below a mergejoin.
  * ----------------------------------------------------------------
  */
 void
@@ -422,16 +424,20 @@ ExecMarkPos(Plan *node)
                        break;
 
                default:
-                       elog(DEBUG, "ExecMarkPos: node type %u not supported", nodeTag(node));
+                       /* don't make hard error unless caller asks to restore... */
+                       elog(DEBUG, "ExecMarkPos: node type %d not supported",
+                                nodeTag(node));
                        break;
        }
-       return;
 }
 
 /* ----------------------------------------------------------------
  *             ExecRestrPos
  *
  *             restores the scan position previously saved with ExecMarkPos()
+ *
+ *             XXX Needs to be extended to include all the node types,
+ *             or at least all the ones that can be directly below a mergejoin.
  * ----------------------------------------------------------------
  */
 void
@@ -441,22 +447,23 @@ ExecRestrPos(Plan *node)
        {
                case T_SeqScan:
                        ExecSeqRestrPos((SeqScan *) node);
-                       return;
+                       break;
 
                case T_IndexScan:
                        ExecIndexRestrPos((IndexScan *) node);
-                       return;
+                       break;
 
                case T_Material:
                        ExecMaterialRestrPos((Material *) node);
-                       return;
+                       break;
 
                case T_Sort:
                        ExecSortRestrPos((Sort *) node);
-                       return;
+                       break;
 
                default:
-                       elog(DEBUG, "ExecRestrPos: node type %u not supported", nodeTag(node));
-                       return;
+                       elog(ERROR, "ExecRestrPos: node type %d not supported",
+                                nodeTag(node));
+                       break;
        }
 }