diff options
author | Marc G. Fournier | 1998-02-02 13:17:01 +0000 |
---|---|---|
committer | Marc G. Fournier | 1998-02-02 13:17:01 +0000 |
commit | 4e9dd952966b600951f05ab2913b5b97936d42ba (patch) | |
tree | 9f0fada5717856c244f94f19f9a3829a4c21270e /src/interfaces/jdbc/postgresql/DatabaseMetaData.java | |
parent | 67c92f423aae5bb2500b7dffb0fc2a4267d2e546 (diff) |
From: Peter T Mount <[email protected]>
[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!).
Diffstat (limited to 'src/interfaces/jdbc/postgresql/DatabaseMetaData.java')
-rw-r--r-- | src/interfaces/jdbc/postgresql/DatabaseMetaData.java | 46 |
1 files changed, 22 insertions, 24 deletions
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); } /** |