From 4e9dd952966b600951f05ab2913b5b97936d42ba Mon Sep 17 00:00:00 2001 From: "Marc G. Fournier" Date: Mon, 2 Feb 1998 13:17:01 +0000 Subject: From: Peter T Mount [This is a repost - it supercedes the previous one. It fixes the patch so it doesn't bread aix port, plus there's a file missing out of the original post because difforig doesn't pick up new files. It's now attached. peter] This patch brings the JDBC driver up to the current protocol spec. Basically, the backend now tells the driver what authentication scheme to use. The patch also fixes a performance problem with large objects. In the buffer manager, each fastpath call was sending multiple Notifications to the backend (sometimes more data in the form of notifications were being sent than blob data!). --- .../jdbc/postgresql/DatabaseMetaData.java | 46 +++++++++++----------- 1 file changed, 22 insertions(+), 24 deletions(-) (limited to 'src/interfaces/jdbc/postgresql/DatabaseMetaData.java') diff --git a/src/interfaces/jdbc/postgresql/DatabaseMetaData.java b/src/interfaces/jdbc/postgresql/DatabaseMetaData.java index 4e3894f66b..47c257e782 100644 --- a/src/interfaces/jdbc/postgresql/DatabaseMetaData.java +++ b/src/interfaces/jdbc/postgresql/DatabaseMetaData.java @@ -1925,30 +1925,28 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData */ public java.sql.ResultSet getColumnPrivileges(String catalog, String schema, String table, String columnNamePattern) throws SQLException { - // XXX-Not Implemented as grant is broken - return null; - //Field f[] = new Field[8]; - //Vector v = new Vector(); - // - //f[0] = new Field(connection,new String("TABLE_CAT"),iVarcharOid,32); - //f[1] = new Field(connection,new String("TABLE_SCHEM"),iVarcharOid,32); - //f[2] = new Field(connection,new String("TABLE_NAME"),iVarcharOid,32); - //f[3] = new Field(connection,new String("COLUMN_NAME"),iVarcharOid,32); - //f[4] = new Field(connection,new String("GRANTOR"),iVarcharOid,32); - //f[5] = new Field(connection,new String("GRANTEE"),iVarcharOid,32); - //f[6] = new Field(connection,new String("PRIVILEGE"),iVarcharOid,32); - //f[7] = new Field(connection,new String("IS_GRANTABLE"),iVarcharOid,32); - // - //// This is taken direct from the psql source - //ResultSet r = connection.ExecSQL("SELECT relname, relacl FROM pg_class, pg_user WHERE ( relkind = 'r' OR relkind = 'i') and relname !~ '^pg_' and relname !~ '^xin[vx][0-9]+' and usesysid = relowner ORDER BY relname"); - //while(r.next()) { - //byte[][] tuple = new byte[8][0]; - //tuple[0] = tuple[1]= "default".getBytes(); - // - //v.addElement(tuple); - //} - // - //return new ResultSet(connection,f,v,"OK",1); + Field f[] = new Field[8]; + Vector v = new Vector(); + + f[0] = new Field(connection,new String("TABLE_CAT"),iVarcharOid,32); + f[1] = new Field(connection,new String("TABLE_SCHEM"),iVarcharOid,32); + f[2] = new Field(connection,new String("TABLE_NAME"),iVarcharOid,32); + f[3] = new Field(connection,new String("COLUMN_NAME"),iVarcharOid,32); + f[4] = new Field(connection,new String("GRANTOR"),iVarcharOid,32); + f[5] = new Field(connection,new String("GRANTEE"),iVarcharOid,32); + f[6] = new Field(connection,new String("PRIVILEGE"),iVarcharOid,32); + f[7] = new Field(connection,new String("IS_GRANTABLE"),iVarcharOid,32); + + // This is taken direct from the psql source + ResultSet r = connection.ExecSQL("SELECT relname, relacl FROM pg_class, pg_user WHERE ( relkind = 'r' OR relkind = 'i') and relname !~ '^pg_' and relname !~ '^xin[vx][0-9]+' and usesysid = relowner ORDER BY relname"); + while(r.next()) { + byte[][] tuple = new byte[8][0]; + tuple[0] = tuple[1]= "".getBytes(); + DriverManager.println("relname=\""+r.getString(1)+"\" relacl=\""+r.getString(2)+"\""); + //v.addElement(tuple); + } + + return new ResultSet(connection,f,v,"OK",1); } /** -- cgit v1.2.1