pg.ddx.io pgsql-odbc@postgresql.org mailing list archive
help / color / mirror / Atom feedWrong numeric conversion
2+ messages / 2 participants
[nested] [flat]
* Wrong numeric conversion
@ 2005-01-16 15:26 Andreas Pflug <pgadmin@pse-consulting.de>
0 siblings, 0 replies; 2+ messages in thread
From: Andreas Pflug @ 2005-01-16 15:26 UTC (permalink / raw)
To: pgsql-odbc
With CVS HEAD, numeric values are not read correctly.
The SQL_NUMERIC_STRUCT is filled with
.precision=3, .scale=5 for a number like 500.00123, which MSDASQL will
interpret as .00123 (noticed when MSDASQL had to convert it to a
string). Obviously the precision should be 8 or more.
The attached patch corrects this.
Regards,
Andreas
Attachments:
convert.c.patch (text/x-patch, 461B) download
Index: convert.c
===================================================================
RCS file: /usr/local/cvsroot/psqlodbc/psqlodbc/convert.c,v
retrieving revision 1.121
diff -u -r1.121 convert.c
--- convert.c 30 Jul 2004 21:08:12 -0000 1.121
+++ convert.c 16 Jan 2005 15:19:32 -0000
@@ -1145,8 +1145,8 @@
{
if (dot_exist)
ns->scale++;
- else
- ns->precision++;
+
+ ns->precision++;
calv[nlen++] = *wv;
}
}
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Wrong numeric conversion
@ 2005-01-17 10:13 Dave Page <dpage@vale-housing.co.uk>
0 siblings, 0 replies; 2+ messages in thread
From: Dave Page @ 2005-01-17 10:13 UTC (permalink / raw)
To: Andreas Pflug <pgadmin@pse-consulting.de>; pgsql-odbc
> -----Original Message-----
> From: pgsql-odbc-owner@postgresql.org
> [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Andreas Pflug
> Sent: 16 January 2005 15:26
> To: pgsql-odbc@postgresql.org
> Subject: [ODBC] Wrong numeric conversion
>
> With CVS HEAD, numeric values are not read correctly.
> The SQL_NUMERIC_STRUCT is filled with
> .precision=3, .scale=5 for a number like 500.00123, which
> MSDASQL will
> interpret as .00123 (noticed when MSDASQL had to convert it to a
> string). Obviously the precision should be 8 or more.
> The attached patch corrects this.
Thanks Andreas, patch applied.
Regards, Dave.
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2005-01-17 10:13 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-01-16 15:26 Wrong numeric conversion Andreas Pflug <pgadmin@pse-consulting.de>
2005-01-17 10:13 Re: Wrong numeric conversion Dave Page <dpage@vale-housing.co.uk>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox