[dev-perl/DBD-mysql] sync with whissi's PR

This commit is contained in:
Robert Förster 2019-08-28 19:22:00 +02:00
parent 13e756ec8b
commit e178297de2
3 changed files with 57 additions and 27 deletions

View File

@ -15,7 +15,8 @@ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~spa
IUSE="test +ssl" IUSE="test +ssl"
RDEPEND=">=dev-perl/DBI-1.609.0 RDEPEND=">=dev-perl/DBI-1.609.0
virtual/libmysqlclient:= >=dev-perl/Devel-CheckLib-1.109.0
dev-db/mysql-connector-c:=
" "
DEPEND="${RDEPEND} DEPEND="${RDEPEND}
virtual/perl-ExtUtils-MakeMaker virtual/perl-ExtUtils-MakeMaker
@ -28,7 +29,8 @@ DEPEND="${RDEPEND}
) )
" "
PATCHES=( PATCHES=(
"${FILESDIR}/${PN}-4.050-amavis-type-conversions.patch" "${FILESDIR}"/DBD-mysql-4.050-fix-float-type-conversion.patch
"${FILESDIR}"/DBD-mysql-4.050-fix-for-MariaDB-10.3.13-with-zerofil.patch
) )
src_configure() { src_configure() {

View File

@ -1,31 +1,26 @@
From eb7eddaa2341b853df045ad4a3690c60fc38c6c8 Mon Sep 17 00:00:00 2001
From: Pali <pali@cpan.org> From: Pali <pali@cpan.org>
Date: Fri, 24 Feb 2017 19:51:36 +0100 Date: Fri, 24 Feb 2017 19:51:36 +0100
Subject: Fix type conversions Subject: [PATCH] Fix type conversions
Calling SvNV() for magical scalar is not enough for float type conversion. Calling SvNV() for magical scalar is not enough for float type conversion.
It caused problem for Amavis in tainted mode -- all float values were zero. It caused problem for Amavis in tainted mode -- all float values were zero.
On the other hand SvIV() and SvUV() seems to work fine. To be sure that On the other hand SvIV() and SvUV() seems to work fine. To be sure that
correct value of float is in scalar use sv_setnv() with explicit NV float correct value of float is in scalar use sv_setnv() with explicit NV float
value. Similar code is changed also for integers IV/UV. value. Similar code is changed also for integers IV/UV.
.
This patch should fix reported Amavis bug: This patch should fix reported Amavis bug:
https://github.com/perl5-dbi/DBD-mysql/issues/78 https://github.com/perl5-dbi/DBD-mysql/issues/78
.
See also reported perl bug about SvNV(): See also reported perl bug about SvNV():
https://rt.perl.org/Public/Bug/Display.html?id=130801 https://rt.perl.org/Public/Bug/Display.html?id=130801
Bugs: https://github.com/perl5-dbi/DBD-mysql/issues/78 Bugs: https://github.com/perl5-dbi/DBD-mysql/issues/78
Bugs-Debian: https://bugs.debian.org/856064 Bugs-Debian: https://bugs.debian.org/856064
--- Last-Update: 2019-01-09
dbdimp.c | 9 +++------ Reviewed-By: Xavier Guimard <x.guimard@free.fr>,
1 file changed, 3 insertions(+), 6 deletions(-) gregor herrmann <gregoa@debian.org>
diff --git a/dbdimp.c b/dbdimp.c
index 9c33994..7fdfba1 100644
--- a/dbdimp.c --- a/dbdimp.c
+++ b/dbdimp.c +++ b/dbdimp.c
@@ -4380,8 +4380,7 @@ process: @@ -4447,8 +4447,7 @@
if (!(fields[i].flags & ZEROFILL_FLAG)) if (!(fields[i].flags & ZEROFILL_FLAG))
{ {
/* Coerce to double and set scalar as NV */ /* Coerce to double and set scalar as NV */
@ -35,7 +30,7 @@ index 9c33994..7fdfba1 100644
} }
break; break;
@@ -4392,13 +4391,11 @@ process: @@ -4459,13 +4458,11 @@
/* Coerce to integer and set scalar as UV resp. IV */ /* Coerce to integer and set scalar as UV resp. IV */
if (fields[i].flags & UNSIGNED_FLAG) if (fields[i].flags & UNSIGNED_FLAG)
{ {
@ -51,6 +46,3 @@ index 9c33994..7fdfba1 100644
} }
} }
break; break;
--
2.15.1

View File

@ -0,0 +1,36 @@
From 8b5ba5f9c8d239328ecbc862aba203d44819e2f5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= <git@myname.nl>
Date: Tue, 5 Mar 2019 16:24:17 +0100
Subject: [PATCH] Fix for MariaDB 10.3.13 with zerofil
Issue: #304
Bug: https://github.com/perl5-dbi/DBD-mysql/issues/304
Bug-Debian: https://bugs.debian.org/923541
---
dbdimp.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dbdimp.c b/dbdimp.c
index a9c37cf..82c96d2 100644
--- a/dbdimp.c
+++ b/dbdimp.c
@@ -4055,9 +4055,13 @@ int dbd_describe(SV* sth, imp_sth_t* imp_sth)
break;
default:
-#if MYSQL_VERSION_ID > 100300
+#if (MYSQL_VERSION_ID > 100300) && (MYSQL_VERSION_ID < 100313)
// https://jira.mariadb.org/browse/MDEV-18143
buffer->buffer_length= fields[i].max_length ? fields[i].max_length : 2;
+#elif MYSQL_VERSION_ID > 100312
+ // https://jira.mariadb.org/browse/MDEV-18823
+ buffer->buffer_length= fields[i].max_length ? fields[i].max_length + 1 : 2;
+ buffer->buffer_length= fields[i].length > fields[i].max_length ? fields[i].length + 1 : 2;
#else
buffer->buffer_length= fields[i].max_length ? fields[i].max_length : 1;
#endif
--
2.20.1