Harden SQLite with CI-backed SQLancer regressions#435
Open
adamziel wants to merge 37 commits into
Open
Conversation
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.
Big picture
This PR turns SQLancer into a repeatable compatibility loop for SQLite Database Integration.
SQLancer generates MySQL statements, we keep the statements MySQL accepts, replay them through the SQLite driver, and turn SQLite-only failures into permanent regression coverage. The point is not to keep fuzzing on a local workstation. The branch moves that load into GitHub Actions and gives us a durable queue for anything the workflow finds next.
What changed
bin/run-sqlancer-sqlite-fuzz.sh, a bounded runner that starts disposable MySQL, captures SQLancer output, filters out MySQL-rejected statements, and replays the accepted prefix through the SQLite driver.tests/fuzz/replay-sqlancer-log.phpandtests/fuzz/append-sqlancer-finding.phpso generated logs can be replayed and failures can be formatted as GitHub issue comments..github/workflows/sqlancer-sqlite-fuzz.yml, which runs on this fuzz branch, on a six-hour schedule, and by manual dispatch. It rotates SQLancer oracles/seeds and records newly found replay failures in one GitHub issue namedSQLancer SQLite replay findings.tests/e2e/specs/sqlancer-fuzz-regressions.test.jsso reduced SQLancer failures also run through the real WordPress/plugin path, not only the package driver.COUNT(DISTINCT ...),ALTER TABLE ... RENAME, text prefix indexes, signed integer clipping, and non-transactional table implicit defaults.CI fuzz loop
The expected workflow now is:
SQLancer SQLite replay findingsissue with one comment for that failure.Manual runs are still available when we want a specific oracle or seed:
How to test this branch
For local development, prefer targeted checks instead of running SQLancer:
Useful static checks:
Validation so far
OK (25 tests, 198 assertions).OK (2 tests, 12 assertions)with the adjacent HEAP case.node --checkpassed for the SQLancer e2e spec.run:blockbash -n, helper PHP lint, PHPCS, and a synthetic failure-formatting smoke test.Known limitations