postgres.git / summary / log / commit / refs

commit    b4f79d278f2a78a65ff020b4e8cfa46a2587091d
Author:   Tom Lane <tgl@sss.pgh.pa.us>
Date:     Sat Jul 09 17:35:37 2022 +0000
First released in: 16.0

    Mark PlanState as an abstract node type.
    
    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 | 2 ++ src/include/nodes/memnodes.h | 2 ++ src/test/modules/test_oat_hooks/test_oat_hooks.c | 3 --- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h index 17c42d4a88a..967604b8a50 100644 --- a/src/include/nodes/execnodes.h +++ b/src/include/nodes/execnodes.h @@ -999,6 +999,8 @@ typedef TupleTableSlot *(*ExecProcNodeMtd) (struct PlanState *pstate); */ typedef struct PlanState { + pg_node_attr(abstract) + NodeTag type; Plan *plan; /* associated Plan node */ diff --git a/src/include/nodes/memnodes.h b/src/include/nodes/memnodes.h index bbbe151e397..16cd56da6db 100644 --- a/src/include/nodes/memnodes.h +++ b/src/include/nodes/memnodes.h @@ -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 */ diff --git a/src/test/modules/test_oat_hooks/test_oat_hooks.c b/src/test/modules/test_oat_hooks/test_oat_hooks.c index b648ee67ff4..c9869b21fde 100644 --- a/src/test/modules/test_oat_hooks/test_oat_hooks.c +++ b/src/test/modules/test_oat_hooks/test_oat_hooks.c @@ -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; [parent: 2be87f092a2a]