Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] to_char() dumps core

From: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
To: pgsql-patches <pgsql-patches(at)postgreSQL(dot)org>, Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
Subject: Re: [HACKERS] to_char() dumps core
Date: 2000-10-20 17:18:11
Message-ID: Pine.LNX.3.96.1001020191601.13898A-101000@ara.zf.jcu.cz (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
On Fri, 20 Oct 2000, Karel Zak wrote:

> 
> 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 

 Not, monday .. just now :-)

 The patch is attached... Bruce, it's again to 7.0.3!

 Thanks for bug report

			Karel 


test=# create table t1 (f4 float4, f8 float8, n numeric, i4 int4, i8 int8);
CREATE
test=# select to_char(sum(f4), '9'), to_char(sum(f8), '9'), to_char(sum(n),
'9'), to_char(sum(i4), '9'), to_char(sum(i8), '9') from t1;
 to_char | to_char | to_char | to_char | to_char
---------+---------+---------+---------+---------
         |         |         |         |
(1 row)  



Attachment: to_char-7.0.3-10202000.patch.gz
Description: application/x-gzip (349 bytes)

In response to

Responses

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2000-10-20 17:30:25
Subject: Re: Now 376175 lines of code
Previous:From: Robert KernellDate: 2000-10-20 17:14:35
Subject: what is CVS?

pgsql-patches by date

Next:From: Bruce MomjianDate: 2000-10-20 17:33:21
Subject: Re: Re: [HACKERS] to_char() dumps core
Previous:From: Karel ZakDate: 2000-10-20 16:35:24
Subject: Re: to_char() dumps core

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group