troubleshooting pointers

From: Joe Conway <mail(at)joeconway(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgreSQL(dot)org>
Subject: troubleshooting pointers
Date: 2002-05-09 17:45:09
Message-ID: 3CDAB5A5.9000901@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

With the current SRF patch, in certain circumstances selecting from a
VIEW produces "Buffer Leak" warnings, while selecting from the function
itself does not. Also the VIEW returns only one of the two expected
rows. The same SQL function when declared as "... getfoo(int) RETURNS
int AS ..." instead of "... getfoo(int) RETURNS *setof* int AS..." does
not produce the warning. Any ideas what I should be focusing on to track
this down? Does anyone have any favorite troubleshooting techniques for
this type of problem?

Thanks,
Joe

-- sql, proretset = t, prorettype = b
DROP FUNCTION getfoo(int);
DROP
CREATE FUNCTION getfoo(int) RETURNS setof int AS 'SELECT fooid FROM foo
WHERE fooid = $1;' LANGUAGE SQL;
CREATE
SELECT * FROM getfoo(1) AS t1;
getfoo
--------
1
1
(2 rows)

DROP VIEW vw_getfoo;
DROP
CREATE VIEW vw_getfoo AS SELECT * FROM getfoo(1);
CREATE
SELECT * FROM vw_getfoo;
psql:../srf-test.sql:21: WARNING: Buffer Leak: [055] (freeNext=-3,
freePrev=-3, rel=16570/123204, blockNum=1, flags=0x4, refcount=1 1)
psql:../srf-test.sql:21: WARNING: Buffer Leak: [059] (freeNext=-3,
freePrev=-3, rel=16570/123199, blockNum=0, flags=0x85, refcount=1 1)
getfoo
--------
1
(1 row)

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message cbbrowne 2002-05-09 17:46:04 Re: How much work is a native Windows application?
Previous Message Jean-Michel POURE 2002-05-09 17:42:10 Re: How much work is a native Windows application?

Browse pgsql-patches by date

  From Date Subject
Next Message Valentine Zaretsky 2002-05-09 20:13:50 Re: troubleshooting pointers
Previous Message sugita 2002-05-09 02:57:51 getopt_long patch for pg_dump and psql