pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hiroshi Inoue <inoue@tpf.co.jp>
To: mcassiano@manord.com
Cc: pgsql-odbc@postgresql.org
Subject: Re: Undesired decimal truncation with psqlodbc version 08.04.0100
Date: Wed, 18 Nov 2009 01:16:54 +0900
Message-ID: <4B02CC76.50008@tpf.co.jp> (raw)
In-Reply-To: <4defa9840911160549h22eb958cx95dc8ac3d631f8c0@mail.gmail.com>
References: <4defa9840911160549h22eb958cx95dc8ac3d631f8c0@mail.gmail.com>

Hi Marco,

Marco Cassiano wrote:
> Hello everybody,
>  
> during this weekend we upgraded our Postgres database from version 8.3.8 
> to version 8.4.1.
> We also updated the odbc driver from version 08.03.0400 to version 
> 08.04.0100.
> With this new version though, we observe an unwanted decimal truncation 
> as you can see in the following example.
>  
> I would need your help to understand the reason of this different, 
> undesired behavior and how to fix it.

Please apply the attached patch.

regards,
Hiroshi Inoue

> Thank you
>  
> Marco
>  
> I attached the output from the same query on the same database made with 
> the two drivers version:
>  
>  
>> >>>> With version 08.03.0400 (Correct decimal handling, see column 
> "co_perc_magg_matrice", first row):
>  
> SQL> select * from anamat.collezioni;
> +-----+---------------------+-----------------+---------------------+--------------+---------+
> | coll| co_descr            | co_coll_numerica| co_perc_magg_matrice| 
> co_descr_abbr| cond_pag|
> +-----+---------------------+-----------------+---------------------+--------------+---------+
> | 1   | Descr. non disponib.| 10              | 1.200               | 
> PennyPull    | RB10    |
> | 2   | Descr. non disponib.| 20              | 0.000               | 
> PennyBlack   |         |
> | 3   | Descr. non disponib.| 30              | 0.000               | 
> NewPenny     |         |
> | 4   | Descr. non disponib.| 40              | 0.000               | 
> Classic      | RB09    |
> | 5   | Descr. non disponib.| 50              | 0.000               | PB 
> Plus      |         |
> | 6   | Descr. non disponib.| 60              | 0.000               | 
> Active       |         |
> | 7   | Descr. non disponib.| 70              | 0.000               | 
> Jeans & B.   |         |
> | 8   | Descr. non disponib.| 96              | 0.000               | 
> Trend        |         |
> | 9   | Descr. non disponib.| 90              | 0.000               | F. 
> Natale    |         |
> | A   | Descr. non disponib.| 48              | 0.000               
> |              | RB09    |
> | B   | Descr. non disponib.| 31              | 0.000               | 
> Flash NP S   | RB09    |
> | C   | Descr. non disponib.| 32              | 0.000               | 
> Flash NP C   | RB09    |
> | E   | Descr. non disponib.| 11              | 0.000               | 
> Ins.P.Pull   |         |
> | F   | Descr. non disponib.| 21              | 0.000               | 
> Flash PB J   | RB09    |
> | G   | Descr. non disponib.| 22              | 0.000               | 
> Flash PB G   | RB09    |
> | H   | Descr. non disponib.| 35              | 0.000               | 
> Ins.N.Penn   |         |
> | I   | Descr. non disponib.| 23              | 0.000               | F. 
> PB Ant.   | RB09    |
> | K   | Descr. non disponib.| 28              | 0.000               | 
> N.D.         |         |
> | L   | Descr. non disponib.| 84              | 0.000               | 
> FL           |         |
> | M   | Descr. non disponib.| 24              | 0.000               | 
> Flash PB M   | RB09    |
> | N   | Descr. non disponib.| 85              | 0.000               | 
> Ins. NP      | RB09    |
> | O   | Descr. non disponib.| 26              | 0.000               | 
> Saldi I. P   |         |
> | P   | Descr. non disponib.| 98              | 0.000               | 
> Pubblicit.   |         |
> | R   | Descr. non disponib.| 99              | 0.000               | 
> Prototipi    |         |
> | S   | Descr. non disponib.| 25              | 0.000               | 
> Ins. PB Ac   |         |
> | T   | Descr. non disponib.| 45              | 0.000               | 
> Fl. abiti    |         |
> | U   | Descr. non disponib.| 46              | 0.000               | 
> Chemises     |         |
> | V   | Descr. non disponib.| 47              | 0.000               | 
> Max&Co Acc   |         |
> | W   | B2B by default      | 91              | 0.000               | 
> B2B by def   |         |
> | X   | Descr. non disponib.| 61              | 0.000               | 
> Ins. MaxCo   |         |
> | Y   | Descr. non disponib.| 27              | 0.000               | 
> Idee reg.    |         |
> | Z   | Descr. non disponib.| 49              | 0.000               | 
> DD           |         |
> +-----+---------------------+-----------------+---------------------+--------------+---------+
> SQLRowCount returns 32
> 32 rows fetched
>  
>> >>>> With version 08.04.0100 (wrong decimal truncation):
>  
> SQL> select * from anamat.collezioni;
> +-----+---------------------+-----------------+---------------------+--------------+---------+
> | coll| co_descr            | co_coll_numerica| co_perc_magg_matrice| 
> co_descr_abbr| cond_pag|
> +-----+---------------------+-----------------+---------------------+--------------+---------+
> | 1   | Descr. non disponib.| 10              | 1                   | 
> PennyPull    | RB10    |
> | 2   | Descr. non disponib.| 20              | 0                   | 
> PennyBlack   |         |
> | 3   | Descr. non disponib.| 30              | 0                   | 
> NewPenny     |         |
> | 4   | Descr. non disponib.| 40              | 0                   | 
> Classic      | RB09    |
> | 5   | Descr. non disponib.| 50              | 0                   | PB 
> Plus      |         |
> | 6   | Descr. non disponib.| 60              | 0                   | 
> Active       |         |
> | 7   | Descr. non disponib.| 70              | 0                   | 
> Jeans & B.   |         |
> | 8   | Descr. non disponib.| 96              | 0                   | 
> Trend        |         |
> | 9   | Descr. non disponib.| 90              | 0                   | F. 
> Natale    |         |
> | A   | Descr. non disponib.| 48              | 0                   
> |              | RB09    |
> | B   | Descr. non disponib.| 31              | 0                   | 
> Flash NP S   | RB09    |
> | C   | Descr. non disponib.| 32              | 0                   | 
> Flash NP C   | RB09    |
> | E   | Descr. non disponib.| 11              | 0                   | 
> Ins.P.Pull   |         |
> | F   | Descr. non disponib.| 21              | 0                   | 
> Flash PB J   | RB09    |
> | G   | Descr. non disponib.| 22              | 0                   | 
> Flash PB G   | RB09    |
> | H   | Descr. non disponib.| 35              | 0                   | 
> Ins.N.Penn   |         |
> | I   | Descr. non disponib.| 23              | 0                   | F. 
> PB Ant.   | RB09    |
> | K   | Descr. non disponib.| 28              | 0                   | 
> N.D.         |         |
> | L   | Descr. non disponib.| 84              | 0                   | 
> FL           |         |
> | M   | Descr. non disponib.| 24              | 0                   | 
> Flash PB M   | RB09    |
> | N   | Descr. non disponib.| 85              | 0                   | 
> Ins. NP      | RB09    |
> | O   | Descr. non disponib.| 26              | 0                   | 
> Saldi I. P   |         |
> | P   | Descr. non disponib.| 98              | 0                   | 
> Pubblicit.   |         |
> | R   | Descr. non disponib.| 99              | 0                   | 
> Prototipi    |         |
> | S   | Descr. non disponib.| 25              | 0                   | 
> Ins. PB Ac   |         |
> | T   | Descr. non disponib.| 45              | 0                   | 
> Fl. abiti    |         |
> | U   | Descr. non disponib.| 46              | 0                   | 
> Chemises     |         |
> | V   | Descr. non disponib.| 47              | 0                   | 
> Max&Co Acc   |         |
> | W   | B2B by default      | 91              | 0                   | 
> B2B by def   |         |
> | X   | Descr. non disponib.| 61              | 0                   | 
> Ins. MaxCo   |         |
> | Y   | Descr. non disponib.| 27              | 0                   | 
> Idee reg.    |         |
> | Z   | Descr. non disponib.| 49              | 0                   | 
> DD           |         |
> +-----+---------------------+-----------------+---------------------+--------------+---------+
> SQLRowCount returns 32
> 32 rows fetched 

