提交 80fcd4a5 authored 作者: Thomas Mueller's avatar Thomas Mueller

Some DatabaseMetaData operations did not work for non-admin users for versions 1.1.x.

上级 e1381de3
......@@ -511,7 +511,6 @@ public class TestCases extends TestBase {
trace("testDoubleRecovery");
deleteDb("cases");
Connection conn = getConnection("cases");
deleteDb("twoPhaseCommit");
Statement stat = conn.createStatement();
stat.execute("SET WRITE_DELAY 0");
stat.execute("DROP TABLE IF EXISTS TEST");
......
......@@ -7,6 +7,7 @@
package org.h2.test.db;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
......@@ -32,6 +33,7 @@ public class TestRights extends TestBase {
}
public void test() throws SQLException {
testGetTables();
testDropTempTables();
// testLowerCaseUser();
testSchemaRenameUser();
......@@ -54,6 +56,21 @@ public class TestRights extends TestBase {
// conn.close();
// }
private void testGetTables() throws SQLException {
deleteDb("rights");
Connection conn = getConnection("rights");
stat = conn.createStatement();
stat.execute("CREATE USER IF NOT EXISTS TEST PASSWORD 'TEST'");
stat.execute("CREATE TABLE TEST(ID INT)");
stat.execute("GRANT ALL ON TEST TO TEST");
Connection conn2 = getConnection("rights", "TEST", getPassword("TEST"));
DatabaseMetaData meta = conn2.getMetaData();
meta.getTables(null, null, "%", new String[]{"TABLE", "VIEW", "SEQUENCE"});
conn2.close();
conn.close();
}
private void testDropTempTables() throws SQLException {
deleteDb("rights");
Connection conn = getConnection("rights");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论