Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Xf6y5-0000nt-23 for pgsql-odbc@arkaria.postgresql.org; Fri, 17 Oct 2014 12:49:17 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Xf6y3-0007Sv-8O for pgsql-odbc@arkaria.postgresql.org; Fri, 17 Oct 2014 12:49:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Xf6y2-0007Sp-ON for pgsql-odbc@postgresql.org; Fri, 17 Oct 2014 12:49:14 +0000 Received: from mail.iontof.com ([80.152.7.42]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Xf6xx-0001ow-Aa for pgsql-odbc@postgresql.org; Fri, 17 Oct 2014 12:49:13 +0000 Received: from localhost (mail.iontof.com [127.0.0.1]) by localhost (Postfix) with ESMTP id A89C81DB2063 for ; Fri, 17 Oct 2014 14:49:07 +0200 (CEST) X-Virus-Scanned: amavisd-new X-Spam-Flag: NO X-Spam-Score: -10 X-Spam-Level: X-Spam-Status: No, score=-10 required=5 tests=[ALL_TRUSTED=-10] autolearn=disabled Received: from mail.iontof.com ([127.0.0.1]) by localhost (mail.iontof.com [127.0.0.1]) (amavisd-new, port 10033) with ESMTP id o2D25t3Ib-sg for ; Fri, 17 Oct 2014 14:49:06 +0200 (CEST) Received: from [192.168.0.87] (Oliver3.iontof.lan [192.168.0.87]) by mail.iontof.com (Postfix) with ESMTPSA id 4B78B1DB2062 for ; Fri, 17 Oct 2014 14:49:06 +0200 (CEST) Message-ID: <54411042.3050202@iontof.com> Date: Fri, 17 Oct 2014 14:49:06 +0200 From: Oliver Freyd User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: pgsql-odbc@postgresql.org Subject: Re: [PATCH] SQLFreeStmt deletes params, but does not reset the stmt->prepared state. References: <544106D3.6070904@tpf.co.jp> In-Reply-To: <544106D3.6070904@tpf.co.jp> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-odbc Precedence: bulk Sender: pgsql-odbc-owner@postgresql.org >> 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