Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,18 @@ assert_lib(
LIBS => $opt->{libs},
);

print "Looks good.\n\n";
if ($opt->{libs} =~ /mariadb/) {
print <<"MSG";

The chosen MySQL client library appears to be MariaDB's. Compilation may fail.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
The chosen MySQL client library appears to be MariaDB's. Compilation may fail.
The chosen MySQL client library appears to be MariaDB's. DBD::mysql doesn't support building against a MariaDB client library.

I like this method as it doesn't rely on versions to detect MariaDB (>= 10.0 ) or MySQL (< 10.0) which can be very useful if in the future Oracle would release a MySQL 10.x (Not unlikely, see the diagram on this blog post )

Copy link
Collaborator

@dveeden dveeden Oct 25, 2024

Choose a reason for hiding this comment

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

Not sure what the best text/info is here.

  • DBD::mysql requires an Oracle MySQL client library. As the MariaDB client library presents itself as MySQL client library this can be confusing to users. This might get better in the future as mysql_config is in libmariadb-dev-compat and is optional (at least on Ubuntu 20.04).
  • DBD::mysql build with a Oracle MySQL client library can be used to connect to MariaDB.
  • Alternatives are DBD::MariaDB and DBD::mysql v4.x. I think only listing the first one (as you did) is probably best, but I'm not sure.
  • The MySQL client library must be 8.0 or newer
  • Maybe return info on how it was determined to be MariaDB (mysql_config --libs matched mariadb) to make it easier for people to troubleshoot.
  • On bookworm the MySQL APT Repository can be used. Debian sid has Oracle MySQL iirc. (I know this doesn't help with native Debian packages)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've kept the text descriptive of the behaviour.

Suggesting Oracle's library seems like good advice. Recommending sticking with 4.x might age badly.

It's not unreasonable for someone to want to use this module with MariaDB. DBD::MariaDB has Unicode fixes that might break your application.

Consider DBD::MariaDB or installing Oracle's MySQL client library.


MSG
}
else {
print "Looks good.\n\n";
}

sleep 1;

Expand Down Expand Up @@ -250,7 +261,7 @@ if (eval $ExtUtils::MakeMaker::VERSION >= 5.43) {
'Damyan Ivanov <dmn@debian.org>',
'Dan Book <grinnz@gmail.com>',
'Daniël van Eeden <daniel.vaneeden@booking.com>',
'Dave Lambley <davel@isosceles.(none)>',
'Dave Lambley <dave@lambley.me.uk>',
'David Farrell <davidnmfarrell@gmail.com>',
'David Steinbrunner <dsteinbrunner@pobox.com>',
'Giovanni Bechis <giovanni@bigio.snb.it>',
Expand Down Expand Up @@ -447,7 +458,7 @@ sub Configure {
}

if ($param eq 'version') {
if ($str !~ /^[89]\./) {
if ((split(/\./, $str, 2))[0] < 8) {
die "DBD::mysql requires MySQL 8.x or newer for building. Version reported by $command: $str";
}
}
Expand Down