Re: [BUGS] Bug #904: Deallocating of prepared statement in ECPG at

From: Philip Yarra <philip(at)utiba(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, jiri(dot)langr(at)konero(dot)cz
Cc: PostgreSQL-interfaces <pgsql-interfaces(at)postgresql(dot)org>
Subject: Re: [BUGS] Bug #904: Deallocating of prepared statement in ECPG at
Date: 2003-03-19 23:10:31
Message-ID: 200303201010.31228.philip@utiba.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers pgsql-interfaces

On Thu, 20 Mar 2003 08:31, Bruce Momjian wrote:
> Can someone comment on this?

Ah, this might explain why FREE kept failing on us (see sample code below).
Or have I missed something here?

Regards, Philip Yarra.

int main(int argc, char *argv[])
{

EXEC SQL BEGIN DECLARE SECTION;
char *target = "bob(at)snode5";
char *user = "philip";
char *message = "It came from embedded C";
char *pquery = "INSERT INTO test (message) VALUES(?)";

EXEC SQL END DECLARE SECTION;

if(argv[1] != NULL)
message = argv[1];

EXEC SQL WHENEVER sqlerror sqlprint;

EXEC SQL CONNECT TO :target USER :user;
/*EXEC SQL SET AUTOCOMMIT TO ON; */

EXEC SQL PREPARE stmt_id FROM :pquery;
EXEC SQL EXECUTE stmt_id USING :message;
EXEC SQL COMMIT;
EXEC SQL FREE stmt_id;
/* executing this line causes message
"sql error Invalid statement name stmt_id in line 25."
to be printed to console
*/
EXEC SQL DISCONNECT ALL;

}

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2003-03-20 04:05:22 Re: Bugs or Error?
Previous Message Tom Lane 2003-03-19 22:50:45 Re: Bug #914: Possible bug with regards to multiple persistant connections

Browse pgsql-hackers by date

  From Date Subject
Next Message Brian Bruns 2003-03-19 23:19:22 Re: Roadmap for FE/BE protocol redesign
Previous Message Bruce Momjian 2003-03-19 22:45:39 Open 7.4 features

Browse pgsql-interfaces by date

  From Date Subject
Next Message Brian Bruns 2003-03-19 23:19:22 Re: Roadmap for FE/BE protocol redesign
Previous Message Bruce Momjian 2003-03-19 21:31:38 Re: [BUGS] Bug #904: Deallocating of prepared statement in ECPG at