Permalink
Browse files

revert: undo changes to getTypeInfo which removed core types

  • Loading branch information...
davecramer committed Oct 20, 2015
1 parent 0fa888a commit 779ce1859bead6ff1f80a2c2e9bbc7c4347206d6
@@ -3965,7 +3965,7 @@ else if ("restrict".equals(rule))
{
sql = "SELECT t.typname,t.oid FROM pg_catalog.pg_type t"
+ " JOIN pg_catalog.pg_namespace n ON (t.typnamespace = n.oid) "
+ " WHERE n.nspname not in ('pg_toast','pg_catalog', 'information_schema')";
+ " WHERE n.nspname != 'pg_toast'";
}
else
{
@@ -8,10 +8,14 @@
package org.postgresql.test.jdbc2;
import org.postgresql.test.TestUtil;
import junit.framework.TestCase;
import java.sql.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/*
* TestCase to test the internal functionality of org.postgresql.jdbc2.DatabaseMetaData
@@ -1099,6 +1103,89 @@ public void testGetUDT4() throws Exception
}
}
private String [] typeArray = new String[] {"bool",
"bytea",
"char",
"name",
"int8",
"int2",
"int2vector",
"int4",
"regproc",
"text",
"oid",
"tid",
"xid",
"cid",
"oidvector",
"smgr",
"point",
"lseg",
"path",
"box",
"polygon",
"line",
"float4",
"float8",
"abstime",
"reltime",
"tinterval",
"unknown",
"circle",
"money",
"macaddr",
"inet",
"cidr",
"aclitem",
"bpchar",
"varchar",
"date",
"time",
"timestamp",
"timestamptz",
"interval",
"timetz",
"bit",
"varbit",
"numeric",
"refcursor",
"regprocedure",
"regoper",
"regoperator",
"regclass",
"regtype",
"int4range",
"numrange",
"tsrange",
"tstzrange",
"daterange",
"int8range",
"record",
"cstring",
"any",
"anyarray",
"void",
"anyelement",
"anynonarray",
"anyenum",
"anyrange",
};
public void testTypes() throws SQLException
{
DatabaseMetaData dbmd = con.getMetaData();
ResultSet rs = dbmd.getTypeInfo();
Map types = new HashMap();
while (rs.next())
{
types.put(rs.getString("TYPE_NAME"),true);
}
for (String typeName : typeArray)
{
assertTrue(types.containsKey(typeName));
}
}
public void testTypeInfoSigned() throws SQLException
{
DatabaseMetaData dbmd = con.getMetaData();

0 comments on commit 779ce18

Please sign in to comment.