Re: thousands comma numeric formatting in psql

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Eugen Nedelcu <eugen(at)sifolt(dot)ro>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: thousands comma numeric formatting in psql
Date: 2005-07-18 18:58:44
Message-ID: 200507181858.j6IIwi210593@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches


Thanks, fix attached and applied

---------------------------------------------------------------------------

Eugen Nedelcu wrote:
> In function format_numericsep() you have:
>
> new_str = pg_local_malloc(len_numericseps(my_str) + 1),
>
> instead of:
>
> new_str = pg_local_malloc(len_with_numericsep(my_str) + 1)
>
> Another bug is in function len_numericseps(). This apear for querys
> like:
>
> select NULL::numeric; or
> select * from table_with_numeric_fields; where one of numeric fields
> have null values;
>
> For such values, len_numericseps returns -1, instead of 0.
>
> Instead of:
>
> if (int_len % groupdigits != 0)
> sep_len = int_len / groupdigits;
> else
> sep_len = int_len / groupdigits - 1;
>
> you must have:
>
> if (int_len % groupdigits != 0 || int_len == 0)
> sep_len = int_len / groupdigits;
> else
> sep_len = int_len / groupdigits - 1;
>
> Best Regards,
> Eugen
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

Attachment Content-Type Size
unknown_filename text/plain 1.4 KB

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Rocco Altier 2005-07-18 20:12:37 Re: Changes for AIX buildfarm
Previous Message Tom Lane 2005-07-18 17:49:13 Re: 7.3 pg_dump pt_BR translation msgfmt failure