You are currently viewing TYPO3 v8 and MariaDB 10.2.7+

TYPO3 v8 and MariaDB 10.2.7+

Recently several enquires reached me at work from customers, whether TYPO3 Version 8 is compatible with MariaDB version 10.2.7 and above. There are several bug reports on TYPO3 forge. In this post I will explain the details, why it will not work.

Maria DB version 10.2

MariaDB aims to be a drop-in replacement for mySQL, where each version of MariaDB corresponds to a certain mySQL version. According the official compatibility list this is / should be the case.

With version 10.2.7 and above MariaDB solved a bug in the implementation of the SQL standard. (https://jira.mariadb.org/browse/MDEV-13132). Basically that means that MariaDB returns now 'NULL' (with quotes) instead of NULL.
This had severe consequences for Doctrine DBAL and projects using it. I found several other projects, like dbForge, that have to deal with this issue.

Doctrine DBAL

Doctrine DBAL handles the database layer between TYPO3 and the underlying database. TYPO3 version 8 requires the Doctrine DBAL version with contraints set to “~2.5.4”. The developers of Doctrine DBAL fixed the issue in the branch 2.7.

An upgrade of the the dbal library for TYPO3 core is not possible because the current Doctrine DBAL versions require php 7.1 or higher to run. TYPO3 v8 needs to run also on installations using php 7.0, so it could (aka will) break. This means basically, the “issue” will remain until the end of live of TYPO3 v8 LTS.

By the way: MariaDB is not mentioned at all in the requirements for TYPO3. Thus we cannot demand that our CMS had to run with MariaDB 10.2.7 or higher.

How to deal with it?

Use MariaDB 10.2.6 or below

If you can make sure, that the database engine will not be upgraded to 10.2.7 or higher, you can use MariaDB version 10.2, 10.1 or 10.0. The latter versions will not get the breaking change coming with 10.2.7.

Use mySQL 5.7 or below

As mySQL 5.7 is officially supported by TYPO3 version 8, you can also use it. Maybe it is the best way to go.

RISKY: Use a doctrine/dbal version compatible MariaDB >= 10.2.7

Be aware, that this is a really risky way to go. If you decide to go, this way, you need to test your installation very intensively.

There are two prerequisites:

  • The installation must already use php 7.1
  • It must be composer based

To achieve this you must add the doctrine/dbal package as a root requirement to your projects composer.json.

composer require doctrine/dbal 2.5.13

Afterwards look for the line where doctrine/dbal is set and change the version requirements to
"doctrine/dbal": "2.7.2 as 2.5.13"

and run a
composer update doctrine/dbal --with-dependencies

After that the new package is installed and the installation should work with MariaDB with versions 10.2.7 and above. Nevertheless you need to test, test, test the website completely. If I say completely, I mean completely … each page, each plugin what you can imagine. Even if it might look good at the first sight, it may break anywhere in the system.

Update: Run functional the tests, TYPO3 provides

I did some tests in order to prove, if it will be save to use the new doctrine dbal library together. First I ran the functional tests of TYPO3 using the default doctrine/dbal library as shipped with TYPO3. As expected some tests failed. The three failing tests were:

  • TYPO3\CMS\Core\Tests\Functional\Database\Schema\SchemaMigratorTest::changeExistingColumn
  • TYPO3\CMS\Core\Tests\Functional\Database\Schema\SchemaMigratorTest::defaultNullWithoutNotNull and
  • TYPO3\CMS\Core\Tests\Functional\Database\Schema\SchemaMigratorTest::installPerformsOnlyAddAndCreateOperations

After updating to doctrine/dbal version 2.7.2 as described above, all functional tests were green. :-)

So I consider it a bit more save to switch to the newer doctrine/dbal package, if your infrastructure allows it.

To make it clear: This idea is no recommendation, how to deal with the topic. You cannot take me into account, if your website breaks. You have been warned!!

Conclusion

There is no easy way out of that dilemma. The best is to stay with the database versions, which are definitely confirmed to work with TYPO3, which is in this context MySQL version 5.7 and below. The last possible solution is just an idea, which seems to work on my local system.

Credits

I want to thank all patrons, who did not remove their pledges from https://www.patreon.com in the last months, even I did notify them, about the future of this blog. Thank you very much!

I found the blog post image on https://unsplash.com/photos/6BVinN0Y7Xk by https://unsplash.com/@the_roaming_platypus.

This Post Has 4 Comments

  1. Anonymous

    5

  2. Arne

    Hallo,

    ich habe das ohne composer gemacht und einfach unter vendor/doctrine/dbal die Version 2.7.2 kopiert (https://www.doctrine-project.org/projects/dbal.html) und damit die Version 2.5 ersetzt. Ein Update eine installation von 7.6 auf 8.7 inkl. convert tt_news nach tx_news liefen damit ohne Fehler.

    Gruß Arne

  3. Anonymous

    4.5

Leave a Reply