Mark PlanState as an abstract node type.
authorTom Lane <[email protected]>
Sat, 9 Jul 2022 17:35:37 +0000 (13:35 -0400)
committerTom Lane <[email protected]>
Sat, 9 Jul 2022 17:35:37 +0000 (13:35 -0400)
In the same vein as commit 251154beb, make it clear that we never
instantiate PlanState.

Also mark MemoryContextData as abstract.  This has no effect right now,
since memnodes.h isn't one of the files fed to gen_node_support.pl.
But it seems like good documentation and future-proofing.

src/include/nodes/execnodes.h
src/include/nodes/memnodes.h
src/test/modules/test_oat_hooks/test_oat_hooks.c

index 17c42d4a88a158028d1350ddde88c5a96ed5905d..967604b8a50f460b9d6c9d951413cb5e19f85b75 100644 (file)
@@ -999,6 +999,8 @@ typedef TupleTableSlot *(*ExecProcNodeMtd) (struct PlanState *pstate);
  */
 typedef struct PlanState
 {
+   pg_node_attr(abstract)
+
    NodeTag     type;
 
    Plan       *plan;           /* associated Plan node */
index bbbe151e397bfdb47936e9edc10b12dbf02fc4e4..16cd56da6db570c624dae5e1aeec7fe946fa3c11 100644 (file)
@@ -77,6 +77,8 @@ typedef struct MemoryContextMethods
 
 typedef struct MemoryContextData
 {
+   pg_node_attr(abstract)      /* there are no nodes of this type */
+
    NodeTag     type;           /* identifies exact kind of context */
    /* these two fields are placed here to minimize alignment wastage: */
    bool        isReset;        /* T = no space alloced since last reset */
index b648ee67ff482aba3aceb4994d7d436e40f1f023..c9869b21fded3c68f0f15668028e93255e3be253 100644 (file)
@@ -618,9 +618,6 @@ nodetag_to_string(NodeTag tag)
        case T_PlanInvalItem:
            return "PlanInvalItem";
            break;
-       case T_PlanState:
-           return "PlanState";
-           break;
        case T_ResultState:
            return "ResultState";
            break;