diff options
author | Barry Lind <barry@xythos.com> | 2003-03-24 03:48:32 +0000 |
---|---|---|
committer | Barry Lind <barry@xythos.com> | 2003-03-24 03:48:32 +0000 |
commit | 1e3372e6bbceddc7b9f0f7f92d8c2253838e2836 (patch) | |
tree | c859cf2c5fb14278451cabdcc54aa558989607f2 /src/interfaces/jdbc/org/postgresql/test | |
parent | 0489783011ee277476bd9076767b39f08c0e0cd1 (diff) |
Fix bug in reading acls (didn't treat null acl as meaning the table owner had
full privs), also updated the regression test for this case.
Modified Files:
jdbc/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java
jdbc/org/postgresql/test/jdbc2/DatabaseMetaDataTest.java
Diffstat (limited to 'src/interfaces/jdbc/org/postgresql/test')
-rw-r--r-- | src/interfaces/jdbc/org/postgresql/test/jdbc2/DatabaseMetaDataTest.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/interfaces/jdbc/org/postgresql/test/jdbc2/DatabaseMetaDataTest.java b/src/interfaces/jdbc/org/postgresql/test/jdbc2/DatabaseMetaDataTest.java index 9ee4c0ab50c..faf23a5c85e 100644 --- a/src/interfaces/jdbc/org/postgresql/test/jdbc2/DatabaseMetaDataTest.java +++ b/src/interfaces/jdbc/org/postgresql/test/jdbc2/DatabaseMetaDataTest.java @@ -9,7 +9,7 @@ import java.sql.*; * * PS: Do you know how difficult it is to type on a train? ;-) * - * $Id: DatabaseMetaDataTest.java,v 1.16 2002/11/11 07:11:12 barry Exp $ + * $Id: DatabaseMetaDataTest.java,v 1.17 2003/03/24 03:48:32 barry Exp $ */ public class DatabaseMetaDataTest extends TestCase @@ -237,13 +237,19 @@ public class DatabaseMetaDataTest extends TestCase public void testTablePrivileges() { - // At the moment just test that no exceptions are thrown KJ try { DatabaseMetaData dbmd = con.getMetaData(); assertNotNull(dbmd); - ResultSet rs = dbmd.getTablePrivileges(null,null,"grantme"); + ResultSet rs = dbmd.getTablePrivileges(null,null,"testmetadata"); + boolean l_foundSelect = false; + while (rs.next()) { + if (rs.getString("GRANTEE").equals(TestUtil.getUser()) + && rs.getString("PRIVILEGE").equals("SELECT")) l_foundSelect = true; + } rs.close(); + //Test that the table owner has select priv + assertTrue("Couldn't find SELECT priv on table testmetadata for " + TestUtil.getUser(),l_foundSelect); } catch (SQLException sqle) { sqle.printStackTrace(); fail(sqle.getMessage()); |