CI, PHP 8.1-8.4 support, and array columns in rows (relanded #18 + #19)#20
Merged
Conversation
A GitHub Actions matrix builds PL/php and jsonb_plphp and runs the full regression suite on PostgreSQL 11-18 (distro PHP 8.3) plus PHP 8.1, 8.2, and 8.4 (ondrej PPA) against the newest PostgreSQL, for every push to master and every pull request. PHP compatibility fixes found while widening the matrix: - PHP 8.1: php_module_startup still took an additional-modules count; add a version guard. Also #error explicitly below 8.1, where the zend_error_cb signature differs. - PHP 8.4: fgetcsv deprecates omitting $escape; the cookbook's CSV recipe now passes explicit arguments. - The Makefiles now prefer the libphp matching PHP_CONFIG's version when several are installed. Note (INSTALL): some packagings give every libphpX.Y.so the same SONAME (libphp.so), so the backend loads whatever that symlink points at regardless of the version linked -- keep one embed package installed, or point the symlink. The suite passes on PHP 8.1, 8.2, 8.3, and 8.4 (each with the matching runtime); documented range updated from "8.x" to 8.1-8.4. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The Actions runner image sets create_main_cluster=false, so installing postgresql-N does not create one. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
pg_regress runs as postgres, which could not reach the checkout through /home/runner. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The host's php.ini must not decide which errors reach our zend_error_cb or how they are routed: hardcode error_reporting=E_ALL, display_errors/log_errors off, and disable opcache (whose JIT adds nothing for our one-shot eval'd functions). GitHub's runner images ship a PHP with opcache+JIT enabled for CLI, which silently dropped notices and reduced every error message to "fatal error". Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Extensions loaded from the host's php.ini (xdebug, notably, which the GitHub runner images preconfigure) hook zend_error_cb during startup, swallowing the warnings and notices PL/php forwards to the client. Re-assert our callback after request startup and at the top of every handler invocation (a pointer assignment, effectively free), and set xdebug.mode=off alongside the other hardcoded INI values. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
An array-typed column used to cross into PHP as its literal text form
("{a,b}") everywhere a whole row converts: $_TD['new']/['old'] in
triggers, rows from spi_fetch_row/spi_fetchrow/spi_each, and the
fields of composite-type arguments. Route those column values through
the same conversion arguments already get, so they arrive as real PHP
arrays -- and, since the reverse path (plphp_zval_get_cstring with
do_array) already renders PHP arrays back into array literals,
assigning an array works too, e.g. modifying $_TD['new']['tags']
before returning MODIFY.
This matches PL/Perl, which converts row fields recursively. It is a
behavior change for code that string-parsed the literal form, noted in
the CHANGELOG. Composite-typed columns inside rows still arrive as
text (converting those needs a record parser; possible follow-up).
New cases in the arrays test cover SPI rows, cursor rows, triggers
(read + append + MODIFY round trip), and composite argument fields.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Convert array columns inside rows to PHP arrays
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.
Relands #18 and #19 (GitHub closed #18 un-merged when its stacked base branch was deleted; #19 had already merged into this branch). Contents unchanged from the reviewed PRs, both of which passed the full 11-job CI matrix:
🤖 Generated with Claude Code