Add MySQL 8.4 support and fix compatibility problem #20624
Open
mivancic wants to merge 1 commit intoakeneo:mainfrom
Open
Add MySQL 8.4 support and fix compatibility problem #20624mivancic wants to merge 1 commit intoakeneo:mainfrom
mivancic wants to merge 1 commit intoakeneo:mainfrom
Conversation
MySQL 8.0 EOL is April 2026. Upgrade docker-compose to MySQL 8.4.8 and fix DATETIME type promotion that breaks Elasticsearch product indexing.
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.
MySQL 8.0 reaches End of Life in April 2026. This fix allows upgrading to MySQL 8.4.8 with existing database schemas without breaking Elasticsearch product indexing.
Problem
On MySQL 8.4, saving or indexing products/product models fails with:
Could not convert database value "2026-03-20 12:08:24.000000" to Doctrine Type datetime_immutable. Expected format: Y-m-d H:i:s
Root Cause
MySQL 8.4 changed type coercion rules. When
GREATEST()receives a mix ofDATETIMEandINTEGERarguments, the result is promoted toDATETIME(6), appending.000000microseconds.MySQL 8.0 returned plain
DATETIMEin the same scenario.The affected queries use
COALESCE(nullable_datetime_col, 0)where the integer0acts as a fallback for NULL:UTCDateTimeImmutableType then fails to parse the value because DateTimeImmutable::createFromFormat('Y-m-d H:i:s', '2026-03-20 12:08:24.000000') returns false due to trailing data.
Fix
Replace the integer 0 fallback with the row's own updated column, keeping all GREATEST() arguments as DATETIME:
Semantically identical. When the parent is NULL, COALESCE returns product.updated, which can never win against itself in GREATEST().
Files Changed
How to Reproduce
Related
There are additional hardening changes that could improve MySQL 8.4 compatibility as a safety net.
UTCDateTimeImmutableTypeandUTCDateTimeTypecould be updated to fall back toY-m-d H:i:s.uformat when parsing fails, protecting against any other queries that might produceDATETIME(6)values on MySQL 8.4. This will be submitted as a separate PR #20625