[libdbd-firebird-perl] 01/02: add upstream patch fixing fetching of decimal(x, y) values between -1 and 0
Damyan Ivanov
dmn at moszumanska.debian.org
Sat Oct 7 15:57:34 UTC 2017
This is an automated email from the git hooks/post-receive script.
dmn pushed a commit to branch stretch
in repository libdbd-firebird-perl.
commit 60d59ec5ea61c29f0e8a627d2f6099dec497ad9b
Author: Damyan Ivanov <dmn at debian.org>
Date: Sat Oct 7 15:43:50 2017 +0000
add upstream patch fixing fetching of decimal(x,y) values between -1 and 0
Closes: #877720
---
.../decimal-fetch-between-minus-one-and-zero.patch | 37 ++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 38 insertions(+)
diff --git a/debian/patches/decimal-fetch-between-minus-one-and-zero.patch b/debian/patches/decimal-fetch-between-minus-one-and-zero.patch
new file mode 100644
index 0000000..2ab916b
--- /dev/null
+++ b/debian/patches/decimal-fetch-between-minus-one-and-zero.patch
@@ -0,0 +1,37 @@
+b4fad5d264abafeb26e1333b74f6a5c2f75f4869 dbd_st_fetch: fix conversion of numerics between -1 and 0
+diff --git a/dbdimp.c b/dbdimp.c
+index 1c48d7c..ff7b510 100644
+--- a/dbdimp.c
++++ b/dbdimp.c
+@@ -1431,20 +1431,28 @@ AV *dbd_st_fetch(SV *sth, imp_sth_t *imp_sth)
+ #endif
+ if (var->sqlscale == 0) {
+ snprintf(buf, sizeof(buf), "%"DBD_IB_INT64f, i);
++ sv_setpvn(sv, buf, strlen(buf));
+ } else {
++ bool sign = ( i < 0 );
+ ISC_INT64 divisor, remainder;
+ divisor = scales[-var->sqlscale];
++ if (sign) divisor = -divisor;
+ remainder = (i%divisor);
+ if (remainder < 0) remainder = -remainder;
+
+- snprintf(buf, sizeof(buf),
++ snprintf(buf+1, sizeof(buf)-1,
+ "%"DBD_IB_INT64f".%0*"DBD_IB_INT64f,
+ i/divisor, -var->sqlscale, remainder);
+ DBI_TRACE_imp_xxh(imp_sth, 3, (DBIc_LOGPIO(imp_sth), "-------------->SQLINT64=%"DBD_IB_INT64f".%0*"DBD_IB_INT64f,i/divisor, -var->sqlscale, remainder ));
+
++ if (sign) {
++ *buf = '-';
++ sv_setpvn(sv, buf, strlen(buf));
++ }
++ else {
++ sv_setpvn(sv, buf+1, strlen(buf+1));
++ }
+ }
+-
+- sv_setpvn(sv, buf, strlen(buf));
+ }
+ break;
+ #endif
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..6eef74e
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+decimal-fetch-between-minus-one-and-zero.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libdbd-firebird-perl.git
More information about the Pkg-perl-cvs-commits
mailing list