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

Re: [BUGS] BUG #4599: bugfix for contrib/dblink module

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: Oleksiy Shchukin <Oleksiy(dot)Shchukin(at)globallogic(dot)com>, "Hackers (PostgreSQL)" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [BUGS] BUG #4599: bugfix for contrib/dblink module
Date: 2009-01-03 15:26:18
Message-ID: 28719.1230996378@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-hackers
Joe Conway <mail(at)joeconway(dot)com> writes:
> On line 795 below, fail should get set to PG_GETARG_BOOL(1). However, as 
> line 842 is about to be executed, fail is still set to true, even though 
> PG_GETARG_BOOL(1) is clearly false. Any ideas?

I can't duplicate that here, but my first reaction on studying this code
is "ick!".  Having a non-set-returning function calling the SRF
infrastructure (and not bothering to clean it up on exit, either) is
just horrid --- I have no idea what side-effects that might have, but at
the very least there's going to be a memory leak.  Trying to implement
three significantly different functions as one function with a maze of
if's is not good style in any case.

I think you should break those three functions apart.  There is no value
in having send_query share any code with the others.  It might be
feasible to have the other two share a subroutine that collects the
result data.

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Simon RiggsDate: 2009-01-03 15:54:58
Subject: Re: generic reloptions improvement
Previous:From: Alvaro HerreraDate: 2009-01-03 15:24:34
Subject: Re: reloptions and toast tables

pgsql-bugs by date

Next:From: Joe ConwayDate: 2009-01-03 20:00:22
Subject: Re: [BUGS] BUG #4599: bugfix for contrib/dblink module
Previous:From: Joe ConwayDate: 2009-01-03 03:55:37
Subject: Re: [BUGS] BUG #4599: bugfix for contrib/dblink module

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