Attachments:

conv.patch (text/plain, 613B) download *** convert.c Wed Nov 18 01:11:06 2009 --- ../ver_8040100/convert.c Tue Nov 17 23:59:08 2009 *************** *** 1099,1105 **** for (i = 0, j = 0; ptr[i]; i++) if (ptr[i] == '.') { ! strncpy_null(&new_string[j], lc->decimal_point, strlen(lc->decimal_point)); j += strlen(lc->decimal_point); } else --- 1099,1105 ---- for (i = 0, j = 0; ptr[i]; i++) if (ptr[i] == '.') { ! strncpy_null(&new_string[j], lc->decimal_point, cbValueMax - j); j += strlen(lc->decimal_point); } else

view thread (3+ messages)  latest in thread

Message-ID: <4B02CC76.50008@tpf.co.jp>
Permalink:  ../4B02CC76.50008@tpf.co.jp/
Also on:    postgresql.org/message-id/4B02CC76.50008@tpf.co.jp

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: inoue@tpf.co.jp, mcassiano@manord.com
  Subject: Re: Undesired decimal truncation with psqlodbc version 08.04.0100
  In-Reply-To: <4B02CC76.50008@tpf.co.jp>
  References: <4defa9840911160549h22eb958cx95dc8ac3d631f8c0@mail.gmail.com> <4B02CC76.50008@tpf.co.jp>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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