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

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

From: Joe Conway <mail(at)joeconway(dot)com>
To: Oleksiy Shchukin <Oleksiy(dot)Shchukin(at)globallogic(dot)com>
Cc: "Hackers (PostgreSQL)" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [BUGS] BUG #4599: bugfix for contrib/dblink module
Date: 2009-01-03 03:55:37
Message-ID: 495EE1B9.9010004@joeconway.com (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-hackers
Oleksiy Shchukin wrote:
> 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()

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?

8<-----------------------------------------------------------
788                     else if (is_async && do_get)
(gdb)
791                             if (PG_NARGS() == 2)
(gdb)
794                                     DBLINK_GET_CONN;
(gdb)
795                                     fail = PG_GETARG_BOOL(1);
(gdb)
819                     if (!conn)
(gdb)
822                     if (!is_async || (is_async && do_get))
(gdb)
825                             if (!is_async)
(gdb)
829                                     res = PQgetResult(conn);
(gdb)
831                                     if (!res)
(gdb)
838                             if (!res ||
(gdb)
842                                     dblink_res_error(conname, res, 
"could not execute query", fail);
(gdb) p fail
$8 = 1 '\001'
(gdb) print PG_GETARG_BOOL(1)
$9 = 0 '\0'
8<-----------------------------------------------------------

Joe

In response to

Responses

pgsql-hackers by date

Next:From: Robert HaasDate: 2009-01-03 04:13:10
Subject: Re: posix_fadvise v22
Previous:From: Tom LaneDate: 2009-01-03 03:30:31
Subject: Re: Significantly larger toast tables on 8.4?

pgsql-bugs by date

Next:From: Tom LaneDate: 2009-01-03 15:26:18
Subject: Re: [BUGS] BUG #4599: bugfix for contrib/dblink module
Previous:From: Joe ConwayDate: 2009-01-03 01:43:42
Subject: Re: BUG #4599: bugfix for contrib/dblink module

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