pgsql: Fix wrong logic in TransactionIdInRecentPast()

Поиск
Список
Период
Сортировка
От Alexander Korotkov
Тема pgsql: Fix wrong logic in TransactionIdInRecentPast()
Дата
Msg-id E1rY2Mb-005ELT-SC@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix wrong logic in TransactionIdInRecentPast()

The TransactionIdInRecentPast() should return false for all the transactions
older than TransamVariables->oldestClogXid.  However, the function contains
a bug in comparison FullTransactionId to TransactionID allowing full
transactions between nextXid - 2^32 and oldestClogXid - 2^31.

This commit fixes TransactionIdInRecentPast() by turning the oldestClogXid into
FullTransactionId first, then performing the comparison.

Backpatch to all supported versions.

Reported-by: Egor Chindyaskin
Bug: 18212
Discussion: https://postgr.es/m/18212-547307f8adf57262%40postgresql.org
Author: Karina Litskevich
Reviewed-by: Kyotaro Horiguchi
Backpatch-through: 12

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/165d921c9a883814a35e8161fc692793e9c945a4

Modified Files
--------------
src/backend/utils/adt/xid8funcs.c | 30 +++++++++++++++++++-----------
1 file changed, 19 insertions(+), 11 deletions(-)


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: pgsql: Fix documentation build with older docbook-xsl
Следующее
От: Daniel Gustafsson
Дата:
Сообщение: pgsql: doc: Remove superfluous bracket in synopsis