Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VCIAW-0005Qj-0r for pgsql-odbc@arkaria.postgresql.org; Wed, 21 Aug 2013 23:50:28 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VCIAU-0008Qi-LA for pgsql-odbc@arkaria.postgresql.org; Wed, 21 Aug 2013 23:50:26 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VCIAT-0008Qb-M3 for pgsql-odbc@postgresql.org; Wed, 21 Aug 2013 23:50:25 +0000 Received: from sd.tpf.co.jp ([210.161.239.34]) by makus.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VCIAP-0002IL-Ej for pgsql-odbc@postgresql.org; Wed, 21 Aug 2013 23:50:24 +0000 Received: (qmail 6848 invoked by uid 512); 21 Aug 2013 23:50:17 -0000 Received: from unknown (HELO ?127.0.0.1?) (100.126.1.62) by sd2.tpf-fw-c.co.jp with SMTP; 21 Aug 2013 23:50:17 -0000 Message-ID: <52155238.70104@tpf.co.jp> Date: Thu, 22 Aug 2013 08:50:16 +0900 From: "Inoue, Hiroshi" User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Heikki Linnakangas CC: "pgsql-odbc@postgresql.org" Subject: Re: UseServerSidePrepare and data-at-execution References: <520CDAF2.5010005@vmware.com> In-Reply-To: <520CDAF2.5010005@vmware.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.0 (--) 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 Sorry for thr late reply. (2013/08/15 22:43), Heikki Linnakangas wrote: > Hi, > > In preparation of changing UseServerSidePrepare=1 as the default, I > tried running the regression tests in UseServerSidePrepare=1 mode, and > got two failures. The first seems to be harmless: > > --- > /home/heikki/git-sandbox-pgsql/psqlodbc/test/expected/insertreturning.out > 2013-06-12 13:58:32.535982856 +0300 > +++ > /home/heikki/git-sandbox-pgsql/psqlodbc/test/results/insertreturning.out > 2013-08-15 16:28:09.892155293 +0300 > @@ -1,303 +1,303 @@ > \! ./src/insertreturning-test > connected > -# of result cols before SQLExecute: 0, after: 1 > +# of result cols before SQLExecute: 1, after: 1 > Result set: > foobar 0 > -# of result cols before SQLExecute: 0, after: 1 > +# of result cols before SQLExecute: 1, after: 1 > Result set: > foobar 1 > > ... > > That basically means that with UseServerSidePrepare=0, if you call > SQLNumResultCols() on an "INSERT ... RETURNING" statement, after > SQLPrepare but before SQLExecute, it returns 0. With > UseServerSidePrepare=1, it returns 1. That seems logical - the driver > doesn't know how many cols the statement will return before at least > preparing it. In any case, the behavior with UseServerSidePrepare=1 is > better. > > The second failure, however, looks like a bug: > > *** > /home/heikki/git-sandbox-pgsql/psqlodbc/test/expected/dataatexecution.out 2013-06-12 > 13:58:32.535982856 +0300 > --- > /home/heikki/git-sandbox-pgsql/psqlodbc/test/results/dataatexecution.out > 2013-08-15 16:35:04.108136825 +0300 > *************** > *** 7,12 **** > Fetching result sets for array bound (2 results expected) > 1: Result set: > 4 > - 2: Result set: > - 5 > disconnecting > --- 7,10 ---- > > The test case executes a SELECT statement twice, using data-at-execution > parameters (ie. SQLParamData and SQLPutData) and array binding together. > In that combination, the server logs confirm that the query is executed > twice with different parameters, but only the first result is returned > to the client. > > After some debugging, I came up with the attached patch. It clears the > curr_param_result flag from the statement object, in SQLParamData, after > executing the statement with the current set of parameters. Oops I overlooked this case. Yes the curr_param_result flag must be cleared before excecuting the subsequent set of parameters. regards, Hirshi Inoue -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc