From ef08061a6d8f01e7db350b74eaa2d403df6079b9 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Fri, 1 Dec 2023 11:45:50 +0100 Subject: [PATCH v1 1/3] Remove custom _jumbleRangeTblEntry() --- src/backend/nodes/queryjumblefuncs.c | 48 ---------------------------- src/include/nodes/parsenodes.h | 42 ++++++++++++------------ 2 files changed, 21 insertions(+), 69 deletions(-) diff --git a/src/backend/nodes/queryjumblefuncs.c b/src/backend/nodes/queryjumblefuncs.c index 281907a4d8..9094ea02d8 100644 --- a/src/backend/nodes/queryjumblefuncs.c +++ b/src/backend/nodes/queryjumblefuncs.c @@ -347,51 +347,3 @@ _jumbleA_Const(JumbleState *jstate, Node *node) } } } - -static void -_jumbleRangeTblEntry(JumbleState *jstate, Node *node) -{ - RangeTblEntry *expr = (RangeTblEntry *) node; - - JUMBLE_FIELD(rtekind); - switch (expr->rtekind) - { - case RTE_RELATION: - JUMBLE_FIELD(relid); - JUMBLE_NODE(tablesample); - JUMBLE_FIELD(inh); - break; - case RTE_SUBQUERY: - JUMBLE_NODE(subquery); - break; - case RTE_JOIN: - JUMBLE_FIELD(jointype); - break; - case RTE_FUNCTION: - JUMBLE_NODE(functions); - break; - case RTE_TABLEFUNC: - JUMBLE_NODE(tablefunc); - break; - case RTE_VALUES: - JUMBLE_NODE(values_lists); - break; - case RTE_CTE: - - /* - * Depending on the CTE name here isn't ideal, but it's the only - * info we have to identify the referenced WITH item. - */ - JUMBLE_STRING(ctename); - JUMBLE_FIELD(ctelevelsup); - break; - case RTE_NAMEDTUPLESTORE: - JUMBLE_STRING(enrname); - break; - case RTE_RESULT: - break; - default: - elog(ERROR, "unrecognized RTE kind: %d", (int) expr->rtekind); - break; - } -} diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index e494309da8..a97f3cb16f 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -1018,7 +1018,7 @@ typedef enum RTEKind typedef struct RangeTblEntry { - pg_node_attr(custom_read_write, custom_query_jumble) + pg_node_attr(custom_read_write) NodeTag type; @@ -1062,16 +1062,16 @@ typedef struct RangeTblEntry * tables to be invalidated if the underlying table is altered. */ Oid relid; /* OID of the relation */ - char relkind; /* relation kind (see pg_class.relkind) */ - int rellockmode; /* lock level that query requires on the rel */ + char relkind pg_node_attr(query_jumble_ignore); /* relation kind (see pg_class.relkind) */ + int rellockmode pg_node_attr(query_jumble_ignore); /* lock level that query requires on the rel */ struct TableSampleClause *tablesample; /* sampling info, or NULL */ - Index perminfoindex; + Index perminfoindex pg_node_attr(query_jumble_ignore); /* * Fields valid for a subquery RTE (else NULL): */ Query *subquery; /* the sub-query */ - bool security_barrier; /* is from security_barrier view? */ + bool security_barrier pg_node_attr(query_jumble_ignore); /* is from security_barrier view? */ /* * Fields valid for a join RTE (else NULL/zero): @@ -1117,17 +1117,17 @@ typedef struct RangeTblEntry * joinleftcols/joinrighttcols. */ JoinType jointype; /* type of join */ - int joinmergedcols; /* number of merged (JOIN USING) columns */ - List *joinaliasvars; /* list of alias-var expansions */ - List *joinleftcols; /* left-side input column numbers */ - List *joinrightcols; /* right-side input column numbers */ + int joinmergedcols pg_node_attr(query_jumble_ignore); /* number of merged (JOIN USING) columns */ + List *joinaliasvars pg_node_attr(query_jumble_ignore); /* list of alias-var expansions */ + List *joinleftcols pg_node_attr(query_jumble_ignore); /* left-side input column numbers */ + List *joinrightcols pg_node_attr(query_jumble_ignore); /* right-side input column numbers */ /* * join_using_alias is an alias clause attached directly to JOIN/USING. It * is different from the alias field (below) in that it does not hide the * range variables of the tables being joined. */ - Alias *join_using_alias; + Alias *join_using_alias pg_node_attr(query_jumble_ignore); /* * Fields valid for a function RTE (else NIL/zero): @@ -1138,7 +1138,7 @@ typedef struct RangeTblEntry * expandRTE(). */ List *functions; /* list of RangeTblFunction nodes */ - bool funcordinality; /* is this called WITH ORDINALITY? */ + bool funcordinality pg_node_attr(query_jumble_ignore); /* is this called WITH ORDINALITY? */ /* * Fields valid for a TableFunc RTE (else NULL): @@ -1155,7 +1155,7 @@ typedef struct RangeTblEntry */ char *ctename; /* name of the WITH list item */ Index ctelevelsup; /* number of query levels up */ - bool self_reference; /* is this a recursive self-reference? */ + bool self_reference pg_node_attr(query_jumble_ignore); /* is this a recursive self-reference? */ /* * Fields valid for CTE, VALUES, ENR, and TableFunc RTEs (else NIL): @@ -1175,25 +1175,25 @@ typedef struct RangeTblEntry * all three lists (as well as an empty-string entry in eref). Testing * for zero coltype is the standard way to detect a dropped column. */ - List *coltypes; /* OID list of column type OIDs */ - List *coltypmods; /* integer list of column typmods */ - List *colcollations; /* OID list of column collation OIDs */ + List *coltypes pg_node_attr(query_jumble_ignore); /* OID list of column type OIDs */ + List *coltypmods pg_node_attr(query_jumble_ignore); /* integer list of column typmods */ + List *colcollations pg_node_attr(query_jumble_ignore); /* OID list of column collation OIDs */ /* * Fields valid for ENR RTEs (else NULL/zero): */ char *enrname; /* name of ephemeral named relation */ - Cardinality enrtuples; /* estimated or actual from caller */ + Cardinality enrtuples pg_node_attr(query_jumble_ignore); /* estimated or actual from caller */ /* * Fields valid in all RTEs: */ - Alias *alias; /* user-written alias clause, if any */ - Alias *eref; /* expanded reference names */ - bool lateral; /* subquery, function, or values is LATERAL? */ + Alias *alias pg_node_attr(query_jumble_ignore); /* user-written alias clause, if any */ + Alias *eref pg_node_attr(query_jumble_ignore); /* expanded reference names */ + bool lateral pg_node_attr(query_jumble_ignore); /* subquery, function, or values is LATERAL? */ bool inh; /* inheritance requested? */ - bool inFromCl; /* present in FROM clause? */ - List *securityQuals; /* security barrier quals to apply, if any */ + bool inFromCl pg_node_attr(query_jumble_ignore); /* present in FROM clause? */ + List *securityQuals pg_node_attr(query_jumble_ignore); /* security barrier quals to apply, if any */ } RangeTblEntry; /* -- 2.43.0