提交 06698d68 authored 作者: Thomas Mueller's avatar Thomas Mueller

Granting a additional right to a role that already had a right for that table was not working.

上级 00b26a11
......@@ -18,7 +18,8 @@ Change Log
<h1>Change Log</h1>
<h2>Next Version (unreleased)</h2>
<ul><li>Spatial index: a few bugs have been fixed (using spatial constraints in views,
<ul><li>Granting a additional right to a role that already had a right for that table was not working.
</li><li>Spatial index: a few bugs have been fixed (using spatial constraints in views,
transfering geometry objects over TCP/IP).
</li><li>Issue 551: the datatype documentation was incorrect (found by Bernd Eckenfels).
</li><li>Issue 368: ON DUPLICATE KEY UPDATE did not work for multi-row inserts.
......
......@@ -115,6 +115,7 @@ public class GrantRevoke extends DefineCommand {
db.addDatabaseObject(session, right);
} else {
right.setRightMask(right.getRightMask() | rightMask);
db.update(session, right);
}
}
}
......
......@@ -35,6 +35,7 @@ public class TestRights extends TestBase {
@Override
public void test() throws SQLException {
testGrantMore();
testOpenNonAdminWithMode();
testDisallowedTables();
testDropOwnUser();
......@@ -46,6 +47,26 @@ public class TestRights extends TestBase {
testSchemaAdminRole();
deleteDb("rights");
}
private void testGrantMore() throws SQLException {
deleteDb("rights");
Connection conn = getConnection("rights");
stat = conn.createStatement();
stat.execute("create role new_role");
stat.execute("create table test(id int)");
stat.execute("grant select on test to new_role");
ResultSet rs = stat.executeQuery("select * from information_schema.table_privileges");
assertTrue(rs.next());
assertFalse(rs.next());
stat.execute("grant insert on test to new_role");
rs = stat.executeQuery("select * from information_schema.table_privileges");
assertTrue(rs.next());
assertTrue(rs.next());
assertFalse(rs.next());
stat.execute("drop table test");
stat.execute("drop role new_role");
conn.close();
}
private void testOpenNonAdminWithMode() throws SQLException {
if (config.memory) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论