Fix misuse of PqMsg_Close.
authorNathan Bossart <nathan@postgresql.org>
Wed, 30 Aug 2023 01:32:38 +0000 (18:32 -0700)
committerNathan Bossart <nathan@postgresql.org>
Wed, 30 Aug 2023 01:32:38 +0000 (18:32 -0700)
EndCommand() and EndReplicationCommand() should use
PqMsg_CommandComplete instead.  Oversight in commit f4b54e1ed9.

Reported-by: Pavel Stehule, Tatsuo Ishii
Author: Pavel Stehule
Reviewed-by: Aleksander Alekseev, Michael Paquier
Discussion: https://postgr.es/m/CAFj8pRAMDCJXjnwiCkCB1yO1f7NPggFY8PwwAJDnugu-Z2G-Cg%40mail.gmail.com

src/backend/tcop/dest.c

index 06d1872b9acc4e341f31b6d065166d444e886963..bc8494ee7d42e955592bdb3c032cfd99a70af937 100644 (file)
@@ -176,7 +176,7 @@ EndCommand(const QueryCompletion *qc, CommandDest dest, bool force_undecorated_o
 
            len = BuildQueryCompletionString(completionTag, qc,
                                             force_undecorated_output);
-           pq_putmessage(PqMsg_Close, completionTag, len + 1);
+           pq_putmessage(PqMsg_CommandComplete, completionTag, len + 1);
 
        case DestNone:
        case DestDebug:
@@ -200,7 +200,7 @@ EndCommand(const QueryCompletion *qc, CommandDest dest, bool force_undecorated_o
 void
 EndReplicationCommand(const char *commandTag)
 {
-   pq_putmessage(PqMsg_Close, commandTag, strlen(commandTag) + 1);
+   pq_putmessage(PqMsg_CommandComplete, commandTag, strlen(commandTag) + 1);
 }
 
 /* ----------------