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
- Fix incorrect use of serverVersion for MariaDB This small change fixes 2 things: 1/ Incorrect use of `serverVersion` for MariaDB, which *must* be prefixed with `mariadb-`, see: https://github.com/... — committed to tristanbes/symfonyflex-bridge by tristanbes 6 years ago
- minor #9547 Add a note about correct cfg value server_version for MariaDB (tristanbes) This PR was squashed before being merged into the 2.7 branch (closes #9547). Discussion ---------- Add a note ... — committed to symfony/symfony-docs by javiereguiluz 6 years ago
As pointed out by @Majkl578, For MariaDB, the correct
serverVersion
ismariadb-x.x.x
You can check the condition there: https://github.com/doctrine/dbal/blob/f76bf5ef631cec551a86c2291fc749534febebf1/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php#L135Putting
mariadb-10.2.12
forserverVersion
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
of10.2.14-mariadb
(so themariadb
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 ofserverVersion
is parsed as10.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.
@Kocal you didnât require
doctrine/dbal master
, (see https://github.com/Kocal/project-doctrine-migrations-and-mariadb-issues/blob/master/composer.json#L3)