Issue Bug Resolved

#110618Nightly mysql functional tests fail on JSON key order in NonDomainObjectPropertyPersistenceTest

Stefan Bürk 09/04/26, 06:42 updated 09/04/26, 08:20

Description

The nightly main pipeline https://git.typo3.org/typo3/CI/cms/-/pipelines/107791 fails in the jobs “functional mysql 8.0 php 8.5 min 2/6” and “functional mysql 8.4 php 8.5 max 2/6” with

bc. NonDomainObjectPropertyPersistenceTest::setNullableCoreTypeIsPersistedAsStringRepresentation
Failed asserting that two arrays are identical.

The test was added with #110205 (https://review.typo3.org/c/Packages/TYPO3.CMS/+/94797, merged as 301cec4179b). It persists a JSON value object with the keys “nullable” and “values” into a TCA type=json column and compares the decoded raw database value with assertSame, which also checks the key order.

MySQL 8 stores native JSON columns in a normalized binary format and returns object members sorted by key length and then by key name, so the row comes back as “values” followed by “nullable”. MariaDB, PostgreSQL and SQLite keep the insertion order. Pre-merge pipelines run sqlite, mariadb and postgres only, the mysql suites run in the nightly pipeline, therefore the failure surfaced after the merge.

The backports to 14.3 (https://review.typo3.org/c/Packages/TYPO3.CMS/+/95607) and 13.4 (https://review.typo3.org/c/Packages/TYPO3.CMS/+/95608) already compare the decoded array with assertEquals, which ignores the key order, plus a comment explaining the MySQL behaviour. The same change is needed on main.

Reviews 1