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