[HACKERS] Wrong variable type in KeepLogSeg

Поиск
Список
Период
Сортировка
Искать
От
Kyotaro HORIGUCHI
Тема
[HACKERS] Wrong variable type in KeepLogSeg
Дата
Msg-id
20170228.111721.252692910.horiguchi.kyotaro@lab.ntt.co.jp
Список
Дерево обсуждения
[HACKERS] Wrong variable type in KeepLogSeg Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
Re: [HACKERS] Wrong variable type in KeepLogSeg Michael Paquier <michael.paquier@gmail.com>
Re: [HACKERS] Wrong variable type in KeepLogSeg Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
Re: [HACKERS] Wrong variable type in KeepLogSeg Magnus Hagander <magnus@hagander.net>
Re: [HACKERS] Wrong variable type in KeepLogSeg Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
Hello, I found a variable definition with wrong type
specification in KeepLogSeg, which doesn't harm anything.

> static void
> KeepLogSeg(XLogRecPtr recptr, XLogSegNo *logSegNo)
> {
> ...
>     /* then check whether slots limit removal further */
>     if (max_replication_slots > 0 && keep != InvalidXLogRecPtr)
>     {
>         XLogRecPtr    slotSegNo;
> 
>         XLByteToSeg(keep, slotSegNo);


slotSegNo should be a XLogSegNo. Both types share the same
intrinsic type so it doesn't harm anything.

This is back-patchable upto 9.4.

regards,

-- 
Kyotaro Horiguchi
NTT Open Source Software Center
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 5016273..8973583 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -9263,7 +9263,7 @@ KeepLogSeg(XLogRecPtr recptr, XLogSegNo *logSegNo)	/* then check whether slots limit removal further */	if (max_replication_slots > 0 && keep != InvalidXLogRecPtr)	{
-		XLogRecPtr	slotSegNo;
+		XLogSegNo	slotSegNo;		XLByteToSeg(keep, slotSegNo);
В списке pgsql-hackers по дате отправления
От: Haribabu Kommi
Дата:
От: Robert Haas
Дата:
FAQ