DBD-mysql
DBD-mysql copied to clipboard
mysql.so is compiled with a specific MySQL flavor and version
Multiple places are checking MYSQL_VERSION_ID or MARIADB_BASE_VERSION to provide different implementations of a function.
So it appears that once you have compiled your DBD::mysql driver against a specific version then you might have "surprises" using the driver to connect to an older/newer server.
We were under the assumption that we could use DBD::mysql to connect to multiple version of servers.
This, for example, is one of the changes made to shutdown db47688a4465f3cc4c2f1daf4aeb12ec259b0c73 which was introduced in MySQL 5.7.9
When mysql.so is compiled with a 5.7.9 version once used with a 5.6 server.... it will raise an error.
The shutdown function does not appear to be the only one affected by this.
See #56 for an example of where this change went in.
I discovered this while using the func function with a MySQL 5.6 server whereas the driver was compiled with the mariadb-connector from https://downloads.mariadb.org/connector-c/3.0.3/
$dbh->func( 'shutdown', 'admin' );
which raises this exception from the server
The system received an error from the “MySQL” database “mysql”: ER_PARSE_ERROR (You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SHUTDOWN' at line 1)
Hi! Some of those problems are or would be fixed in DBD::MariaDB. If you have a full testable reproducer against DBD::MariaDB, please fill a issue to https://github.com/gooddata/DBD-MariaDB project and we will look at it.
Can you tell me if this client is compatible to connect to mysql and mariadb servers 4.x and above?
DBD::MariaDB is still under development, please read https://www.nntp.perl.org/group/perl.dbi.users/2018/01/msg37584.html and https://www.nntp.perl.org/group/perl.dbi.users/2018/01/msg37586.html Travis tests for MySQL 4.1 passes; new MariaDB 10.2 and 10.3 too.
Reviewing the code changes in https://github.com/gooddata/DBD-MariaDB, the issue was fixed by removing func as a valid feature of the driver. Possibly the same disclaimer should be added to the DBD::mysql client that it only works with servers of the same type? Either that or remove support for the func method call.
indeed looks like DBD::MariaDB simply removed support for that internal 'admin' helper, which solved the issue lol view: https://github.com/gooddata/DBD-MariaDB/commit/1ece8cd071c87d875c17a98bdb4c0fcb1f235a12
thanks @pali for all this work, looking forward to use DBD::MariaDB in the future
Yes, admin method was removed because it was deprecated (see commit e35a6284602900c4085d1f82d34756977684defb) and replaced by calling SQL statements. I'm cleaning up old and deprecated code. But as I said, if you have reproducer for some bug (or missing feature), please fill an issue and we will look at it.
The matrix of supported client libraries has been reduced in master, which should fix this issue as well.