Add MariaDB test support and fix MySQL-family platform detection#672
Merged
Conversation
…SQL SQL dialect MariaDBPlatform does not extend MySQLPlatform (both extend AbstractMySQLPlatform), so projection state storage emitted PostgreSQL ON CONFLICT syntax against MariaDB. Switch platform checks to AbstractMySQLPlatform and add MariaDB to docker-compose.
- CustomEventStreamTest: select MariaDbSingleStreamStrategy on MariaDBPlatform instead of falling back to MySqlSingleStreamStrategy (MySQL-8 DDL rejected by MariaDB) - GapDetection fixtures: write created_at without timezone offset (DATE_ATOM -> Y-m-d\TH:i:s) so MariaDB strict mode accepts it
Config/PDO/Connection.php implements the DBAL-4-only ServerVersionProvider interface, so the Laravel package's own test suite needs DBAL 4. Without a pin, --prefer-lowest resolved DBAL 3.9 and failed with 'Interface Doctrine\DBAL\ServerVersionProvider not found'. Pin it in require-dev only, so the constraint scopes to this package's tests and does not propagate to consumers or the DBAL-3 Laravel quickstarts via the path repository.
fde2e75 to
8646748
Compare
…le param PHPStan 2.2 flags isset($length) on the always-defined ?int parameter (isset.variable). Use $length === null, which is behaviorally identical.
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.
Why is this change proposed?
Platform detection treated MariaDB as PostgreSQL (
MariaDBPlatformdoes not extendMySQLPlatform), producingON CONFLICT ... DO NOTHINGsyntax errors in projection state storage on MariaDB.This sets up and verifies the event store for MariaDB, and adds MariaDB test coverage so it stays working.
Description of Changes
database-mariadbservice indocker-compose.ymland a MariaDB pass in thesplit-testingCI for all DBAL-dependent components.instanceof MySQLPlatform→AbstractMySQLPlatform) so MariaDB uses the MySQL SQL dialect it supports, and selects the MariaDB event-store strategies (via aserverVersion=...-MariaDBDSN).doctrine/dbal: ^4.0in the Laravel package'srequire-devto fix a pre-existing--prefer-lowestCI failure (the Laravel PDO adapter implements the DBAL-4-onlyServerVersionProvider); scoped to that package's tests so consumers and quickstarts are unaffected.Verified against real MariaDB 11.4: full
PdoEventSourcingsuite green on MariaDB, MySQL and Postgres (261/261 each).Pull Request Contribution Terms