X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 49FD73A1AA8 for ; Sun, 16 Jan 2005 15:26:25 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 45259-06 for ; Sun, 16 Jan 2005 15:26:15 +0000 (GMT) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.173]) by svr1.postgresql.org (Postfix) with ESMTP id 5E6713A1AA4 for ; Sun, 16 Jan 2005 15:26:18 +0000 (GMT) Received: from [212.227.126.179] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1CqCIF-00085l-00 for pgsql-odbc@postgresql.org; Sun, 16 Jan 2005 16:26:19 +0100 Received: from [80.129.147.174] (helo=pse-consulting.de) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 1CqCIF-0000oA-00 for pgsql-odbc@postgresql.org; Sun, 16 Jan 2005 16:26:19 +0100 Message-ID: <41EA879A.9030802@pse-consulting.de> Date: Sun, 16 Jan 2005 15:26:18 +0000 From: Andreas Pflug User-Agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.6) Gecko/20040413 Debian/1.6-5 X-Accept-Language: en MIME-Version: 1.0 To: pgsql-odbc@postgresql.org Subject: Wrong numeric conversion Content-Type: multipart/mixed; boundary="------------030900030308000909070602" X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:0ce7ee5c3478b8d72edd8e05ccd40b70 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.008 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200501/34 X-Sequence-Number: 4829 This is a multi-part message in MIME format. --------------030900030308000909070602 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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 --------------030900030308000909070602 Content-Type: text/x-patch; name="convert.c.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="convert.c.patch" 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; } } --------------030900030308000909070602--