Skip to content

Sync with upstream trunk (4 commits) - #7

Open
batonac wants to merge 4 commits into
d1-supportfrom
upstream-sync
Open

Sync with upstream trunk (4 commits)#7
batonac wants to merge 4 commits into
d1-supportfrom
upstream-sync

Conversation

@batonac

@batonac batonac commented Aug 12, 2026

Copy link
Copy Markdown
Member

Automated sync of WordPress/sqlite-database-integration@trunk into d1-support.

This pull request tracks every upstream commit that has not landed on d1-support yet.
It is updated in place as upstream moves, and merges itself once the merge is clean and
every check is green. While it is open, it needs a person.

Upstream commits (4)

Merge conflicts (1 files)

d1-support cannot absorb these changes automatically, so this branch mirrors the
upstream trunk and no checks will run until the conflicts are resolved:

  • packages/mysql-on-sqlite/tests/bootstrap.php

Resolve them by merging the base branch into this one:

git fetch origin
git checkout -B upstream-sync origin/upstream-sync
git merge origin/d1-support   # resolve the conflicts, then commit
git push origin upstream-sync

Branch shape: mirror. Maintained by upstream-sync.yml. Closing this pull request is not permanent — the next scheduled run reopens it. Disable the workflow to stop the sync.

## Summary

Makes the PHP packages ready for Composer installation and discovery.

The changes provide these outcomes:

- **Declare runtime requirements and autoloading** for MySQL on SQLite.
- **Make the MySQL proxy installable independently**, with the SQLite
driver available as an optional backend and development dependency.
- **Complete package metadata and licensing** for MySQL on SQLite, the
MySQL parser, and the MySQL proxy.
- **Prepare standalone package subtree archives** that retain each
package manifest while excluding tests and generated test data.
- **Document and validate standalone installation paths** in package
documentation and CI.
- **Run workflows on the repository’s `trunk` branch.**

## Why

The package manifests did not fully declare their runtime requirements,
autoloading, relationships, or distribution metadata. The proxy also
depended on a repository-local loader path, which prevented standalone
Composer use.
## Summary

Reject invalid `BIT` column defaults instead of preserving unnormalized
input in the emulated information schema. Unsupported values now return
MySQL-compatible error 1067.

## Why

The `BIT` default accepted any value beginning with a valid prefix and
stored the original value. `SHOW CREATE TABLE` later emitted that value
without quoting, allowing untrusted text to become executable SQL in a
generated MySQL dump.

This is a hotfix that requires valid literal forms and rejects anything
that cannot be safely normalized. Broader default validation based on
the AST and full column definition should be done as a follow-up, also
for other types.

This prevents untrusted SQL from being embedded in generated MySQL DDL
during migration.
## Release `3.0.0-rc.9`

Version bump and changelog update for release `3.0.0-rc.9`.

