Skip Menu |

This queue is for tickets about the DBD-Firebird CPAN distribution.

Report information
The Basics
Id: 123575
Status: resolved
Priority: 0/
Queue: DBD-Firebird

People
Owner: Nobody in particular
Requestors: vitvsh [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 1.25



Subject: int64 fetching
Date: Thu, 9 Nov 2017 14:59:56 +0200
To: bug-DBD-Firebird [...] rt.cpan.org
From: Vitaly Shyshkanov <vitvsh [...] gmail.com>
Hello I found problem in fetching int64 with negative value between -1..0 - minus is loosing in this case. Problem is in this block } else { ISC_INT64 divisor, remainder; divisor = scales[-var->sqlscale]; remainder = (i%divisor); if (remainder < 0) remainder = -remainder; snprintf(buf, sizeof(buf), "%"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 )); } I have -0.3 as numeric(15,5) in this case i=-30000, divisor=100000, remainder=0 Result of division i/divisior is 0 (and in this place we lost minus) Below is a possible solution of this issue 1441,1442c1441 < "%s%"DBD_IB_INT64f".%0*"DBD_IB_INT64f, < i < 0 && !(i/divisor) ? "-" : "", --- Show quoted text
> "%"DBD_IB_INT64f".%0*"DBD_IB_INT64f,
На 09 ноем. 2017, чт 15:00:28, vitvsh@gmail.com написа: Show quoted text
> I found problem in fetching int64 with negative value between -1..0 - minus > is loosing in this case.
Yep, an ugly bug. It was fixed in 1.25, please upgrade.
Subject: Re: [rt.cpan.org #123575] int64 fetching
Date: Fri, 10 Nov 2017 18:08:21 +0200
To: bug-DBD-Firebird [...] rt.cpan.org
From: Vitaly Shyshkanov <vitvsh [...] gmail.com>
Thanks a lot! 10 нояб. 2017 г. 5:32 ПП пользователь "Damyan Ivanov via RT" < bug-DBD-Firebird@rt.cpan.org> написал: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=123575 > > > На 09 ноем. 2017, чт 15:00:28, vitvsh@gmail.com написа:
> > I found problem in fetching int64 with negative value between -1..0 -
> minus
> > is loosing in this case.
> > Yep, an ugly bug. > > It was fixed in 1.25, please upgrade. > >