Skip to content

Commit ba7c2d2

Browse files
author
Barry Lind
committed
Backed out part of the change from 1.6. The attempt to support int8 binds
in such a way that indexes on int8 columns would be used (by quoting the value) caused other problems. Will need to wait for the backend to properly fix the root problem. Modified Files: jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
1 parent 76d09f4 commit ba7c2d2

File tree

1 file changed

+7
-25
lines changed

1 file changed

+7
-25
lines changed

src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import org.postgresql.largeobject.*;
99
import org.postgresql.util.*;
1010

11-
/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Statement.java,v 1.11 2002/10/01 00:39:02 davec Exp $
11+
/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Statement.java,v 1.12 2002/10/19 21:53:42 barry Exp $
1212
* This class defines methods of the jdbc1 specification. This class is
1313
* extended by org.postgresql.jdbc2.AbstractJdbc2Statement which adds the jdbc2
1414
* methods. The real Statement class (for jdbc1) is org.postgresql.jdbc1.Jdbc1Statement
@@ -763,10 +763,7 @@ public void setByte(int parameterIndex, byte x) throws SQLException
763763
*/
764764
public void setShort(int parameterIndex, short x) throws SQLException
765765
{
766-
//Note this should be fixed
767-
//as soon as the backend correctly supports int8 type
768-
//comparisons
769-
bind(parameterIndex, "'" + Integer.toString(x) + "'", PG_INT2);
766+
bind(parameterIndex, Integer.toString(x), PG_INT2);
770767
}
771768

772769
/*
@@ -792,10 +789,7 @@ public void setInt(int parameterIndex, int x) throws SQLException
792789
*/
793790
public void setLong(int parameterIndex, long x) throws SQLException
794791
{
795-
//Note this should be fixed
796-
//as soon as the backend correctly supports int8 type
797-
//comparisons
798-
bind(parameterIndex, "'" + Long.toString(x) + "'", PG_INT8);
792+
bind(parameterIndex, Long.toString(x), PG_INT8);
799793
}
800794

801795
/*
@@ -808,10 +802,7 @@ public void setLong(int parameterIndex, long x) throws SQLException
808802
*/
809803
public void setFloat(int parameterIndex, float x) throws SQLException
810804
{
811-
//Note this should be fixed
812-
//as soon as the backend correctly supports int8 type
813-
//comparisons
814-
bind(parameterIndex, "'" + Float.toString(x) + "'", PG_FLOAT);
805+
bind(parameterIndex, Float.toString(x), PG_FLOAT);
815806
}
816807

817808
/*
@@ -824,10 +815,7 @@ public void setFloat(int parameterIndex, float x) throws SQLException
824815
*/
825816
public void setDouble(int parameterIndex, double x) throws SQLException
826817
{
827-
//Note this should be fixed
828-
//as soon as the backend correctly supports int8 type
829-
//comparisons
830-
bind(parameterIndex, "'" + Double.toString(x) + "'", PG_DOUBLE);
818+
bind(parameterIndex, Double.toString(x), PG_DOUBLE);
831819
}
832820

833821
/*
@@ -845,10 +833,7 @@ public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException
845833
setNull(parameterIndex, Types.OTHER);
846834
else
847835
{
848-
//Note this should be fixed
849-
//as soon as the backend correctly supports int8 type
850-
//comparisons
851-
bind(parameterIndex, "'" + x.toString() + "'", PG_NUMERIC);
836+
bind(parameterIndex, x.toString(), PG_NUMERIC);
852837
}
853838
}
854839

@@ -1322,10 +1307,7 @@ public void setObject(int parameterIndex, Object x, int targetSqlType, int scale
13221307
if (x instanceof Boolean)
13231308
bind(parameterIndex, ((Boolean)x).booleanValue() ? "1" : "0", PG_BOOLEAN);
13241309
else
1325-
//Note this should be fixed
1326-
//as soon as the backend correctly supports int8 type
1327-
//comparisons
1328-
bind(parameterIndex, "'" + x.toString() + "'", PG_NUMERIC);
1310+
bind(parameterIndex, x.toString(), PG_NUMERIC);
13291311
break;
13301312
case Types.CHAR:
13311313
case Types.VARCHAR:

0 commit comments

Comments
 (0)