avamingli commented on code in PR #990:
URL: https://github.com/apache/cloudberry/pull/990#discussion_r2032368256


##########
src/backend/cdb/dispatcher/cdbdisp_query.c:
##########
@@ -1676,3 +1681,104 @@ findParamType(List *params, int paramid)
 
        return InvalidOid;
 }
+
+/*
+ * process data in pointer cosume_p, ex: copy everything interested in.
+ * For EP_TAG_I, EP_TAG_U, EP_TAG_D, consume_p is a Bitmapset**, we just
+ * copy the content and process them later.
+ */
+void
+ConsumeExtendProtocolData(ExtendProtocolSubTag subtag, void *consume_p)
+{
+       Assert(epd);
+
+       if ((epd->consumed_bitmap & (1 << subtag)) == 0)
+               return;
+
+       switch (subtag)
+       {
+               case EP_TAG_I:
+               case EP_TAG_U:
+               case EP_TAG_D:
+                       Assert(consume_p != NULL);
+                       *((Bitmapset **) consume_p) = 
bms_copy(list_nth(epd->subtagdata, subtag));
+                       bms_free(list_nth(epd->subtagdata, subtag)); /* clean 
up */
+                       break;
+               default:
+                       Assert(false);
+       }
+
+       /* Mark subtag consumed. */
+       epd->consumed_bitmap &= ~(1 << subtag);
+}
+
+/*
+ * Contents must be allocated in TopTransactionMemoryContext.
+ */
+void InitExtendProtocolData(void)
+{
+       MemoryContext oldctx = MemoryContextSwitchTo(TopTransactionContext);

Review Comment:
   No such need, it makes no sense to make things complicated. 
   And json/jsonb is a database object, it's very stupid to make them embedding 
inside internal  codes.



-- 
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: commits-unsubscr...@cloudberry.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cloudberry.apache.org
For additional commands, e-mail: commits-h...@cloudberry.apache.org

Reply via email to