MCPcopy Create free account
hub / github.com/apache/cloudberry / send_subtag

Function send_subtag

src/backend/executor/nodeModifyTable.c:3869–3902  ·  view source on GitHub ↗

* send_subtag * Send the data of subtag, the format is: * subtag + length + data * while length is the length of data followed. */

Source from the content-addressed store, hash-verified

3867 * while length is the length of data followed.
3868 */
3869static void
3870send_subtag(StringInfoData *buf, ExtendProtocolSubTag subtag, List *relids)
3871{
3872 bytea *res;
3873 int rlen;
3874 char *ptr;
3875 int rcount;
3876 Oid relid;
3877 ListCell *lc;
3878
3879 pq_sendint32(buf, subtag); /* subtag */
3880
3881 rcount = list_length(relids);
3882 rlen = sizeof(int)/* count of relids */ + sizeof(Oid) * rcount;
3883
3884 pq_sendint32(buf, rlen); /* length */
3885
3886 res = palloc(rlen + VARHDRSZ);
3887 ptr = VARDATA(res);
3888
3889 memcpy(ptr, &rcount, sizeof(int));
3890 ptr += sizeof(int);
3891
3892 foreach(lc, relids)
3893 {
3894 relid = lfirst_oid(lc);
3895 memcpy(ptr, &relid, sizeof(Oid));
3896 ptr += sizeof(Oid);
3897 }
3898
3899 SET_VARSIZE(res, rlen + VARHDRSZ);
3900
3901 pq_sendbytes(buf, VARDATA(res), VARSIZE(res) - VARHDRSZ);
3902}
3903
3904/*
3905 * notify_modified_relations_local

Callers 1

Calls 5

pq_sendint32Function · 0.85
list_lengthFunction · 0.85
pq_sendbytesFunction · 0.85
pallocFunction · 0.50
foreachFunction · 0.50

Tested by

no test coverage detected