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

Add MariaDB compatibility tests #7198

Closed
wants to merge 5 commits into from

Conversation

hashhar
Copy link
Member

@hashhar hashhar commented Mar 7, 2021

Some duplication can be removed by adding a common base class for TestingMySqlServer and TestingMariaDBServer.

This will allow to remove the MariaDBQueryRunner but the amount of code overall ends up being similar so I left it as is.

Note that we are running the entire BaseConnectorTest against MariaDB to ensure compatibility (e.g. older versions of MariaDB had a different rename column syntax which won't be caught with the smoke tests).

@cla-bot cla-bot bot added the cla-signed label Mar 7, 2021
@hashhar
Copy link
Member Author

hashhar commented Mar 7, 2021

This change should allow us to safely upgrade our MySQL driver version without worrying about breaking compatibility unknowingly.

Comment on lines 91 to 92
// The connection URL is still using mysql to ensure we test MariaDB compatibility with the MySQL connector
return format("jdbc:mysql://%s:%s?useSSL=false&allowPublicKeyRetrieval=true", container.getContainerIpAddress(), container.getMappedPort(3306));
Copy link
Member

Choose a reason for hiding this comment

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

I hope that, using mariadb would fail to connect (the connector shouldn't use DriverManager to make the connection)

Copy link
Member Author

Choose a reason for hiding this comment

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

It fails. But there isn't an explicit test added for it yet.

@findepi
Copy link
Member

findepi commented Mar 8, 2021

I am wondering that maybe we should add mariadb as a seaprate connector (same as mysql connector today), this would allow future compatibility, if eg we need to use different driver for MySQL and MariaDB or there are any other changes.

@findepi
Copy link
Member

findepi commented Mar 8, 2021

Should we run type mapping tests agains MariaDB as well, per #6910 (comment) ?

@findepi
Copy link
Member

findepi commented Apr 7, 2021

Let's go with current approach, i.e. without separate plugin code, except

  • run type mapping tests against MariaDB as well
  • add second ConnectorFactory with mariadb name
    • once done, we need to reflect this in docs somehow
  • add a product test exercising the mariadb connector

@hashhar
Copy link
Member Author

hashhar commented Apr 7, 2021

I'll do each of those over the coming weekend. 👍

@hashhar hashhar force-pushed the hashhar/mariadb-tests branch from 05c76a8 to 3964fa8 Compare April 11, 2021 13:58
@hashhar
Copy link
Member Author

hashhar commented Apr 11, 2021

After all - MariaDB isn't very compatible with the MySQL client @findepi . 😞

There are two issues:

  • MariaDB doesn't have a proper JSON type. It aliases JSON to LONGTEXT and hence the type mappings in MySqlClient for JSON don't work for MariaDB.
  • MariaDB declares it's version as lower than 5.6.4 which causes MySQL driver to think that it doesn't support fractional seconds in temporal types (MySQL 5.6.4 was the first version to support them). This sadly has no solution other than using the MariaDB driver instead of MySQL driver. See https://issues.alfresco.com/jira/browse/MNT-17613 for a more detailed report.

@martint
Copy link
Member

martint commented Apr 11, 2021

That’s a strong argument for having a separate connector for mariadb

@hashhar
Copy link
Member Author

hashhar commented Dec 7, 2021

Superseded by #10046 which adds a dedicated MariaDB connector.

@hashhar hashhar closed this Dec 7, 2021
@hashhar hashhar deleted the hashhar/mariadb-tests branch December 7, 2021 07:35
@hashhar hashhar mentioned this pull request Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

3 participants