You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I configure the MySQL version to 8.4 statically to avoid dynamic detection with an extra DB query, the driver class is selected incorrectly. DBAL selects the MySQL80Platform instead of MySQL84Platform.
Current behavior
DBAL selects the MySQL80Platform instead of MySQL84Platform.
Expected behavior
DBAL selects the MySQL84Platform.
How to reproduce
Configure DSN with the serverVersion=8.4 parameter.
Context:
I want to configure my project to work with any 8.4 db version. I don't want to track a specific version that the project is running against. It may run against different patch versions on different deployments (local, staging, prod). So I expect DBAL understand the 8.4 static version configuration. The simplest workaround is to specify a fake full version as mentioned in the documentation:
Please specify the full server version as the database server would report it. This is especially important for MySQL and MariaDB where the full version string is taken into account when determining the platform.
But this is not true. The patch part of the version in fact, does NOT affect the driver selection. I can pass ANY patch version, and only the minor version will be taken into account:
if (version_compare($version, '8.4.0', '>=')) {
returnnewMySQL84Platform();
}
if (version_compare($version, '8.0.0', '>=')) {
returnnewMySQL80Platform();
}
I.e. if I pass version number 8.4.0 or 8.4.9999999 - the result will be the same, the MySQL84Platform class will be selected. So why should users pass the full version instead of simply major and minor? Is the requirement to pass the full version something legacy?
The text was updated successfully, but these errors were encountered:
Proposal
Summary
If I configure the MySQL version to
8.4
statically to avoid dynamic detection with an extra DB query, the driver class is selected incorrectly. DBAL selects theMySQL80Platform
instead ofMySQL84Platform
.Current behavior
DBAL selects the
MySQL80Platform
instead ofMySQL84Platform
.Expected behavior
DBAL selects the
MySQL84Platform
.How to reproduce
Configure DSN with the
serverVersion=8.4
parameter.Context:
I want to configure my project to work with any 8.4 db version. I don't want to track a specific version that the project is running against. It may run against different patch versions on different deployments (local, staging, prod). So I expect DBAL understand the
8.4
static version configuration. The simplest workaround is to specify a fake full version as mentioned in the documentation:But this is not true. The patch part of the version in fact, does NOT affect the driver selection. I can pass ANY patch version, and only the minor version will be taken into account:
I.e. if I pass version number
8.4.0
or8.4.9999999
- the result will be the same, theMySQL84Platform
class will be selected. So why should users pass the full version instead of simply major and minor? Is the requirement to pass the full version something legacy?The text was updated successfully, but these errors were encountered: