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

Forward compatibility for MySQL-like platforms #5098

Merged
merged 1 commit into from Dec 7, 2021

Conversation

morozov
Copy link
Member

@morozov morozov commented Dec 7, 2021

Q A
Type improvement
BC Break yes

After the deprecation in #5072, the code from the MySQL57Platform class will be merged into MySQLPlatform. Doing this without any additional changes would break the logic of MariaDB1027Platform which extends MySQLPlatform: 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:

  1. 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.
  2. MariaDBPlatform will provide the implementation compatible with the oldest supported version of MariaDB. Currently marked as abstract, it will be made concrete in 4.0.x.
  3. Inject AbstractMySQLPlatform between AbstractPlatform and MySQLPlatform.
  4. Inject MariaDBPlatform between MySQLPlatform and MariaDb1027Platform.

In 4.0.x, we will change the inheritance chain from MariaDBPlatform extends MySQLPlatform to MariaDBPlatform extends AbstractMySQLPlatform and thus will be able to merge the code from MySQL57Platform into MySQLPlatform.

Additionally, for MariaDB older than 10.2.7, instead of returning an instance of MySQLPlatform, the driver will have to return MariaDBPlatform.

Before:

 classDiagram
      MySQLPlatform <|-- MySQL57Platform
      MySQLPlatform <|-- MariaDB1027Platform
      MySQL57Platform <|-- MySQL80Platform

After:

classDiagram
      AbstractMySQLPlatform <|-- MySQLPlatform
      AbstractMySQLPlatform <|-- MariaDBPlatform
      MariaDBPlatform <|-- MariaDB1027Platform
      MySQLPlatform <|-- MySQL80Platform

@morozov morozov added this to the 3.3.0 milestone Dec 7, 2021
@morozov morozov marked this pull request as ready for review December 7, 2021 01:31
Copy link
Member

@greg0ire greg0ire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a blocker: it might be good to harmonize calls to markTestSkipped and have them mention MariaDB as well.

@morozov morozov merged commit b0ee6a5 into doctrine:3.3.x Dec 7, 2021
@morozov morozov deleted the mysql-forward-compatibility branch December 7, 2021 16:07
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants