Nexcess Logo

Patch Applied in the di.xml file on Magento 2 Stores for MariaDB 10.5 Support

Knowledge Base Home

Notice anything different?

We've enhanced the appearance of our portal and we're working on updating screenshots. Things might look different, but the functionality remains the same.
July 01, 2022

On the 27th of June Nexcess enabled a patch change made to the dependency injection file in Magento core which is named di.xml.


The di.xml file is updated from a daily server cron so you do not have to modify the files since this is being taken care of automatically. The di.xml file change is a minor modification made to be able to support MariaDB 10.5.


The change was made to be able to support MariaDB in Magento 2 core since the application does not support MariaDB 10.5 at the moment. Magento open-source has an open GitHub repository issue related to supporting MariaDB 10.5.


If you are using version control for your Magento 2 store then it is possible to create a patch file that can be included in your composer.json file.


To create a composer patch, you will need to generate diff outputs yourself. The reason for this is to ensure that the index ID in the resulting patch file matches up properly (using mine won’t work). Here is the diff output for app/etc/di.xml, along with the command to generate it. You will need to run this git diff command on your di.xml file AFTER the cron has modified it and BEFORE they reset it back to the original content in order to generate similar output:


$ git diff app/etc/di.xml

diff --git a/app/etc/di.xml b/app/etc/di.xml

index 8605485..043cf12 100644

--- a/app/etc/di.xml

+++ b/app/etc/di.xml

@@ -1834,7 +1834,7 @@

             <argument name="supportedVersionPatterns" xsi:type="array">

                 <item name="MySQL-8" xsi:type="string">^8\.0\.</item>

                 <item name="MySQL-5.7" xsi:type="string">^5\.7\.</item>

-                <item name="MariaDB-(10.2-10.4)" xsi:type="string">^10\.[2-4]\.</item>

+                <item name="MariaDB-(10.2-10.5)" xsi:type="string">^10\.[2-5]\.</item>

             </argument>

         </arguments>

     </type>


The relative path for the patch to include would be similar to this example if you have created the patch from the root of the Magento store installed on the server;


git diff app/etc/di.xml > ~/di_xml.patch


MariaDB 10.5 offers improved database performance for your Magneto 2 store. For 24-hour assistance any day of the year, contact our support team by email or through your Client Portal.


Useful Links

https://developer.adobe.com/commerce/php/development/build/dependency-injection-file/

https://github.com/magento/magento2/issues/31109

https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements.html

https://mariadb.com/kb/en/changes-improvements-in-mariadb-105/

https://www.atlassian.com/git/tutorials/saving-changes/git-diff

https://getcomposer.org/doc/01-basic-usage.md

Luke Cavanagh
Luke Cavanagh

Luke Cavanagh, Strategic Support & Accelerant at Liquid Web, brings a decade of experience working with WordPress and WooCommerce to our product team. His GitHub page offers a glimpse into his multiple areas of subject matter expertise.

"Ninja stuff with WordPress and WooCommerce," is an apropos way to describe Luke's savviness with these platforms — and his way of influencing our organization for improving to them.

Coming out of the University of Brighton with a Business and Technology Education Council (BTEC) Higher National Diploma (HND) in 2D & 3D Design, Luke's credentials prepared him well for his current role that blends both web development and design. His HND credential leveraged his foundational learning at West Kent College, where is received a National Diploma (ND) in Graphic Design.

In his personal life, Luke is a devoted husband and teen wrangler. He considers himself a Synthwave enthusiast, Jerry Goldsmith fan, and Doctor Who aficionado. He is happy to introduce his friends and teammates to essential vocabulary for life found only in British English, such as "gubbins" and similar terms.

We use cookies to understand how you interact with our site, to personalize and streamline your experience, and to tailor advertising. By continuing to use our site, you accept our use of cookies and accept our Privacy Policy.