**Changelog draft:**
* Reject invalid BIT column defaults
([WordPress#487](WordPress#487))
* Make Composer packages installable
([WordPress#486](WordPress#486))
* Remove INET_ATON WordPress dependency
([WordPress#485](WordPress#485))
* Restore database version support for older WordPress releases
([WordPress#484](WordPress#484))
* Finalize MySQL-on-SQLite 3.0 refinements
([WordPress#482](WordPress#482))
* Prefix SQLite-specific constructor options
([WordPress#481](WordPress#481))
* Unify emulated MySQL server identity
([WordPress#479](WordPress#479))
* Document the 3.0 driver API
([WordPress#477](WordPress#477))
* Expand PDO API coverage
([WordPress#471](WordPress#471))
* Refine the 3.0 API surface
([WordPress#469](WordPress#469))
* Add ANSI_QUOTES and SQL mode validation
([WordPress#452](WordPress#452))

**Full changelog:**
WordPress/sqlite-database-integration@v3.0.0-rc.8...release/v3.0.0-rc.9

## Next steps

1. **Review** the changes in this pull request.
2. **Push** any additional edits to this branch (`release/v3.0.0-rc.9`).
3. **Merge** this pull request to complete the release.

Merging will automatically build the plugin ZIP and create a [GitHub
release](https://github.com/WordPress/sqlite-database-integration/releases).

> [!NOTE]
> This is a **pre-release**. It will not be deployed to
[WordPress.org](https://wordpress.org/plugins/sqlite-database-integration/).
@batonac batonac added upstream-sync Automated sync with the WordPress upstream upstream-conflict Upstream sync needs a manual merge labels Aug 12, 2026
@batonac

batonac commented Aug 12, 2026

Copy link
Copy Markdown
Member Author

This sync does not merge cleanly into d1-support. 1 file(s) conflict:

  • packages/mysql-on-sqlite/tests/bootstrap.php

Checks cannot run until this is resolved — GitHub has no merge commit to test. Resolve
by merging the base branch into this one, and the pull request merges itself once the
suites go green:

git fetch origin
git checkout -B upstream-sync origin/upstream-sync
git merge origin/d1-support   # resolve the conflicts, then commit
git push origin upstream-sync
61501559e776

## Release `3.0.0`

Prepares the version numbers and release notes for `3.0.0`.

**Changelog draft:**

---

**SQLite Database Integration 3 is here! 🎉**

This release introduces an **all-new SQLite database driver for
WordPress**, rebuilt from the ground up. Its purpose-built MySQL lexer,
parser, and emulation layer deliver broader compatibility, more accurate
behavior, and a stronger foundation for future improvements.

The 3.0 release spans nearly two years of work, featuring [160 pull
requests](https://github.com/WordPress/sqlite-database-integration/milestone/3?closed=1)
and 1,075 commits from 15 contributors.

## What's new

The new driver advances SQLite support for WordPress, plugins, database
tools, and other MySQL-based applications. These improvements include:

- **New SQL engine:** The pure-PHP lexer and parser provide extensive
coverage of the official MySQL grammar.
- **Broad query support:** Complex joins, subqueries, CTEs, unions, and
other advanced queries are now supported.
- **Schema emulation:** WordPress and database tools can query emulated
MySQL `INFORMATION_SCHEMA` tables.
- **Schema introspection:** `SHOW` and `DESCRIBE` statements provide
accurate MySQL-like metadata.
- **Improved data handling:** Types, casts, defaults, auto-increment,
values, and escaping better match MySQL.
- **Refined MySQL semantics:** Better emulation of SQL modes, variables,
functions, transactions, and errors.
- **Better concurrency:** Write-ahead logging and fewer locks reduce
blocking between readers and writers.
- **PDO API:** The new driver implements the PDO MySQL API, supporting
many MySQL-based tools and applications.
- **Extensive testing:** Test suites cover parsing, translation,
metadata, concurrency, PDO, and end-to-end workflows.

For more information about the new driver and its architecture, read the
[driver
announcement](https://make.wordpress.org/playground/2025/06/13/introducing-a-new-sqlite-driver-for-wordpress/).

## Modular design

The project was redesigned as a set of focused packages, separating the
core driver from its WordPress integration:

- [SQLite Database
Integration](https://github.com/WordPress/sqlite-database-integration/tree/v3.0.0/packages/plugin-sqlite-database-integration):
The **WordPress plugin** powered by MySQL on SQLite.
- [MySQL on
SQLite](https://github.com/WordPress/sqlite-database-integration/tree/v3.0.0/packages/mysql-on-sqlite):
A standalone **PDO MySQL drop-in** for running MySQL-based PHP
applications on SQLite.
- [MySQL
proxy](https://github.com/WordPress/sqlite-database-integration/tree/v3.0.0/packages/mysql-proxy)
(experimental): A **MySQL wire protocol bridge** to PDO-compatible
drivers for clients outside PHP.

This architecture opens the driver to new integrations, applications,
and development tools beyond WordPress.

## Upgrading to 3.0

Upgrading an existing SQLite site is straightforward:

1. **Back up** your SQLite database.
2. **Update the plugin** to version 3.0.

On first connection, the new driver automatically initializes its
metadata without changing your tables or content.

If you used the new driver preview, you can now delete the
`WP_SQLITE_AST_DRIVER` flag.

## Breaking changes

Most WordPress sites need no changes. Review the following if you use a
custom setup:

- **New driver:**
    - The new driver is always used. The legacy driver was removed.
    - The `WP_SQLITE_AST_DRIVER` feature flag was removed.
- **Updated SQLite version requirements:**
    - SQLite `3.37.0` or newer is required.
- The `WP_SQLITE_UNSAFE_ENABLE_UNSUPPORTED_VERSIONS` opt-in enables
limited SQLite `3.27.0`–`3.36.x` support.
- **`DB_NAME` is required:**
    - It must be defined and non-empty.
- It is used dynamically, independently of the SQLite file name and
stored metadata.
- **SQLite defaults have changed:**
- Journal mode now defaults to [`WAL`](https://sqlite.org/wal.html).
Account for `-wal` and `-shm` sidecar files.
- Synchronous mode now defaults to
[`NORMAL`](https://sqlite.org/pragma.html#pragma_synchronous) in `WAL`
mode.
- **Updated configuration constants:**
    - `DATABASE_ENGINE` was removed. Use `DB_ENGINE`.
    - `DATABASE_TYPE` is deprecated. Use `DB_ENGINE`.
    - `FQDBDIR` is deprecated. Use `DB_DIR`.
    - `FQDB` is deprecated. Use `DB_DIR` and `DB_FILE`.
- **Updated driver classes:**
    - `WP_SQLite_Driver` is deprecated. Use `WP_MySQL_On_SQLite`.
    - `WP_PDO_MySQL_On_SQLite` was replaced by `WP_MySQL_On_SQLite`.
- `WP_SQLite_Driver_Exception` was replaced by
`WP_MySQL_On_SQLite_Exception`.
- `WP_PDO_Proxy_Statement` was replaced by
`WP_MySQL_On_SQLite_Statement`.
- **Sunsetting `$GLOBALS['@pdo']`:**
- Injecting a PDO connection through `$GLOBALS['@pdo']` is no longer
supported.
- Reading `$GLOBALS['@pdo']` is deprecated. Use
`$wpdb->get_driver()->get_sqlite_pdo()`.
- **Renamed driver constructor options:**
    - `pdo` → `sqlite_pdo`.
    - `journal_mode` → `sqlite_journal_mode`.
    - `synchronous` → `sqlite_synchronous`.

## Thank you

Thank you to everyone who helped build, test, review, and improve the
new driver. Your work made this possible.

**3.0 milestone:** [160 pull
requests](https://github.com/WordPress/sqlite-database-integration/milestone/3?closed=1)
**Changes since 2.2.23:**
[`v2.2.23...v3.0.0`](WordPress/sqlite-database-integration@v2.2.23...v3.0.0)

---

**PR comparison:**
[`v3.0.0-rc.9...release/v3.0.0`](WordPress/sqlite-database-integration@v3.0.0-rc.9...release/v3.0.0)

## Next steps

1. **Review** the changes in this pull request.
2. **Push** any additional edits to this branch (`release/v3.0.0`).
3. **Merge** this pull request to complete the release.

Merging will automatically build the plugin ZIP, create a [GitHub
release](https://github.com/WordPress/sqlite-database-integration/releases),
and deploy to
[WordPress.org](https://wordpress.org/plugins/sqlite-database-integration/).
@batonac batonac changed the title Sync with upstream trunk (3 commits) Sync with upstream trunk (4 commits) Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

upstream-conflict Upstream sync needs a manual merge upstream-sync Automated sync with the WordPress upstream

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants