From cefcd5bbadf2a8c8cb8c97049a478964ebddb95e Mon Sep 17 00:00:00 2001 From: Romain Naour Date: Tue, 30 Apr 2024 22:47:44 +0200 Subject: [PATCH] package/perl-dbd-mysql: fix runtime issue with MariaDB Now that the TestPerlDBDmysql can be run normally, a new runtime issue appear due to switch from oracle-mysql to MariaDB: # perl -MDBI -e '1' # echo $? 0 # perl -MDBD::mysql -e '1' Can't load '/usr/lib/perl5/site_perl/5.38.2/arm-linux/auto/DBD/mysql/mysql.so' for module DBD::mysql: /usr/lib/perl5/site_perl/5.38.2/arm-linux/auto/DBD/mysql/mysql.so: undefined symbol: net_buffer_length at /usr/lib/perl5/5.38.2/arm-linux/DynaLoader.pm line 206. This is fixed by an upstream commit [1] from 4.046_01 release. [1] https://github.com/perl5-dbi/DBD-mysql/commit/0f0cebe87fab335873fd3701bc304922da826940 Fixes: https://gitlab.com/buildroot.org/buildroot/-/jobs/6735654506 Signed-off-by: Romain Naour Signed-off-by: Thomas Petazzoni --- ...net_buffer_length-macro-if-available.patch | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 package/perl-dbd-mysql/0001-Use-net_buffer_length-macro-if-available.patch diff --git a/package/perl-dbd-mysql/0001-Use-net_buffer_length-macro-if-available.patch b/package/perl-dbd-mysql/0001-Use-net_buffer_length-macro-if-available.patch new file mode 100644 index 0000000000..d7767c1f42 --- /dev/null +++ b/package/perl-dbd-mysql/0001-Use-net_buffer_length-macro-if-available.patch @@ -0,0 +1,41 @@ +From 9189ef77679c22de3bbd2142031858373236520b Mon Sep 17 00:00:00 2001 +From: Michiel Beijen +Date: Fri, 23 Feb 2018 07:52:33 +0000 +Subject: [PATCH] Use net_buffer_length macro if available + +Upstream: https://github.com/perl5-dbi/DBD-mysql/commit/0f0cebe87fab335873fd3701bc304922da826940 + +(cherry picked from commit 0f0cebe87fab335873fd3701bc304922da826940) +Signed-off-by: Romain Naour +--- + mysql.xs | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +diff --git a/mysql.xs b/mysql.xs +index 8edee55..9b4d60f 100644 +--- a/mysql.xs ++++ b/mysql.xs +@@ -819,15 +819,14 @@ dbd_mysql_get_info(dbh, sql_info_type) + retsv = newSVpvn("`", 1); + break; + case SQL_MAXIMUM_STATEMENT_LENGTH: +-#if !defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 50709 +- /* MariaDB 10 is not MySQL source level compatible so this +- only applies to MySQL*/ +- /* mysql_get_option() was added in mysql 5.7.3 */ +- /* MYSQL_OPT_NET_BUFFER_LENGTH was added in mysql 5.7.9 */ ++ /* net_buffer_length macro is not defined in MySQL 5.7 and some MariaDB ++ versions - if it is not available, use newer mysql_get_option */ ++#if !defined(net_buffer_length) ++ ; ++ unsigned long buffer_len; + mysql_get_option(NULL, MYSQL_OPT_NET_BUFFER_LENGTH, &buffer_len); + retsv = newSViv(buffer_len); + #else +- /* before mysql 5.7.9 use net_buffer_length macro */ + retsv = newSViv(net_buffer_length); + #endif + break; +-- +2.44.0 +