pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Freyd <Oliver.Freyd@iontof.com>
To: pgsql-odbc@postgresql.org
Subject: Re: [PATCH] SQLFreeStmt deletes params, but does not reset the stmt->prepared state.
Date: Fri, 17 Oct 2014 14:49:06 +0200
Message-ID: <54411042.3050202@iontof.com> (raw)
In-Reply-To: <544106D3.6070904@tpf.co.jp>
References: <m1qppj$obm$1@ger.gmane.org>
	<544106D3.6070904@tpf.co.jp>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-odbc>

>> I hope this is useful, it took quite a while to track this down...
>
> Thank you for your investigation.
>
> According to the following pages
>   http://msdn.microsoft.com/en-us/library/ms709284%28v=vs.85%29.aspx
>   http://msdn.microsoft.com/en-us/library/ms710926%28v=vs.85%29.aspx
>
> , it seems better to reset APD only keeping IPD intact.
>
> Comments?
>
Thank you for your quick reply,

at first sight that seems to be better, more efficient as the statement 
keeps its prepared state. Only thing is I don't know if that would lead 
to a memory leak later, no idea when the IPD params are freed.

I can try if that works, too...

regards,
Oliver Freyd


> regards,
> Hiroshi Inoue
>
>> best regards,
>>
>>      Oliver Freyd
>>
>> -----------------------------------------------------------------------
>> diff --git a/statement.c b/statement.c
>> index da5abf5..a019d5d 100644
>> --- a/statement.c
>> +++ b/statement.c
>> @@ -581,6 +581,7 @@ SC_free_params(StatementClass *self, char option)
>>       {
>>           APD_free_params(SC_get_APDF(self), option);
>>           IPD_free_params(SC_get_IPDF(self), option);
>> +        if (self->prepared!=NOT_YET_PREPARED)\
>> SC_set_prepared(self, NOT_YET_PREPARED);
>>       }
>>       PDATA_free_params(SC_get_PDTI(self), option);
>>       self->data_at_exec = -1;
>>
>>
>>
>
>


-- 
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc



view thread (6+ messages)  latest in thread

Message-ID: <54411042.3050202@iontof.com>
Permalink:  ../54411042.3050202@iontof.com/
Also on:    postgresql.org/message-id/54411042.3050202@iontof.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: Oliver.Freyd@iontof.com
  Subject: Re: [PATCH] SQLFreeStmt deletes params, but does not reset the stmt->prepared state.
  In-Reply-To: <54411042.3050202@iontof.com>
  References: <m1qppj$obm$1@ger.gmane.org> <544106D3.6070904@tpf.co.jp> <54411042.3050202@iontof.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox