[php-src] PR #23480: ext/pgsql: stop advertising PGSQL_DML_ASYNC where it is refused
| From: | lacatoire | Date: | Thu, 27 Aug 2026 12:13:02 +0000 |
| Subject: | [php-src] PR #23480: ext/pgsql: stop advertising PGSQL_DML_ASYNC where it is refused | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-38167@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/23480
Author: lacatoire
pg_update() and pg_delete() reject PGSQL_DML_ASYNC in their
option mask but then name it in the error message as an accepted flag:
```c
if (option &
~(PGSQL_CONV_OPTS|PGSQL_DML_NO_CONV|PGSQL_DML_EXEC|PGSQL_DML_STRING|PGSQL_DML_ESCAPE)) {
zend_argument_value_error(5, "must be a valid bit mask of PGSQL_CONV_FORCE_NULL,
PGSQL_DML_NO_CONV, "
"PGSQL_DML_ESCAPE, PGSQL_DML_EXEC, PGSQL_DML_ASYNC, and PGSQL_DML_STRING");
```
The fix removes PGSQL_DML_ASYNC from the two error messages. pg_insert()
and pg_select() accept the flag and keep their existing wording unchanged.
A second defect is fixed in the same file: the ZEND_ASSERT inside
php_pgsql_delete() excluded PGSQL_DML_NO_CONV, but its caller
pg_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 the pg_delete()/PGSQL_DML_NO_CONV path.