Skip to content

Add MariaDB test support and fix MySQL-family platform detection#672

Merged
dgafka merged 7 commits into
mainfrom
feature/mariadb-testing-support
Jun 6, 2026
Merged

Add MariaDB test support and fix MySQL-family platform detection#672
dgafka merged 7 commits into
mainfrom
feature/mariadb-testing-support

Conversation

@dgafka
Copy link
Copy Markdown
Member

@dgafka dgafka commented Jun 5, 2026

Why is this change proposed?

Platform detection treated MariaDB as PostgreSQL (MariaDBPlatform does not extend MySQLPlatform), producing ON CONFLICT ... DO NOTHING syntax 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

  • Adds MariaDB as a tested database: database-mariadb service in docker-compose.yml and a MariaDB pass in the split-testing CI for all DBAL-dependent components.
  • Fixes MySQL-family platform detection (instanceof MySQLPlatformAbstractMySQLPlatform) so MariaDB uses the MySQL SQL dialect it supports, and selects the MariaDB event-store strategies (via a serverVersion=...-MariaDB DSN).
  • Covers MariaDB across the event sourcing / projection suites, fixing test fixtures that assumed MySQL/Postgres only.
  • Incidental: pins doctrine/dbal: ^4.0 in the Laravel package's require-dev to fix a pre-existing --prefer-lowest CI failure (the Laravel PDO adapter implements the DBAL-4-only ServerVersionProvider); scoped to that package's tests so consumers and quickstarts are unaffected.

Verified against real MariaDB 11.4: full PdoEventSourcing suite green on MariaDB, MySQL and Postgres (261/261 each).

Pull Request Contribution Terms

  • I have read and agree to the contribution terms outlined in CONTRIBUTING.

dgafka added 6 commits June 5, 2026 20:01
…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.
@dgafka dgafka force-pushed the feature/mariadb-testing-support branch from fde2e75 to 8646748 Compare June 6, 2026 07:31
…le param

PHPStan 2.2 flags isset($length) on the always-defined ?int parameter
(isset.variable). Use $length === null, which is behaviorally identical.
@dgafka dgafka merged commit 6c543ef into main Jun 6, 2026
8 checks passed
@dgafka dgafka deleted the feature/mariadb-testing-support branch June 6, 2026 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant