Skip to content

Commit

Permalink
Allow the driver to support setObject with Types.DISTINCT.
Browse files Browse the repository at this point in the history
We report metadata indicating that values are of this type, so
we'd better accept it coming back in.

Reported by Vitalii Tymchyshyn.
  • Loading branch information
kjurka committed Mar 20, 2011
1 parent 81b4c0b commit 7036ca4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion org/postgresql/jdbc2/AbstractJdbc2Statement.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright (c) 2004-2008, PostgreSQL Global Development Group
*
* IDENTIFICATION
* $PostgreSQL: pgjdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java,v 1.107.2.3 2009/09/26 15:21:34 jurka Exp $
* $PostgreSQL: pgjdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java,v 1.107.2.4 2010/05/01 16:08:04 jurka Exp $
*
*-------------------------------------------------------------------------
*/
Expand Down Expand Up @@ -1687,6 +1687,9 @@ public void setObject(int parameterIndex, Object in, int targetSqlType, int scal
else
throw new PSQLException(GT.tr("Cannot cast an instance of {0} to type {1}", new Object[]{in.getClass().getName(),"Types.ARRAY"}), PSQLState.INVALID_PARAMETER_TYPE);
break;
case Types.DISTINCT:
bindString(parameterIndex, in.toString(), Oid.UNSPECIFIED);
break;
case Types.OTHER:
if (in instanceof PGobject)
setPGobject(parameterIndex, (PGobject)in);
Expand Down

0 comments on commit 7036ca4

Please sign in to comment.