Re: BUG #19547: libpqrcv_create_slot dereferences NULL on a malformed CREATE_REPLICATION_SLOT reply
От
Fujii Masao
Тема
Re: BUG #19547: libpqrcv_create_slot dereferences NULL on a malformed CREATE_REPLICATION_SLOT reply
Дата
Msg-id
CAHGQGwHJQ5f+yRT-E=20b1UaukLN4Sy=rdEFBvrdZhPtxpTP9w@mail.gmail.com
Ответ на
Re: BUG #19547: libpqrcv_create_slot dereferences NULL on a malformed CREATE_REPLICATION_SLOT reply (Kenny Chen)
Список
Дерево обсуждения
Re: BUG #19547: libpqrcv_create_slot dereferences NULL on a malformed CREATE_REPLICATION_SLOT reply Kenny Chen <kennychen851228@gmail.com>
RE: BUG #19547: libpqrcv_create_slot dereferences NULL on a malformed CREATE_REPLICATION_SLOT reply "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
Re: BUG #19547: libpqrcv_create_slot dereferences NULL on a malformed CREATE_REPLICATION_SLOT reply Kenny Chen <kennychen851228@gmail.com>
Re: BUG #19547: libpqrcv_create_slot dereferences NULL on a malformed CREATE_REPLICATION_SLOT reply Fujii Masao <masao.fujii@gmail.com>
Re: BUG #19547: libpqrcv_create_slot dereferences NULL on a malformed CREATE_REPLICATION_SLOT reply Kenny Chen <kennychen851228@gmail.com>
RE: BUG #19547: libpqrcv_create_slot dereferences NULL on a malformed CREATE_REPLICATION_SLOT reply "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
Re: BUG #19547: libpqrcv_create_slot dereferences NULL on a malformed CREATE_REPLICATION_SLOT reply Fujii Masao <masao.fujii@gmail.com>
RE: BUG #19547: libpqrcv_create_slot dereferences NULL on a malformed CREATE_REPLICATION_SLOT reply "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
Re: BUG #19547: libpqrcv_create_slot dereferences NULL on a malformed CREATE_REPLICATION_SLOT reply Kenny Chen <kennychen851228@gmail.com>
On Wed, Jul 15, 2026 at 8:51 PM Kenny Chen wrote:
> Agreed. IDENTIFY_SYSTEM tolerates 3 columns only because older servers (9.3
> and earlier) actually returned 3, whereas CREATE_REPLICATION_SLOT has always
> returned 4, so there is no reason to be lenient here. v2 attached requires 4
> fields, and updates the comment and errdetail accordingly.
Agreed. So,
+ if (PQnfields(res) < 4 || PQntuples(res) != 1)
+ ereport(ERROR,
+ (errcode(ERRCODE_PROTOCOL_VIOLATION),
+ errmsg("invalid response from primary server"),
+ errdetail("Could not create
replication slot \"%s\": got %d rows and %d fields, expected %d rows
and %d or more fields.",
+ slotname,
PQntuples(res), PQnfields(res), 1, 4)));
"PQnfields(res) < 4" should be "PQnfields(res) != 4"?
If so, "or more" in the detail message should be removed as well.
Regards,
--
Fujii Masao
В списке pgsql-bugs по дате отправления
От: Kenny Chen
Дата: