Re: fix crash with Python 3.11
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: exclusion@gmail.com, pgsql-hackers@lists.postgresql.org
Date: 2022-02-24T19:34:05Z
Lists: pgsql-hackers
Attachments
- 0001-start-new-xact-in-SPI-commit-rollback-3.patch (text/x-diff) patch 0001
- 0002-fix-SaveTransactionCharacteristics-API-1.patch (text/x-diff) patch 0002
I wrote: > * I'm not satisfied with using static storage for > SaveTransactionCharacteristics/RestoreTransactionCharacteristics. Looking closer at this, I was not too amused to discover that of the three existing SaveTransactionCharacteristics calls, two already conflict with each other: _SPI_commit calls SaveTransactionCharacteristics and then calls CommitTransactionCommand, which again calls SaveTransactionCharacteristics, overwriting the static storage. I *think* there's no live bug there, because the state probably wouldn't have changed in between; but considering we run arbitrary user-defined code between those two points I sure wouldn't bet on it. 0001 attached is the same code patch as before, but now with spi.sgml updates; 0002 changes the API for Save/RestoreTransactionCharacteristics. If anyone's really worried about backpatching 0002, we could perhaps get away with doing that only in HEAD. I found in 0002 that I had to make CommitTransactionCommand call SaveTransactionCharacteristics unconditionally, else I got warnings about possibly-uninitialized local variables. It's cheap enough that I'm not too fussed about that. I don't get any warnings from the similar code in spi.c, probably because those functions can't be inlined there. regards, tom lane
Commits
-
Re-add SPICleanup for ABI compatibility in stable branch
- 6d61aef5dbb6 11.17 landed
- 9af9e2094dcf 12.12 landed
- b2c8d56618b8 13.8 landed
- 8657946d375f 14.5 landed
-
Fix SPI's handling of errors during transaction commit.
- cfc86f987349 13.8 landed
- 2f6b8c287b88 11.17 landed
- 293f5c5f496c 12.12 landed
- 604651880c71 14.5 landed
- 2e517818f4af 15.0 landed
-
Don't use static storage for SaveTransactionCharacteristics().
- 12d768e70497 15.0 landed