to_char() dumps core - Mailing list pgsql-hackers

From Tatsuo Ishii
Subject to_char() dumps core
Date
Msg-id 20001020232219P.t-ishii@sra.co.jp
Whole thread Raw
Responses Re: to_char() dumps core  (Karel Zak <zakkr@zf.jcu.cz>)
Re: to_char() dumps core  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
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?

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 abnormallybefore or
whileprocessing the request.
 
The connection to the server was lost. Attempting reset: Failed.


pgsql-hackers by date:

Previous
From: Brook Milligan
Date:
Subject: Re: make depend (Re: Coming attractions: VPATH build; make variables issue)
Next
From: Thomas Lockhart
Date:
Subject: Re: RE. COBOL FILES