Re: BUG: Protocol 3.0 ErrorResponse: Last 'null' characterseems odd

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG: Protocol 3.0 ErrorResponse: Last 'null' characterseems odd
Дата
Msg-id 8810.1208360077@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG: Protocol 3.0 ErrorResponse: Last 'null' characterseems odd  (<Eugen.Konkov@aldec.com>)
Список pgsql-bugs
<Eugen.Konkov@aldec.com> writes:
>> It's part of the protocol, actually (yes, two NUL bytes -- first one
>> signals the end of the previous string, the second one signals the end
>> of the packet).

> The end of the packet can be obtained by packet length

It's designed that way intentionally to aid in error detection.  Parsing
the packet following its internal structure should end up exactly at the
end of the packet according to the length word.  Otherwise something's
corrupted.

There are some backwards-compatibility considerations here too (the
internal structure matches pre-V3 protocol which had no length word).
But it's a perfectly fine definition and we have absolutely no intention
of "fixing" it.

            regards, tom lane

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: BUG #4109: Typo in documentation
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG: Protocol 3.0: that's just odd, needing to add the number of bytes the length field occupies