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

Run travis tests on different MySQL and MariaDB versions #85

Merged
merged 4 commits into from Jan 28, 2017

Conversation

pali
Copy link
Member

@pali pali commented Jan 17, 2017

Changes in this pull request:

  • Remember mysql_config value for Makefile.PL
  • Check if specified Makefile.PL settings are working
  • Run travis tests on different MySQL and MariaDB versions
  • Run travis tests also on perl versions with -Duseshrplib

Travis matrix contains different MySQL and MariaDB version, namely those
which are available in stable long term supported Linux distributions.

Config file is prepared for easily extending database server matrix once
new versions are released.

Travis downloads official MySQL or MariaDB binary tarball and uses
MySQL::Sandbox for starting database server. DBD::mysql is then compiled
against client provided by that tarball and pre-installed perl 5.20 by
Travis.

Other perl versions are tested against system pre-installed database
version as before.

@pali
Copy link
Member Author

pali commented Jan 17, 2017

(testing, so do not merge)

@pali pali force-pushed the tests branch 2 times, most recently from 7514e94 to 1cbaa08 Compare January 18, 2017 00:25
@pali pali mentioned this pull request Jan 18, 2017
@mbeijen
Copy link
Contributor

mbeijen commented Jan 19, 2017

I wanted to say I'm very happy by you trying to do this! It has been on my wishlist for a while.
I guess I told you before, I'm really not concerned about MySQL version 4 at all. If you can fix the test failure, great, but I would not mind you dropping it off your matrix either. It's SO old!

@pali
Copy link
Member Author

pali commented Jan 19, 2017

Apparently that 4.1 test in matrix show problems in driver code... so it was useful!

@pali
Copy link
Member Author

pali commented Jan 20, 2017

There are 3 problems:

  • Either Devel::CheckLib does not work on Windows or AppVeyor configuration is incorrect
  • DBD::mysql cannot be compiled with MariaDB 10.2.3 because MariaDB provides incorrect mysql_config binary which says to link with -lmysqlclient, but it does not provide any libmysqlclient.so (just libmariadbclient.so)
  • Test t/rt50304-column_info_parentheses.t does not pass with MySQL 8.0.0 and I have no idea why

@pali pali mentioned this pull request Jan 20, 2017
@pali
Copy link
Member Author

pali commented Jan 20, 2017

First problem is not in Devel::CheckLib nor AppVeyor, but in windows version of mysql.h. It used type SOCKET without including winsock.h, so including pure mysql.h cause compiler error: mysql.h:63:19: error: unknown type name 'SOCKET'. Going to fix it manually in Makefile.PL.

@pali
Copy link
Member Author

pali commented Jan 21, 2017

Third problem with test t/rt50304-column_info_parentheses.t and MySQL 8.0.0 is fixed. DESCRIBE did not function with temporary tables (like in older MySQL 5 versions).

@pali
Copy link
Member Author

pali commented Jan 21, 2017

Looks like last MariaDB version with working mysql_config script is 10.2.1. As mysql_config is required for automatic compilation all new versions with broken mysql_config cannot be used for DBD::mysql... I will remove new versions from matrix.

@mbeijen
Copy link
Contributor

mbeijen commented Jan 21, 2017

Hi Pali: why is the mysql_config script broken for MariaDB?

There seem to be lots of bugs for mysql_config in the MariaDB tracker:

https://jira.mariadb.org/browse/MDEV-9388?jql=text%20~%20%22mysql_config%22

@pali
Copy link
Member Author

pali commented Jan 21, 2017

Why? Because mysql_config --libs (from official tarball) outputs -lmysqlclient but in official mariadb binary tarballs (versions 10.2.2 and new) there is no libmysqlclient.so library. There is only libmariadb.so and libmariadbclient.a libraries.

@pali
Copy link
Member Author

pali commented Jan 21, 2017

You can look and compare build logs for MariaDB 10.2.1 (which is working fine) and MariaDB 10.2.2/10.2.3 (which fails in Makefile.PL):

10.2.1: https://travis-ci.org/perl5-dbi/DBD-mysql/jobs/193932892 (OK)
10.2.2: https://travis-ci.org/perl5-dbi/DBD-mysql/jobs/193932893 (FAIL)
10.2.3: https://travis-ci.org/perl5-dbi/DBD-mysql/jobs/193932894 (FAIL)

@mbeijen
Copy link
Contributor

mbeijen commented Jan 22, 2017

I created https://jira.mariadb.org/browse/MDEV-11872 for this.

@mbeijen
Copy link
Contributor

mbeijen commented Jan 23, 2017

So I merged #87. I think it's best to make a new PR with the .travis.yml and Makefile.PL changes from this PR, don't you think?

Use file t/mysql.mtest for storing that value. Also instead of checking
existence of filename in mysql_config, which does not have to be full path,
try to execute it with --version parameter.
ExtUtils::MakeMaker already checks if needed libraries are in system and
available for compiler. But if they are not present it just show warning:

 Warning (mostly harmless): No library found for -lmysqlclient

But missing libraries (like mysqlclient) are fatal as without it DBD::mysql
cannot be compiled. It looks like ExtUtils::MakeMaker cannot be switched to
from "harmless" mode to fatal so this patch check for needed libraries and
also header files via Devel::CheckLib module.

On Linux, gcc by default allows undefined symbols in shared libraries.
Libraries are generated successfully without any warning even when there
are missing some symbols. So auto/DBD/mysql/mysql.so can be compiled with
missing mysql symbols without any warning or error. But trying to call in
perl "use DBD::mysql" cause runtime perl error:

 Can't load 'auto/DBD/mysql/mysql.so' for module DBD::mysql:
 auto/DBD/mysql/mysql.so: undefined symbol: mysql_sqlstate at DynaLoader.pm

Rather depends on another module (Devel::CheckLib) at configure time
instead producing wrong mysql.so binary and throwing non-sense runtime
error messages.

Due to broken windows version of mysql.h we need to manually define type
SOCKET (which comes from winsock.h).

Fixes bug: https://rt.cpan.org/Ticket/Display.html?id=119902
Travis matrix contains different MySQL and MariaDB version, namely those
which are available in stable long term supported Linux distributions.

Config file is prepared for easily extending database server matrix once
new versions are released.

Travis downloads official MySQL or MariaDB binary tarball and uses
MySQL::Sandbox for starting database server. DBD::mysql is then compiled
against client provided by that tarball and pre-installed perl 5.20 by
Travis.

Other perl versions are tested against system pre-installed database
version as before.
Travis provides some perl versions compiled with -Duseshrplib so we can use
them for testing DBD::mysql.
@pali
Copy link
Member Author

pali commented Jan 23, 2017

I squashed commits and rebased on top of master branch.

Now this pull request is ready for review. Part of this pull request is now also checking if compiler can found & use mysqlclient library via external module Devel::CheckLib. Fixes bug: https://rt.cpan.org/Ticket/Display.html?id=119902

@pali
Copy link
Member Author

pali commented Jan 26, 2017

So for now MariaDB 10.2.2 and newer stay disabled and not used by Travis until upstream fix that problem.

@mbeijen mbeijen merged commit f951ec9 into perl5-dbi:master Jan 28, 2017
@pali pali deleted the tests branch January 28, 2017 18:50
@mbeijen
Copy link
Contributor

mbeijen commented Feb 15, 2017

MariaDB fix is committed here: MariaDB/server@8877f1c

@pali
Copy link
Member Author

pali commented Feb 19, 2017

Great! Seems it is working! And new MariaDB 10.2.4 with this fix was released, so we can add it into Travis matrix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants