Re: Wrong usage of pqMsg_Close message code?
Tatsuo Ishii <ishii@sraoss.co.jp>
From: Tatsuo Ishii <ishii@sraoss.co.jp>
To: pavel.stehule@gmail.com
Cc: aleksander@timescale.com, pgsql-hackers@lists.postgresql.org
Date: 2023-08-28T21:12:00Z
Lists: pgsql-hackers
>> Hi Pavel,
>>
>> > There is message PqMsgClose, but this should be used from client side.
>> Here should be used PqMsg_CommandComplete instead?
>>
>> It seems so. This change was introduced in f4b54e1ed98 [1]:
>>
>> ```
>> --- a/src/backend/tcop/dest.c
>> +++ b/src/backend/tcop/dest.c
>> @@ -176,7 +176,7 @@ EndCommand(const QueryCompletion *qc, CommandDest
>> dest, bool force_undecorated_o
>>
>> len = BuildQueryCompletionString(completionTag, qc,
>>
>> force_undecorated_output);
>> - pq_putmessage('C', completionTag, len + 1);
>> + pq_putmessage(PqMsg_Close, completionTag, len + 1);
>>
>> case DestNone:
>> case DestDebug
>> ```
>>
>> It should have been PqMsg_CommandComplete.
>>
>> [1]:
>> https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=f4b54e1ed98
>
>
> here is a patch - all tests passed
I think EndReplicationCommand needs to be fixed as well.
Best reagards,
--
Tatsuo Ishii
SRA OSS LLC
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp
Commits
-
Fix misuse of PqMsg_Close.
- 6475e663b3c6 17.0 landed