X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 836DD52876 for ; Tue, 14 Jun 2005 21:40:19 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 24568-10 for ; Wed, 15 Jun 2005 00:40:10 +0000 (GMT) Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by svr1.postgresql.org (Postfix) with SMTP id 7C6BB5280A for ; Tue, 14 Jun 2005 21:40:09 -0300 (ADT) Received: (qmail 11074 invoked from network); 15 Jun 2005 00:38:23 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.2?) (64.7.143.116) by net2.micro-automation.com with SMTP; 15 Jun 2005 00:38:23 -0000 In-Reply-To: <42AF6682.6000405@opencloud.com> References: <2BC23AE7-6381-41BA-AE89-CC81D1C932A7@fastcrypt.com> <42AF6682.6000405@opencloud.com> Mime-Version: 1.0 (Apple Message framework v730) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Cc: List Content-Transfer-Encoding: 7bit From: Dave Cramer Subject: Re: patch for passing the cts Date: Tue, 14 Jun 2005 20:40:11 -0400 To: Oliver Jowett X-Mailer: Apple Mail (2.730) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.023 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200506/74 X-Sequence-Number: 13036 Oliver, So if we defer parsing, this will require changing the strategy to create the parameters as they are set, or registered. I would suggest using an ArrayList of Parameters, and grow this as required, then parse when it is executed. Do you have any suggestions ? Dave On 14-Jun-05, at 7:21 PM, Oliver Jowett wrote: > Dave Cramer wrote: > >> Well the good news is that the driver and the backend will pass >> the cts >> with this patch. >> >> Rather than commit this as is, I'd like to discuss the patch as it >> is. >> >> I'm really not happy with the handling of IN/OUT parameters in the >> query executor, however deferring parsing doesn't seem to be an >> option >> either. >> > > I don't think your approach works, though; consider this (untested) > example: > > CallableStatement cs = conn.prepareCall("{call f(?*4,?)}"); > cs.setInt(1,42); > cs.registerOutParameter(2,Types.INTEGER); > > The query gets parsed into these fragments: > > 0:"select * from f(" > 1:"*4," > 2:") as result" > > As I read your code, that's going to discard fragment 1 blindly in the > query executor, resulting in this query: > > "select * from f($1) as result" > > which is wrong. > > The logic that decides to remove OUT placeholders needs to be aware of > the rest of the {call} structure (mainly, comma separation of > parameters) to do it correctly, and I really don't think that the > QueryExecutor implementations are the right place for that.. > > -O > > ---------------------------(end of > broadcast)--------------------------- > TIP 7: don't forget to increase your free space map settings > >