dbal: Bug with server_version for MariaDB >10.2.7

Hello,

I think there is a problem when providing the server_version parameter.

when having a server_version set to 10.2.12, the bug discussed here is still present. (it generates endless migrations diff)

When removing the server_version parameter, it works as excepted.

doctrine:
    dbal:
        default_connection: default
        connections:
            default:
                server_version: "%database_server_version%"  // << resolves to 10.2.12

We also tried

doctrine:
    dbal:
        default_connection: default
        connections:
            default:
                server_version: 10.2.12 

Could it be that the excepted version is something else than 10.2.x ?

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 41 (20 by maintainers)

Commits related to this issue

Most upvoted comments

As pointed out by @Majkl578, For MariaDB, the correct serverVersion is mariadb-x.x.x You can check the condition there: https://github.com/doctrine/dbal/blob/f76bf5ef631cec551a86c2291fc749534febebf1/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php#L135

Putting mariadb-10.2.12 for serverVersion is WORKING ! 👍🎉 Now i’m going to try to fix it in the docs because all mariaDB ppl are doing it wrong 😄

For me on doctrine v2.6.1 (with Symfony) we need a server_version of 10.2.14-mariadb (so the mariadb bit at the end, not the beginning. I hope this helps others.

Yes, MariaDB is only supported with dbal >= 2.7

Just locally inspected the repository mentioned above. The config file is parsed in bootstrap.php and then only passed as already-loaded PHP array. In both “with-quotes” and “without-quotes” branches the value of serverVersion is parsed as 10.2.12 string without quotes. Since the config loading is out of DBAL’s scope, this looks like a bug in some upper layer.

Updated, now it’s when I don’t specify serverVersion that everything works

@Kocal BTW, it seems you are using “server_version” parameter in your test, but isn’t the correct naming serverVersion?

Doctrine bundle in symfony translates server_version to serverVersion.