Skip to content

Fix GH-21869: pdo_pgsql DEALLOCATE in destructor can poison the enclosing transaction.#21870

Open
devnexen wants to merge 2 commits intophp:PHP-8.4from
devnexen:gh21869
Open

Fix GH-21869: pdo_pgsql DEALLOCATE in destructor can poison the enclosing transaction.#21870
devnexen wants to merge 2 commits intophp:PHP-8.4from
devnexen:gh21869

Conversation

@devnexen
Copy link
Copy Markdown
Member

@devnexen devnexen commented Apr 24, 2026

On libpq < 17 the raw DEALLOCATE can fail (e.g. Aurora DSQL rejects it),
which aborts the user's transaction and turns the next COMMIT into a
silent ROLLBACK. Wrap it in a SAVEPOINT so a failure is contained, and
skip it when the transaction is already aborted or the connection is gone.

…closing transaction.

On libpq < 17 the raw DEALLOCATE can fail (e.g. Aurora DSQL rejects it),
which aborts the user's transaction and turns the next COMMIT into a
silent ROLLBACK. Wrap it in a SAVEPOINT so a failure is contained, and
skip it when the transaction is already aborted or the connection is gone.
@devnexen devnexen changed the title ext/pdo_pgsql: add failing regression test for GH-21869. @devnexen Fix phpGH-21869: pdo_pgsql DEALLOCATE in destructor can poison the enclosing transaction. Apr 24, 2026
@devnexen devnexen changed the title @devnexen Fix phpGH-21869: pdo_pgsql DEALLOCATE in destructor can poison the enclosing transaction. Fix phpGH-21869: pdo_pgsql DEALLOCATE in destructor can poison the enclosing transaction. Apr 24, 2026
@devnexen devnexen changed the title Fix phpGH-21869: pdo_pgsql DEALLOCATE in destructor can poison the enclosing transaction. Fix GH-21869: pdo_pgsql DEALLOCATE in destructor can poison the enclosing transaction. Apr 24, 2026
@devnexen devnexen marked this pull request as ready for review April 25, 2026 05:47
@devnexen devnexen requested a review from SakiTakamachi as a code owner April 25, 2026 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pdo_pgsql: DEALLOCATE on statement destruct silently aborts enclosing transaction if it fails

1 participant