[HACKERS] A suspicious code in pgoutput_startup().

Поиск
Список
Период
Сортировка
От Yugo Nagata
Тема [HACKERS] A suspicious code in pgoutput_startup().
Дата
Msg-id 20170728095206.bf82da64.nagata@sraoss.co.jp
обсуждение исходный текст
Ответы Re: [HACKERS] A suspicious code in pgoutput_startup().  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Список pgsql-hackers
Hi,

I found a suspicious code in pgoutput_startup().

175         /* Check if we support requested protocol */
176         if (data->protocol_version != LOGICALREP_PROTO_VERSION_NUM)
177             ereport(ERROR,
178                     (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
179                      errmsg("client sent proto_version=%d but we only support protocol %d or lower",
180                             data->protocol_version, LOGICALREP_PROTO_VERSION_NUM)));

Although the if condition is not-equal, the error message says 
"we only support protocol %d or lower".  Is this intentional?
Or should this be fixed as below? 

176         if (data->protocol_version > LOGICALREP_PROTO_VERSION_NUM)

Attached is a simple patch in case of fixing.

Regards,

-- 
Yugo Nagata <nagata@sraoss.co.jp>

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Вложения

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

Предыдущее
От: Yugo Nagata
Дата:
Сообщение: [HACKERS] Notice message of ALTER SUBSCRIPTION ... RERESH PUBLICATIION
Следующее
От: Robert Haas
Дата:
Сообщение: Re: LP_DEAD hinting and not holding on to a buffer pin on leaf page(Was: [HACKERS] [WIP] Zipfian distribution in pgbench)