pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Dave Cramer <pg@fastcrypt.com>
Cc: List <pgsql-jdbc@postgresql.org>
Subject: Re: Bug with callable statement and output parameters
Date: Mon, 22 May 2006 05:05:17 -0500 (EST)
Message-ID: <Pine.BSO.4.63.0605220453380.22770@leary2.csoft.net> (raw)
In-Reply-To: <0BEEAF9A-2E47-4E4F-AE8D-2846076FA037@fastcrypt.com>
References: <3f205b320604201502o112f68abhafbc0a2e0a845218@mail.gmail.com>
	<A29BE1BD-7BA2-49F9-BCEC-829A63B11874@fastcrypt.com>
	<3f205b320604201703x2d5a52c7s214a039e36539a8a@mail.gmail.com>
	<DB439E45-9AF2-4EC9-8215-4A83DFE31A52@fastcrypt.com>
	<Pine.BSO.4.63.0604261551120.31984@leary2.csoft.net>
	<D65A5222-DACA-4BBC-97E0-C3D4BAAB2525@fastcrypt.com>
	<Pine.BSO.4.63.0604261827560.30145@leary2.csoft.net>
	<B8BAE173-D49A-4C20-82A9-6DA0950F4CF9@fastcrypt.com>
	<Pine.BSO.4.63.0604272109340.9036@leary2.csoft.net>
	<A137FA2D-7A4A-4385-8B6D-3B28E56AA0EE@fastcrypt.com>
	<Pine.BSO.4.63.0605032353450.1408@leary2.csoft.net>
	<2FAEA9A5-D1E5-4FEF-B464-46C730E6F356@fastcrypt.com>
	<Pine.BSO.4.63.0605101951250.386@leary2.csoft.net>
	<9726A637-9B48-426F-91A9-E1CBB6F1265B@fastcrypt.com>
	<Pine.BSO.4.63.0605102204330.10863@leary2.csoft.net>
	<0BEEAF9A-2E47-4E4F-AE8D-2846076FA037@fastcrypt.com>



On Sun, 21 May 2006, Dave Cramer wrote:

> Attached is a patch that works on 8.1 and 7.3 for sure
>

Applied to 8.1 and HEAD.  In the future please take more care that your 
editor does not make superfluous changes to the code.  There were a number 
of whitespace, bracket position, and other changes that make a diff harder 
to read.


In testing I found some other related bugs regarding trying to retrieve 
results that are not available as the attached test cases demonstrate.

Kris Jurka

Attachments:

cs-fetch-no-data-test.patch (text/plain, 1.4K) download Index: org/postgresql/test/jdbc2/CallableStmtTest.java =================================================================== RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/test/jdbc2/CallableStmtTest.java,v retrieving revision 1.18 diff -c -r1.18 CallableStmtTest.java *** org/postgresql/test/jdbc2/CallableStmtTest.java 14 Dec 2005 14:26:08 -0000 1.18 --- org/postgresql/test/jdbc2/CallableStmtTest.java 22 May 2006 10:04:42 -0000 *************** *** 175,180 **** --- 175,203 ---- assertEquals(1, call.getInt(1)); } + public void testFetchBeforeExecute() throws SQLException { + CallableStatement cs = con.prepareCall("{? = call lower(?)}"); + cs.registerOutParameter(1, Types.VARCHAR); + cs.setString(2, "Hi"); + try { + cs.getString(1); + fail("expected exception"); + } catch(Exception e) { + assertTrue(e instanceof SQLException); + } + } + + public void testFetchWithNoResults() throws SQLException { + CallableStatement cs = con.prepareCall("{call now()}"); + cs.execute(); + try { + cs.getObject(1); + fail("expected exception"); + } catch(Exception e) { + assertTrue(e instanceof SQLException); + } + } + public void testBadStmt () throws Throwable { tryOneBadStmt ("{ ?= " + pkgName + "getString (?) }");

view thread (21+ messages)  latest in thread

Message-ID: <Pine.BSO.4.63.0605220453380.22770@leary2.csoft.net>
Permalink:  ../Pine.BSO.4.63.0605220453380.22770@leary2.csoft.net/
Also on:    postgresql.org/message-id/Pine.BSO.4.63.0605220453380.22770@leary2.csoft.net

 ·  · 

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-jdbc@postgresql.org
  Cc: books@ejurka.com, pg@fastcrypt.com
  Subject: Re: Bug with callable statement and output parameters
  In-Reply-To: <Pine.BSO.4.63.0605220453380.22770@leary2.csoft.net>
  References: <3f205b320604201502o112f68abhafbc0a2e0a845218@mail.gmail.com> <A29BE1BD-7BA2-49F9-BCEC-829A63B11874@fastcrypt.com> <3f205b320604201703x2d5a52c7s214a039e36539a8a@mail.gmail.com> <DB439E45-9AF2-4EC9-8215-4A83DFE31A52@fastcrypt.com> <Pine.BSO.4.63.0604261551120.31984@leary2.csoft.net> <D65A5222-DACA-4BBC-97E0-C3D4BAAB2525@fastcrypt.com> <Pine.BSO.4.63.0604261827560.30145@leary2.csoft.net> <B8BAE173-D49A-4C20-82A9-6DA0950F4CF9@fastcrypt.com> <Pine.BSO.4.63.0604272109340.9036@leary2.csoft.net> <A137FA2D-7A4A-4385-8B6D-3B28E56AA0EE@fastcrypt.com> <Pine.BSO.4.63.0605032353450.1408@leary2.csoft.net> <2FAEA9A5-D1E5-4FEF-B464-46C730E6F356@fastcrypt.com> <Pine.BSO.4.63.0605101951250.386@leary2.csoft.net> <9726A637-9B48-426F-91A9-E1CBB6F1265B@fastcrypt.com> <Pine.BSO.4.63.0605102204330.10863@leary2.csoft.net> <0BEEAF9A-2E47-4E4F-AE8D-2846076FA037@fastcrypt.com> <Pine.BSO.4.63.0605220453380.22770@leary2.csoft.net>

* 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