Thread: BUG #4599: bugfix for contrib/dblink module

BUG #4599: bugfix for contrib/dblink module

From
"Oleksiy Shchukin"
Date:
The following bug has been logged online:

Bug reference:      4599
Logged by:          Oleksiy Shchukin
Email address:      Oleksiy.Shchukin@globallogic.com
PostgreSQL version: 8.3.5
Operating system:   all
Description:        bugfix for contrib/dblink module
Details:

Description
-----------
Function dblink_get_result(text connname [, bool fail_on_error]) from
contrib/dblink module ignores 2nd argument.

Reproduce how-to
----------------
I send bad SQL statement via dblink_send_query(text,text), and than try to
grab result with  dblink_get_result(connname, /*fail_on_error=*/ false), the
bad sql statement error is issued on client side inspite of
'/*fail_on_error=*/ false' parameter is passed to dblink_get_result()

dblink.c fix
------------
In dblink.c:785 2nd argument for dblink_get_result(text,bool) is referenced
as 'PG_GETARG_BOOL(2)', must be 'PG_GETARG_BOOL(1)'.

I have already compiled and tested it, works fine for me.

Annotated dblink.c from HEAD
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/contrib/dblink/dblink.c?anno
tate=1.76) states that commiter is Joe, please, pass him the bug fix.

Great thanks for your excellect work! :)

Oleksiy

Re: BUG #4599: bugfix for contrib/dblink module

From
Joe Conway
Date:
Oleksiy Shchukin wrote:
> The following bug has been logged online:
>
> Bug reference:      4599
> Logged by:          Oleksiy Shchukin
> Email address:      Oleksiy.Shchukin@globallogic.com
> PostgreSQL version: 8.3.5
> Operating system:   all
> Description:        bugfix for contrib/dblink module

[snip]

> dblink.c fix
> ------------
> In dblink.c:785 2nd argument for dblink_get_result(text,bool) is referenced
> as 'PG_GETARG_BOOL(2)', must be 'PG_GETARG_BOOL(1)'.

This looks like a correct assessment. Will fix...

Thanks!

Joe