Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 28ce9f0

Browse files
author
Barry Lind
committed
Two patches from Kris Jurka. One fixes a problem with incorrect type for double
and the other fixes a NPE in Statement.toString() under some circumstances. The second patch was originally submitted by Oliver Jowett and updated by Kris
1 parent 16a3034 commit 28ce9f0

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

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

+7-4
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.15 2003/02/04 09:20:08 barry Exp $
11+
/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Statement.java,v 1.16 2003/02/04 10:09:32 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
@@ -1890,18 +1890,21 @@ public Object getObject(int parameterIndex)
18901890
*/
18911891
public String toString()
18921892
{
1893+
if (m_sqlFragments == null)
1894+
return "";
1895+
18931896
synchronized (sbuf)
18941897
{
18951898
sbuf.setLength(0);
18961899
int i;
18971900

18981901
for (i = 0 ; i < m_binds.length ; ++i)
18991902
{
1903+
sbuf.append (m_sqlFragments[i]);
19001904
if (m_binds[i] == null)
19011905
sbuf.append( '?' );
19021906
else
1903-
sbuf.append (m_sqlFragments[i]);
1904-
sbuf.append (m_binds[i]);
1907+
sbuf.append (m_binds[i]);
19051908
}
19061909
sbuf.append(m_sqlFragments[m_binds.length]);
19071910
return sbuf.toString();
@@ -2070,7 +2073,7 @@ public boolean isUseServerPrepare()
20702073
private static final String PG_INT8 = "int8";
20712074
private static final String PG_NUMERIC = "numeric";
20722075
private static final String PG_FLOAT = "float";
2073-
private static final String PG_DOUBLE = "double";
2076+
private static final String PG_DOUBLE = "double precision";
20742077
private static final String PG_BOOLEAN = "boolean";
20752078
private static final String PG_DATE = "date";
20762079
private static final String PG_TIME = "time";

0 commit comments

Comments
 (0)