Re: 回复:Re: BUG #18118: bug report for COMMIT AND CHAIN feature
От | Tom Lane |
---|---|
Тема | Re: 回复:Re: BUG #18118: bug report for COMMIT AND CHAIN feature |
Дата | |
Msg-id | 710008.1695313016@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | 回复:Re: BUG #18118: bug report for COMMIT AND CHAIN feature ("刘相(佑熙)" <evan.lx@alibaba-inc.com>) |
Список | pgsql-bugs |
"=?UTF-8?B?5YiY55u4KOS9keeGmSk=?=" <evan.lx@alibaba-inc.com> writes: > This problem seems to have been solved in v15 and v16. Because of this patch (12d768e70497afc5a57acf73c251316997b5175a),the use of static variables has been cancelled. But this problem can obviouslybe reproduced on v14(and perhaps v12 v13). Try the following SQL again. Oooh ... I see the problem. It's not really about the use of static variables. In the older branches, CommitTransactionCommand does if (s->chain) SaveTransactionCharacteristics(); .... if (s->chain) RestoreTransactionCharacteristics(); but if we're closing out any subtransactions then *those two checks are inspecting different "s" structs*, and the "chain" flag has only been set in the bottom of the state stack. 12d768e70 fixed the problem rather accidentally, because I removed the initial "if (s->chain)" test to avoid a compiler warning. I think we can just do the same in the back branches, without having to address the question of whether it'd be OK to break API for SaveTransactionCharacteristics and RestoreTransactionCharacteristics. regards, tom lane
В списке pgsql-bugs по дате отправления: