pgsql: Improve pqexpbuffer.c to use modern vsnprintf implementations ef

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Improve pqexpbuffer.c to use modern vsnprintf implementations ef
Дата
Msg-id E1VZp9P-0000YI-Do@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Improve pqexpbuffer.c to use modern vsnprintf implementations efficiently.

When using a C99-compliant vsnprintf, we can use its report of the required
buffer size to avoid making multiple loops through the formatting logic.
This is similar to the changes recently made in stringinfo.c, but we can't
use psprintf.c here because in libpq we don't want to exit() on error.
(The behavior pqexpbuffer.c has historically used is to mark the
PQExpBuffer as "broken", ie empty, if it runs into any fatal problem.)

To avoid duplicating code more than necessary, I refactored
printfPQExpBuffer and appendPQExpBuffer to share a subroutine that's
very similar to psprintf.c's pvsnprintf in spirit.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/9f9d9b51f068a19ad243fd8fe500c9970999db9b

Modified Files
--------------
src/interfaces/libpq/pqexpbuffer.c |  165 ++++++++++++++++++++++++------------
1 file changed, 110 insertions(+), 55 deletions(-)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Revert "Tweak "line" test to avoid negative zeros on some platfo
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Use unaligned output in selected regression queries to reduce di