Possible bug in PostgreSQL 9.2 stable: TwoPhaseGetDummyBackendId()

Поиск
Список
Период
Сортировка
От Robert Ross
Тема Possible bug in PostgreSQL 9.2 stable: TwoPhaseGetDummyBackendId()
Дата
Msg-id BE1A65FE-5014-4FFB-9D3E-85284EAFB272@translattice.com
обсуждение исходный текст
Ответы Re: Possible bug in PostgreSQL 9.2 stable: TwoPhaseGetDummyBackendId()
Список pgsql-hackers
I have looked at the Postgres 9.2 stable and Postgres 9.2 beta 3 git  
archives and this bug still appears to be present.

TwoPhaseGetDummyProc returns a PGPROC*. In 9.0, it was safe for  
TwoPhaseGetDummyBackendId() to cast this to a GlobalTransaction  
because the GlobalTransactionData structure's first element was always  
a PGPROC structure. However, in 9.2 this is no longer true. Despite  
the mismatch that now exists between the structures,  
TwoPhaseGetDummyBackendId() still attempts to cast a PGPROC* to a  
GlobalTransaction to extract the member 'dummyBackendId'. Rewriting  
this function to use the GlobalTransaction structure that is found in  
TwoPhaseState->prepXacts[] appears to fix the problem. In practice  
this appears to result in TwoPhaseGetDummyBackendId() returning  
invalid values (such as 0) instead of the expected range above  
MaxBackends. I'm not sure why this hasn't caused problems with  
multixact.c's use of this function.

Is this a known bug? Would it be helpful to submit a patch?

Regards,

Robert Ross





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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: WIP fix proposal for bug #6123
Следующее
От: Jeff Janes
Дата:
Сообщение: Re: Inserting heap tuples in bulk in COPY