subxcnt defined as signed integer in SnapshotData and SerializeSnapshotData

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема subxcnt defined as signed integer in SnapshotData and SerializeSnapshotData
Дата
Msg-id CAB7nPqTj4wuS1sAb=HQmBu=YNJWZGrFuRmGNq2CQ8i7rASoE5w@mail.gmail.com
обсуждение исходный текст
Ответы Re: subxcnt defined as signed integer in SnapshotData and SerializeSnapshotData  (Simon Riggs <simon@2ndQuadrant.com>)
Список pgsql-hackers
Hi all,

Coverity is complaining about the following assertion introduced in
commit 924bcf4 (parallel stuff, SerializeSnapshot@snapmgr.c):
+       Assert(snapshot->xcnt >= 0);

Now the thing is that this assertion does not make much sense, because
SnapshotData defines subxcnt as uint32 in snapshot.h. While we could
simply remove this assertion, I am wondering if we could not change
subxcnt to uint32 instead.

SnapshotData has been introduced in 2008 by d43b085, with this comment:
+       int32           subxcnt;                /* # of xact ids in
subxip[], -1 if overflow */
Comment regarding negative values removed in efc16ea5.

Now, by looking at the code on HEAD, I am seeing no code paths that
make use of negative values of subxcnt. Perhaps I am missing
something?
Regards,
-- 
Michael



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Custom/Foreign-Join-APIs (Re: [v9.5] Custom Plan API)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: "Bugs" CF?