Forward compatibility for MySQL-like platforms #5098
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After the deprecation in #5072, the code from the
MySQL57Platform
class will be merged intoMySQLPlatform
. Doing this without any additional changes would break the logic ofMariaDB1027Platform
which extendsMySQLPlatform
: instead of inheriting the implementation compatible with MySQL 5.0...5.6, it would inherit the implementation for MySQL 5.7 which MariaDB 10.2 isn't compatible with.In order to provide better forward compatibility and have a consistent naming of the platform classes, we need to introduce new classes in the MySQL platform hierarchy:
abstract AbstractMySQLPlatform
. This one will be the root of the hierarchy and will provide the implementation that works for the oldest supported version of Oracle MySQL and MariaDB.MariaDBPlatform
will provide the implementation compatible with the oldest supported version of MariaDB. Currently marked as abstract, it will be made concrete in4.0.x
.AbstractMySQLPlatform
betweenAbstractPlatform
andMySQLPlatform
.MariaDBPlatform
betweenMySQLPlatform
andMariaDb1027Platform
.In
4.0.x
, we will change the inheritance chain fromMariaDBPlatform extends MySQLPlatform
toMariaDBPlatform extends AbstractMySQLPlatform
and thus will be able to merge the code fromMySQL57Platform
intoMySQLPlatform
.Additionally, for MariaDB older than 10.2.7, instead of returning an instance of
MySQLPlatform
, the driver will have to returnMariaDBPlatform
.Before:
After: