Make sure coordinator_lxid is formatted as %u and not %d
authorTomas Vondra <[email protected]>
Mon, 21 Aug 2017 08:47:13 +0000 (10:47 +0200)
committerTomas Vondra <[email protected]>
Mon, 21 Aug 2017 09:03:17 +0000 (11:03 +0200)
As the coordinator_lxid is uin32, so make sure we use %u to format it
(e.g. when sending it to remote nodes as string) and not just %d.

src/backend/pgxc/pool/execRemote.c

index 7ce5549521c7e8bac125d88031d6c3aac8b086bc..14067ee0af1dd0247d8e8a46e431c22fc2610560 100644 (file)
@@ -1943,7 +1943,7 @@ pgxc_node_begin(int conn_count, PGXCNodeHandle **connections,
                return EOF;
 
        /* Send virtualXID to the remote nodes using SET command */
-       sprintf(lxid, "%d", MyProc->lxid);
+       sprintf(lxid, "%u", MyProc->lxid);
        PGXCNodeSetParam(true, "coordinator_lxid", lxid, 0);
 
        /* after transactions are started send down local set commands */