Skip to content

Doctrine ORM/DBAL compatibility on MatrixOne 4.0.0-rc3 — 221/237 pass; 16 remaining issues #3

Open

Description

@dengn

Focused summary of Doctrine ORM 3 / DBAL 4 (the second most widely used PHP ORM, default in Symfony) against MatrixOne 4.0.0-rc3. The ORM runtime is solid — 221 / 237 scenarios pass (93.2%): entities, DQL (where/join/aggregate/functions/NEW DTO/UPDATE/DELETE), associations incl. OneToOne, lifecycle callbacks, repositories, the full DBAL query-builder expr() surface, typed value round-trips, and SchemaTool::createSchema. The 16 failures cluster into 4 themes — and the dominant one blocks Doctrine Migrations. (Part of the overall study in #1.)


1. 🟠 Schema introspection & Doctrine Migrations broken — missing information_schema.collation_character_set_applicability (11 scenarios)

Doctrine's MySQL platform joins information_schema.collation_character_set_applicability to read column charsets during bulk introspection, schema-diff and ALTER generation. MatrixOne does not have that table:

1064 SQL parser error: table "collation_character_set_applicability" does not exist
  • Failing: listTables (bulk), introspectTable, introspectTable round-trip, schema diff / migrate (Comparator), and every getAlterTableSQL path via the Comparator (add column, drop column, change column type, add index, drop index), plus a direct probe of the missing table.
  • Impact: Doctrine Migrations and any schema-diff workflow do not work — this is the single biggest blocker for a Symfony/Doctrine app on MatrixOne.
  • Fix: add information_schema.collation_character_set_applicability (and ideally check_constraints, which separately blocks CakePHP).

2. 🟠 Single-table introspection returns inaccurate metadata (3 scenarios)

Even where introspection runs, column metadata is wrong:

-- VARCHAR(20) column:
SELECT CHARACTER_MAXIMUM_LENGTH FROM information_schema.columns WHERE ...  -- NULL (expected 20)
-- DECIMAL(12,2) column:
SELECT NUMERIC_PRECISION, NUMERIC_SCALE FROM information_schema.columns WHERE ...  -- NULL (expected 12, 2)
  • Failing: column length on varchar (got NULL), decimal precision/scale (got NULL), listTableForeignKeys on FK table (returns no FKs for a table created with a FK).
  • Impact: ORMs/tools that map types from introspection get wrong lengths/precision and miss foreign keys. (Also observed: DATA_TYPE is upper-cased and TEXT CHARACTER_MAXIMUM_LENGTH = 0.)
  • Fix: populate CHARACTER_MAXIMUM_LENGTH / NUMERIC_PRECISION / NUMERIC_SCALE and expose FKs in information_schema.KEY_COLUMN_USAGE/REFERENTIAL_CONSTRAINTS.

3. 🟡 Doctrine float type emits DOUBLE PRECISION, which is rejected (1 scenario)

#[ORM\Column(type: 'float')] public float $x;
// Doctrine MySQL platform generates: ... DOUBLE PRECISION ...
// MatrixOne: 1064 (only DOUBLE is accepted)
  • Failing: type float.
  • Impact: any entity with a float column fails at schema-create/migrate time.
  • Workaround: map to decimal, or a custom type that emits DOUBLE. Fix: accept the DOUBLE PRECISION keyword as an alias of DOUBLE.

4. 🟡 Nested transactions & a Criteria LIMIT bug (2 scenarios)

  • nested with savepoints → 20101 savepoint has not been implemented yet (DBAL's setNestTransactionsWithSavepoints(true) can't roll back to a savepoint — same root cause as the Eloquent issue).
  • matching() Criteria in + limit → returns 3 rows when Criteria::setMaxResults(2) was set (the persister-built SQL omits the LIMIT clause on this platform).

Priority for MatrixOne

  1. Add information_schema.collation_character_set_applicability (theme 1) — unblocks Doctrine Migrations / schema-diff (11 of 16 failures).
  2. Accurate column metadata + FK exposure in information_schema (theme 2).
  3. ROLLBACK TO SAVEPOINT (theme 4) + accept DOUBLE PRECISION (theme 3).

Reproduced by the compatibility suite on branch claude/funny-ritchie-skwh06; run php run.php --only=doctrine.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions