提交 d93418ea authored 作者: Thomas Mueller's avatar Thomas Mueller

Require admin rights to change the log level.

上级 2a362b6b
......@@ -200,8 +200,10 @@ public class Set extends Prepared {
break;
case SetTypes.LOG: {
int value = getIntValue();
session.getUser().checkAdmin();
database.setLogMode(value);
if (database.isPersistent() && value != database.getLogMode()) {
session.getUser().checkAdmin();
database.setLogMode(value);
}
break;
}
case SetTypes.MAX_LENGTH_INPLACE_LOB: {
......
......@@ -173,7 +173,7 @@ public class TestRights extends TestBase {
executeSuccess("GRANT SELECT, INSERT, UPDATE ON TEST TO PASS_READER");
conn.close();
conn = getConnection("rights", "PASS_READER", getPassword("abc"));
conn = getConnection("rights;LOG=2", "PASS_READER", getPassword("abc"));
stat = conn.createStatement();
executeSuccess("SELECT * FROM PASS_NAME");
executeSuccess("SELECT * FROM (SELECT * FROM PASS_NAME)");
......@@ -241,7 +241,7 @@ public class TestRights extends TestBase {
} catch (SQLException e) {
assertKnownException(e);
}
conn = getConnection("rights", "TEST", getPassword("def"));
conn = getConnection("rights;LOG=2", "TEST", getPassword("def"));
stat = conn.createStatement();
executeError("SET DEFAULT_TABLE_TYPE MEMORY");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论