Re: to_char() dumps core

From: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
To: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: to_char() dumps core
Date: 2000-10-20 16:35:24
Message-ID: Pine.LNX.3.96.1001020181233.13295A-100000@ara.zf.jcu.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


On Fri, 20 Oct 2000, Tatsuo Ishii wrote:

> In 7.0.2
>
> select to_char(sum(n),'999') from t1;
>
> causes backend dump a core if n is a float/numeric ...data type AND if
> sum(n) returns NULL. This seems due to a bad null pointer handling for
> aruguments of pass-by-reference data types. I think just a simple
> null pointer checking at very top of each function (for example
> float4_to_char()) would solve the problem. Comments?

In the 7.1devel it's correct, but here it's bug, IMHO it bear on changes
in the 7.1's fmgr, because code is same in both versions for this. On Monday,
I try fix it for 7.0.3

Karel

> test=# create table t1(f float);
> CREATE
> test=# select to_char(sum(f),'999') from t1;
> pqReadData() -- backend closed the channel unexpectedly.
> This probably means the backend terminated abnormally
> before or while processing the request.
> The connection to the server was lost. Attempting reset: Failed.
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2000-10-20 17:11:07 Re: Now 376175 lines of code
Previous Message Hannu Krosing 2000-10-20 16:20:59 Re: Now 376175 lines of code

Browse pgsql-patches by date

  From Date Subject
Next Message Karel Zak 2000-10-20 17:18:11 Re: [HACKERS] to_char() dumps core
Previous Message Tatsuo Ishii 2000-10-20 14:22:19 to_char() dumps core