Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MariaDB & Doctrine DBAL 4 support #113

Open
eiderdaus opened this issue Jan 20, 2025 · 1 comment
Open

MariaDB & Doctrine DBAL 4 support #113

eiderdaus opened this issue Jan 20, 2025 · 1 comment

Comments

@eiderdaus
Copy link

MariaDB does not work when I use the doctrine-extensions and DBAL 4. In this combination, the following check in src/Oro/ORM/Query/AST/FunctionFactory.php fails:

    if ($platform instanceof PostgreSQLPlatform) {
        $platformName = 'postgresql';
    } elseif ($platform instanceof MySQLPlatform) {
        $platformName = 'mysql';
    } else {
        throw QueryException::syntaxError(
            \sprintf(
                'Not supported platform "%s"',
                $platform::class
            )
        );
    }

I get the error:

[Syntax Error] Not supported platform "Doctrine\DBAL\Platforms\MariaDB1052Platform"

It is because since DBAL 4, MariaDBPlatform does not extend MySQLPlatform anymore, but from AbstractMySQLPlatform.

Since DBAL 3, MySQLPlatform always extends from AbstractMySQLPlatform, so simply checking $platform instanceof AbstractMySQLPlatform instead of $platform instanceof MySQLPlatform should fix this for DBAL 4 and not break DBAL 3 at the same time.

Other than that, I had great success when testing the master branch! Probably after fixing this issue, an official release would be greatly appreciated :)

@tups
Copy link

tups commented Jan 23, 2025

Thank you for reporting this issue and providing the patch! I've created a PR here: #115

Now we'll need to wait for a maintainer to review it. I'm also experiencing this issue in my current project, so I'm hoping it gets reviewed soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants