Adobe Commerce B2B upgrade issue 'REGEXP_LIKE does not exist'

If you’re using Adobe’s B2B extension and recently tried upgrading then you likely hit this issue:

W: Unable to apply data patch Magento\Company\Setup\Patch\Data\SetComp
W: anyForStructure for module Magento_Company. Original exception message: SQL
W: STATE[42000]: Syntax error or access violation: 1305 FUNCTION abcdefghijk
W: .REGEXP_LIKE does not exist, query was: UPDATE `company_structure` SET `com
W: pany_id`
= ? WHERE (REGEXP_LIKE(path, '^7(/.+)?$'))

I sent this in to Adobe’s Cloud support and got this Absolute gem of a response from support:


We investigated this further and please find more details regarding this error below:

W: Unable to apply data patch Magento\Company\Setup\Patch\Data\SetComp
W: anyForStructure for module Magento_Company. Original exception message: SQL
W: STATE[42000]: Syntax error or access violation: 1305 FUNCTION abcdefghijk
W: .REGEXP_LIKE does not exist, query was: UPDATE company_structure SET com W: pany_id = ? WHERE (REGEXP_LIKE(path, ‘^7(/.+)?$’))

The Adobe Commerce version 2.4.6-p10 uses the function “REGEXP_LIKE” in the file \Magento\Company\Setup\Patch\Data\SetCompanyForStructure.

The function “REGEXP_LIKE” is not supported in hashtag MariaDB which is the default Database used by Adobe Commerce.

No idea how this one got through QA.

If you pin the version of the B2B extension to 1.4.2-p3 it’ll work or you could patch out that function.