Skip to content

Commit c50886f

Browse files
committed
fix gid send/recv
1 parent b07de08 commit c50886f

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

contrib/pglogical_output/pglogical_proto_json.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,17 +93,17 @@ pglogical_json_write_commit(StringInfo out, PGLogicalOutputData *data, ReorderBu
9393
if (txn->xact_action == XLOG_XACT_PREPARE)
9494
{
9595
appendStringInfoString(out, "\"action\":\"P\"");
96-
appendStringInfo(out, ", \"gid\":\"%s\"", txn->gid); /* NB: Add \0 at the end, if we are using all 200 bytes in GID */
96+
appendStringInfo(out, ", \"gid\":\"%s\"", txn->gid);
9797
}
9898
else if (txn->xact_action == XLOG_XACT_COMMIT_PREPARED)
9999
{
100100
appendStringInfoString(out, "\"action\":\"CP\"");
101-
appendStringInfo(out, ", \"gid\":\"%s\"", txn->gid); /* NB: Add \0 at the end, if we are using all 200 bytes in GID */
101+
appendStringInfo(out, ", \"gid\":\"%s\"", txn->gid);
102102
}
103103
else if (txn->xact_action == XLOG_XACT_ABORT_PREPARED)
104104
{
105105
appendStringInfoString(out, "\"action\":\"AP\"");
106-
appendStringInfo(out, ", \"gid\":\"%s\"", txn->gid); /* NB: Add \0 at the end, if we are using all 200 bytes in GID */
106+
appendStringInfo(out, ", \"gid\":\"%s\"", txn->gid);
107107
}
108108
else if (txn->xact_action == XLOG_XACT_COMMIT)
109109
{

contrib/pglogical_output/pglogical_proto_native.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,10 @@ pglogical_write_commit(StringInfo out, PGLogicalOutputData *data,
216216
pq_sendint64(out, txn->end_lsn);
217217
pq_sendint64(out, txn->commit_time);
218218

219-
// send that as a cstring, instead of fixlen
220-
if (txn->xact_action == XLOG_XACT_PREPARE ||
219+
if (txn->xact_action == XLOG_XACT_PREPARE ||
221220
txn->xact_action == XLOG_XACT_COMMIT_PREPARED ||
222221
txn->xact_action == XLOG_XACT_ABORT_PREPARED)
223-
pq_sendbytes(out, txn->gid, GIDSIZE);
222+
pq_sendstring(out, txn->gid);
224223
}
225224

226225
/*

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy