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 F3C8B52906 for ; Tue, 14 Jun 2005 20:21:39 -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 10145-09 for ; Tue, 14 Jun 2005 23:21:38 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 8645C528E0 for ; Tue, 14 Jun 2005 20:21:37 -0300 (ADT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.20]) by yass.opencloud.co.nz with asmtp (TLS-1.0:DHE_RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1DiKiw-0007Ep-FN; Wed, 15 Jun 2005 11:21:38 +1200 Message-ID: <42AF6682.6000405@opencloud.com> Date: Wed, 15 Jun 2005 11:21:38 +1200 From: Oliver Jowett User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050324) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Dave Cramer Cc: List Subject: Re: patch for passing the cts References: <2BC23AE7-6381-41BA-AE89-CC81D1C932A7@fastcrypt.com> In-Reply-To: <2BC23AE7-6381-41BA-AE89-CC81D1C932A7@fastcrypt.com> X-Enigmail-Version: 0.90.2.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.004 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200506/73 X-Sequence-Number: 13035 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