jrgemignani commented on code in PR #2592:
URL: https://github.com/apache/age/pull/2592#discussion_r4250960876
##########
src/backend/utils/adt/age_vle.c:
##########
@@ -639,6 +639,14 @@ static VLE_local_context
*build_local_vle_context(FunctionCallInfo fcinfo,
Oid graph_oid = InvalidOid;
int64 vle_grammar_node_id = 0;
bool use_cache = false;
+ ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo;
+ MemoryContext query_owner = NULL;
+
+ /* the graph context stays pinned for the rest of this query */
+ if (rsinfo != NULL && IsA(rsinfo, ReturnSetInfo) && rsinfo->econtext !=
NULL)
+ {
+ query_owner = rsinfo->econtext->ecxt_per_query_memory;
Review Comment:
Thanks. fcinfo->resultinfo is an fmNodePtr, which PostgreSQL defines as
struct Node *. The pointer cast does not dereference it, and the
short-circuit
condition checks for NULL before IsA reads the node tag. PostgreSQL core uses
the same cast-then-NULL/IsA pattern in set-returning functions. Reordering
the
cast would be stylistic and would not change safety, so no code change is
needed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]