ext/pgsql: stop advertising PGSQL_DML_ASYNC where it is refused - #23480
Closed
lacatoire wants to merge 3 commits into
Closed
ext/pgsql: stop advertising PGSQL_DML_ASYNC where it is refused#23480lacatoire wants to merge 3 commits into
lacatoire wants to merge 3 commits into
Conversation
pg_update() and pg_delete() list PGSQL_DML_ASYNC among the valid flags in the error they raise, although their masks reject it and their helpers assert it is never set. While there, widen php_pgsql_delete()'s assert to PGSQL_DML_NO_CONV, which pg_delete() accepts and the helper itself consults.
devnexen
requested changes
Aug 27, 2026
Both accept the whole PGSQL_CONV_OPTS set but only named PGSQL_CONV_FORCE_NULL. Add PGSQL_CONV_IGNORE_DEFAULT and PGSQL_CONV_IGNORE_NOT_NULL, and drop the table from a CLEAN section rather than at the end of the test body.
devnexen
reviewed
Aug 27, 2026
Name pg_insert() in the test title, reject a bit that belongs to no flag, and check that the two PGSQL_CONV_* flags newly named in the messages are indeed accepted.
devnexen
approved these changes
Aug 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pg_update()andpg_delete()rejectPGSQL_DML_ASYNCin their option mask but then name it in the error message as an accepted flag:The fix removes
PGSQL_DML_ASYNCfrom the two error messages.pg_insert()andpg_select()accept the flag and keep their existing wording unchanged.A second defect is fixed in the same file: the
ZEND_ASSERTinsidephp_pgsql_delete()excludedPGSQL_DML_NO_CONV, but its callerpg_delete()accepts that bit and passes it through untouched — the helper consults it four lines below the assert. The assert is widened to match the actual accepted mask.A new test (
ext/pgsql/tests/pg_dml_option_flags.phpt) covers the corrected error messages and thepg_delete()/PGSQL_DML_NO_CONVpath.