Repository navigation
IBX-11939: Ignored declared TEXT and BLOB defaults on MySQL in the schema alignment test - #82
Merged
Merged
Conversation
Steveb-p
marked this pull request as ready for review
October 30, 2026 15:52
alongosz
approved these changes
Oct 30, 2026
…hema alignment test MySQL can't store a default on a TEXT or BLOB column, so DBAL creates the column without the declared one. DBAL 2.13 left the difference out of its ALTER statements; DBAL 3's comparator reports it as 'ALTER TABLE ibexa_catalog CHANGE query_string query_string LONGTEXT NOT NULL', which changes nothing. MariaDB stores the default, so it's still compared there.
Steveb-p
force-pushed
the
fix/mysql-text-default-5.0
branch
from
November 3, 2026 11:18
cc7a32c to
0a065f1
Compare
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.
Note
Stacked on #81. Review/land that one first, then this gets retargeted to
5.0.Description:
On 5.0,
SchemaAlignmentTestfails on MySQL in every package whose kernel includes product-catalog, on both install paths:product-catalog's
schema.yamldeclaresquery_stringastextwithdefault: ''. MySQL can't store a default on a TEXT or BLOB column, so DBAL creates the column without it (AbstractMySQLPlatform::getDefaultValueDeclarationSQL()), and the database reads it back without one. Both DBAL versions' comparators see that difference, but DBAL 2.13 then skipped it inMySqlPlatform::getAlterTableSQL()("Don't propagate default value changes for unsupported column types"). DBAL 3 doesn't, so the plain comparison gives anALTERthat changes nothing. That's why 4.6 never hit it.So there's a fifth rule,
ignoreTextDefaultOnMySql(): on MySQL the declared default of a TEXT/BLOB column is dropped before comparing. MariaDB stores such defaults (MariaDBPlatformoverrides that method), so it's still compared there - product-catalog'sAddMariaDbQueryStringDefaultMigrationrelies on that.I've also tried switching to DBAL 3's platform-aware comparator (
new Comparator($platform)+getAlterSchemaSQL()) instead. It does drop this one, but it reports a lot of new differences on MySQL and SQLite (VARCHAR columns,DC2Typecomments, a whole SQLite table rebuild), so a single rule seemed the lesser change.Like the other rules, the case is in
_fixtures/schema.yaml.SchemaAlignmentNormalizationTestnow tells MariaDB apart from MySQL (getName()calls bothmysql), and the unit test checks that MariaDB still reports a missing default.Checked locally: unit tests, PHPStan, CS, and the integration suite on SQLite, MySQL 8.0, MariaDB 10.11 and PostgreSQL 14. measurement's 4.6 → 5.0 merge-up passes on MySQL on both paths with it.
Needed by the 4.6 → 5.0 merge-ups whose kernels include product-catalog (cart, corporate-account, measurement, order-management, payment, product-catalog, shipping); their TEMPORARY
dependencies.jsonwill point here.For QA:
No QA required.
Documentation:
No documentation required.