From 2b3bb341fe6c9f56154436aa90c9c4ef1e4d645c Mon Sep 17 00:00:00 2001
From: Bruce Momjian <bruce@momjian.us>
Date: Fri, 20 Mar 1998 22:03:55 +0000
Subject: [PATCH] This patch fixes a couple of minor bugs:

1) DatabaseMetaData.getPrimaryKeys() would fail saying that there
is no
   table t.

2) PreparedStatement.getObject() was missing some break statements,
which
   was causing updates not to work with JBuilder (supplied by Aaron
   Dunlop).


jdbc fixes from Peter.
---
 src/interfaces/jdbc/postgresql/DatabaseMetaData.java  | 2 +-
 src/interfaces/jdbc/postgresql/PreparedStatement.java | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/interfaces/jdbc/postgresql/DatabaseMetaData.java b/src/interfaces/jdbc/postgresql/DatabaseMetaData.java
index e3ffc3450ef..3aef2068cd3 100644
--- a/src/interfaces/jdbc/postgresql/DatabaseMetaData.java
+++ b/src/interfaces/jdbc/postgresql/DatabaseMetaData.java
@@ -2121,7 +2121,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
 						     "ic.relname AS COLUMN_NAME," +
 						     "'1' as KEY_SEQ,"+ // -- fake it as a String for now
 						     "t.typname as PK_NAME " +
-						     " FROM pg_class bc, pg_class ic, pg_index i, pg_attribute a " +
+						     " FROM pg_class bc, pg_class ic, pg_index i, pg_attribute a, pg_type t " +
 						     " WHERE relkind = 'r' " + //    -- not indices
 						     "  and bc.relname ~ '"+table+"'" +
 						     "  and i.indrelid = bc.oid" +
diff --git a/src/interfaces/jdbc/postgresql/PreparedStatement.java b/src/interfaces/jdbc/postgresql/PreparedStatement.java
index 659375064d3..1f82314e115 100644
--- a/src/interfaces/jdbc/postgresql/PreparedStatement.java
+++ b/src/interfaces/jdbc/postgresql/PreparedStatement.java
@@ -470,14 +470,19 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta
 			case Types.VARCHAR:
 			case Types.LONGVARCHAR:
 				setString(parameterIndex, x.toString());
+				break;
 			case Types.DATE:
 				setDate(parameterIndex, (java.sql.Date)x);
+				break;
 			case Types.TIME:
 				setTime(parameterIndex, (Time)x);
+				break;
 			case Types.TIMESTAMP:
 				setTimestamp(parameterIndex, (Timestamp)x);
+				break;
 			case Types.OTHER:
 				setString(parameterIndex, ((PGobject)x).getValue());
+				break;
 			default:
 				throw new SQLException("Unknown Types value");
 		}
-- 
GitLab