[PATCH] Refactor pqformat.{c,h} and protocol.h

Поиск
Список
Период
Сортировка
От Aleksander Alekseev
Тема [PATCH] Refactor pqformat.{c,h} and protocol.h
Дата
Msg-id CAJ7c6TNTd09AZq8tGaHS3LDyH_CCnpv0oOz2wN1dGe8zekxrdQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: [PATCH] Refactor pqformat.{c,h} and protocol.h
Re: [PATCH] Refactor pqformat.{c,h} and protocol.h
Список pgsql-hackers
Hi,

While investigating a bug report [1] I wanted to find all the pieces
of code that form PqMsg_DataRow messages and couldn't easily do it.
This is because one authors prefer writing:

pq_beginmessage(buf, 'D');

.. while others:

pq_beginmessage(buf, PqMsg_DataRow);

The proposed patchset fixes this.

- Patch 1 replaces all the char's with PqMsg's
- Patch 2 makes PqMsg an enum. This ensures that the problem will not
appear again in the future and also gives us a bit more type-safety.
- Patch 3 rearranges the order of the functions in pqformat.{c,h} a
bit to make the code easier to read.

[1]: https://www.postgresql.org/message-id/flat/1df84daa-7d0d-e8cc-4762-85523e45e5e7%40mailbox.org

-- 
Best regards,
Aleksander Alekseev

Вложения

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