This is an automated email from the git hooks/post-receive script. ebourg-guest pushed a commit to tag REL8_0_312 in repository libpostgresql-jdbc-java.
commit 1abb5ce6c0c7d670e7e4ee03583ffca8c11ee911 Author: Dave Cramer <[email protected]> Date: Wed Jun 8 16:21:02 2005 +0000 Applying HEAD changes to stable branch Fix CallableStatement.getShort, and added test --- org/postgresql/jdbc2/AbstractJdbc2Statement.java | 4 ++-- org/postgresql/test/jdbc2/CallableStmtTest.java | 14 +++++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/org/postgresql/jdbc2/AbstractJdbc2Statement.java b/org/postgresql/jdbc2/AbstractJdbc2Statement.java index 8bb353e..f018cd2 100644 --- a/org/postgresql/jdbc2/AbstractJdbc2Statement.java +++ b/org/postgresql/jdbc2/AbstractJdbc2Statement.java @@ -3,7 +3,7 @@ * Copyright (c) 2004-2005, PostgreSQL Global Development Group * * IDENTIFICATION -* $PostgreSQL: pgjdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java,v 1.68.2.5 2005/04/28 14:18:09 jurka Exp $ +* $PostgreSQL: pgjdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java,v 1.68.2.6 2005/05/08 23:52:00 jurka Exp $ * *------------------------------------------------------------------------- */ @@ -1811,7 +1811,7 @@ public abstract class AbstractJdbc2Statement implements BaseStatement checkIndex (parameterIndex, Types.SMALLINT, "Short"); if (callResult == null) return 0; - return (short)((Short)callResult).intValue (); + return ((Integer)callResult).shortValue (); } diff --git a/org/postgresql/test/jdbc2/CallableStmtTest.java b/org/postgresql/test/jdbc2/CallableStmtTest.java index eedbf91..e48e213 100644 --- a/org/postgresql/test/jdbc2/CallableStmtTest.java +++ b/org/postgresql/test/jdbc2/CallableStmtTest.java @@ -3,7 +3,7 @@ * Copyright (c) 2004-2005, PostgreSQL Global Development Group * * IDENTIFICATION -* $PostgreSQL: pgjdbc/org/postgresql/test/jdbc2/CallableStmtTest.java,v 1.12 2005/01/11 08:25:48 jurka Exp $ +* $PostgreSQL: pgjdbc/org/postgresql/test/jdbc2/CallableStmtTest.java,v 1.12.2.1 2005/02/10 19:52:45 jurka Exp $ * *------------------------------------------------------------------------- */ @@ -40,6 +40,9 @@ public class CallableStmtTest extends TestCase stmt.execute ("CREATE OR REPLACE FUNCTION testspg__getInt (int) RETURNS int " + " AS 'DECLARE inString alias for $1; begin " + "return 42; end;' LANGUAGE 'plpgsql';"); + stmt.execute ("CREATE OR REPLACE FUNCTION testspg__getShort (int2) RETURNS int2 " + + " AS 'DECLARE inString alias for $1; begin " + + "return 42; end;' LANGUAGE 'plpgsql';"); stmt.execute ("CREATE OR REPLACE FUNCTION testspg__getNumeric (numeric) " + "RETURNS numeric AS ' DECLARE inString alias for $1; " + "begin return 42; end; ' LANGUAGE 'plpgsql';"); @@ -57,6 +60,7 @@ public class CallableStmtTest extends TestCase stmt.execute ("drop FUNCTION testspg__getString (varchar);"); stmt.execute ("drop FUNCTION testspg__getDouble (float);"); stmt.execute ("drop FUNCTION testspg__getInt (int);"); + stmt.execute ("drop FUNCTION testspg__getShort(int2)"); stmt.execute ("drop FUNCTION testspg__getNumeric (numeric);"); stmt.execute ("drop FUNCTION testspg__getNumericWithoutArg ();"); stmt.execute ("DROP FUNCTION getarray();"); @@ -89,6 +93,14 @@ public class CallableStmtTest extends TestCase assertEquals(42, call.getInt(1)); } + public void testGetShort () throws Throwable + { + CallableStatement call = con.prepareCall (func + pkgName + "getShort (?) }"); + call.setShort (2, (short)4); + call.registerOutParameter (1, Types.SMALLINT); + call.execute (); + assertEquals(42, call.getShort(1)); + } public void testGetNumeric () throws Throwable { CallableStatement call = con.prepareCall (func + pkgName + "getNumeric (?) }"); -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/libpostgresql-jdbc-java.git _______________________________________________ pkg-java-commits mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-java-commits

