perl5-dbi/dbi

DBD::mysql and mariadb building

arto-p opened this issue · 5 comments

# make all
...
dbdimp.c: In function 'mysql_dr_connect':
/usr/include/mysql/mariadb_version-i386.h:14:31: error: token ""mariadb-10.3"" is not valid in preprocessor expressions
 #define MARIADB_BASE_VERSION  "mariadb-10.3"
                               ^~~~~~~~~~~~~~
dbdimp.c:1910:56: note: in expansion of macro 'MARIADB_BASE_VERSION'
 #if (MYSQL_VERSION_ID >= 50723) && (MYSQL_VERSION_ID < MARIADB_BASE_VERSION)
                                                        ^~~~~~~~~~~~~~~~~~~~
/usr/include/mysql/mariadb_version-i386.h:14:31: error: token ""mariadb-10.3"" is not valid in preprocessor expressions
 #define MARIADB_BASE_VERSION  "mariadb-10.3"
                               ^~~~~~~~~~~~~~
dbdimp.c:1917:56: note: in expansion of macro 'MARIADB_BASE_VERSION'
 #if (MYSQL_VERSION_ID >= 50600) && (MYSQL_VERSION_ID < MARIADB_BASE_VERSION)

I think You shuld use MARIADB_VERSION_ID instad of MARIADB_BASE_VERSION there.

Patch:

--- dbdimp.c.orig    2018-09-19 13:13:58.262356606 +0300
+++ dbdimp.c    2018-09-19 13:17:07.646319186 +0300
@@ -1907,14 +1907,14 @@
                          (SvTRUE(*svp) ? "utf8" : "latin1"));
         }
 
-#if (MYSQL_VERSION_ID >= 50723) && (MYSQL_VERSION_ID < MARIADB_BASE_VERSION)
+#if (MYSQL_VERSION_ID >= 50723) && (MYSQL_VERSION_ID < MARIADB_VERSION_ID)
         if ((svp = hv_fetch(hv, "mysql_get_server_pubkey", 23, FALSE)) && *svp && SvTRUE(*svp)) {
           my_bool server_get_pubkey = 1;
           mysql_options(sock, MYSQL_OPT_GET_SERVER_PUBLIC_KEY, &server_get_pubkey);
         }
 #endif
 
-#if (MYSQL_VERSION_ID >= 50600) && (MYSQL_VERSION_ID < MARIADB_BASE_VERSION)
+#if (MYSQL_VERSION_ID >= 50600) && (MYSQL_VERSION_ID < MARIADB_VERSION_ID)
         if ((svp = hv_fetch(hv, "mysql_server_pubkey", 19, FALSE)) && *svp) {
           STRLEN plen;
           char *server_pubkey = SvPV(*svp, plen);
pali commented

DBD::mysql driver has known problems with (new version of) MariaDB clients. You can look at DBD::MariaDB driver https://metacpan.org/pod/DBD::MariaDB which is properly tested with lot of new MariaDB versions https://travis-ci.org/gooddata/DBD-MariaDB

This was fixed in DBD::mysql.
Please report DBD::mysql bugs int the DBD-mysql github project.
I think this issue should be closed.

@timbunce could you close this?

Tux commented

I'll do it :)