Repository navigation
Enable SQLite column metadata - #1204
Merged
crazywhalecc merged 1 commit intoJul 7, 2026
Merged
Conversation
Build Unix SQLite with SQLITE_ENABLE_COLUMN_METADATA so the metadata APIs are available on macOS and Linux. Remove the pdo_sqlite configure override that forced PHP to treat sqlite3_column_table_name() as unavailable, and add sanity checks for both SQLite compile options and PDO column metadata.
henderkes
approved these changes
Jul 7, 2026
crazywhalecc
approved these changes
Jul 7, 2026
crazywhalecc
left a comment
Owner
There was a problem hiding this comment.
v3 branch should do this too.
Contributor
Author
@crazywhalecc Should I open another PR against v3, or would that be cherry-picked from main? |
Owner
Ah v3 is totally refactored version. You need to do similar changes on v3 branch and open another PR. |
Contributor
Author
|
@crazywhalecc I gave it a shot in #1205. |
1 task
wojtekn
added a commit
to Automattic/studio
that referenced
this pull request
Jul 9, 2026
## Related issues - Related to STU-1968 ## How AI was used in this PR I used Claude Code to trace how Studio's native PHP is built and to bump it to the latest trunk that includes the SQLITE_ENABLE_COLUMN_METADATA fix. ## Proposed Changes Studio's Native PHP runtime on macOS and Linux was built without SQLite column metadata, so PDO could not report which table a result column came from. This broke phpMyAdmin's unique-column detection, surfacing the "Current selection does not contain a unique column" warning when browsing tables (e.g. `wp_posts`) — even though the primary key was correctly defined. The Sandbox/Playground runtime was unaffected because its PHP is built with the metadata enabled, as is essentially every mainstream PHP/SQLite distribution. static-php-cli [#1204](crazywhalecc/static-php-cli#1204) fixes this upstream: it builds libsqlite3 with `SQLITE_ENABLE_COLUMN_METADATA` and stops SPC from disabling `sqlite3_column_table_name()` in `pdo_sqlite`'s configure. This PR pins the `Build PHP CLI Binaries` workflow to that merged commit, which descends directly from the previous pin (so the earlier centos 7 gd/libcurl link fix is retained). Windows binaries come from php.net and already had metadata enabled, so they are unchanged. This is the workflow bump only. It has no effect until the build workflow is run to produce new binaries and the resulting CDN metadata PR lands (see Testing Instructions). ## Testing Instructions This change ships nothing on its own — it changes which SPC ref future builds use. To roll out the fix: 1. Merge this PR. 2. Run the **Build PHP CLI Binaries** workflow once per shipped PHP minor (8.5.7, 8.4.22, 8.3.31, 8.2.31) with `package_version: studio-2` (package IDs are immutable — a new value is required) and `apps_cdn_visibility: external`. 3. Merge the metadata PR the workflow opens (updates `packages/common/lib/php-binary-cdn-metadata.json` to the new `studio-2` URLs + SHA-256). 4. Confirm packaged builds resolve the `studio-2` package for the recommended version. To verify the fix in a resulting build, on the Native runtime: ```php $pdo = new PDO('sqlite::memory:'); $pdo->exec('CREATE TABLE wp_posts (ID INTEGER PRIMARY KEY, t TEXT)'); var_dump($pdo->query('SELECT ID FROM wp_posts')->getColumnMeta(0)['table']); // expect string "wp_posts" ``` Then browse a table in phpMyAdmin and confirm the "no unique column" warning is gone. Verified locally on macOS arm64 (PHP 8.4.23 / SQLite 3.45.2): the `table` field is absent with the old ref and present with #1204. ## Pre-merge Checklist - [ ] Have you checked for TypeScript, React or other console errors? --------- Co-authored-by: Riad Benguella <riad@Riads-MacBook-Air.local> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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.
What Changed
SQLITE_ENABLE_COLUMN_METADATAfor Unix SQLite builds so macOS/Linux match the existing Windows SQLite Makefile.pdo_sqliteconfigure override that forcedsqlite3_column_table_name=no.Why
SQLITE_ENABLE_COLUMN_METADATAis optional in SQLite, but it is used in almost everylibsqlitedistribution on Linux, macOS, and Windows. When PHP bundled SQLite itself, it used the flag too, and PHP's own test suite covers that flag.When the flag is missing, SQLite does not expose
sqlite3_column_table_name()and PDO then cannot populatePDOStatement::getColumnMeta()['table'], which breaks consumers who rely on this metadata.Evidence
COLUMN_METADATAenabled on macOS, Debian, Fedora, Gentoo, Arch, Termux, FreeBSD, OpenBSD, Homebrew, MacPorts, Nix, Haikuports, and msys2.pdo_sqliteconfigure script probessqlite3_column_table_name()and definesHAVE_SQLITE3_COLUMN_TABLE_NAME; PHP's own PDO SQLite test suite covers that flag.References
SQLITE_ENABLE_COLUMN_METADATAand update SQLite WordPress/wordpress-playground#2948