41 final String sharedTableName =
"table_shared";
42 for (
int i = 0; i < max; i++) {
43 final long tid = Thread.currentThread().getId();
44 final String threadPrefix =
"[" + tid +
"] ",
45 tableName =
"table_" + prefix +
"_" + i,
46 viewName =
"view_" + prefix +
"_" + i,
47 dashName =
"dash_" + prefix +
"_" + i;
50 for (
int id : dashboardIds) {
51 TDashboard board = dba.get_dashboard(id);
52 logger.info(
"REPLACE DASHBOARD id (" +
id +
") " + board.dashboard_name);
53 dba.replace_dashboard(board.dashboard_id, board.dashboard_name +
"_",
admin);
56 logger.info(threadPrefix +
"CREATE TABLE " + tableName);
57 user.runSql(
"CREATE TABLE " + tableName +
" (id text);");
58 HeavyDBAsserts.assertEqual(
true, null != dba.get_table_details(tableName));
59 logger.info(threadPrefix +
"INSERT INTO " + tableName);
60 user.runSql(
"INSERT INTO " + tableName +
" VALUES(1);");
61 dba.runSql(
"GRANT SELECT ON TABLE " + tableName +
" TO bob;");
63 logger.info(threadPrefix +
"CREATE VIEW " + viewName);
64 user.runSql(
"CREATE VIEW " + viewName +
" AS SELECT * FROM " + tableName +
";");
65 HeavyDBAsserts.assertEqual(
true, null != dba.get_table_details(viewName));
66 dba.runSql(
"GRANT SELECT ON VIEW " + viewName +
" TO bob;");
68 logger.info(threadPrefix +
"CREATE DASHBOARD " + dashName);
69 int dash_id = user.create_dashboard(dashName);
70 HeavyDBAsserts.assertEqual(
true, null != dba.get_dashboard(dash_id));
71 dba.runSql(
"GRANT VIEW ON DASHBOARD " + dash_id +
" TO bob;");
73 dba.runSql(
"REVOKE VIEW ON DASHBOARD " + dash_id +
" FROM bob;");
74 dba.runSql(
"REVOKE SELECT ON VIEW " + viewName +
" FROM bob;");
75 dba.runSql(
"REVOKE SELECT ON TABLE " + tableName +
" FROM bob;");
77 logger.info(threadPrefix +
"DELETE DASHBOARD " + dashName);
78 dba.delete_dashboard(dash_id);
79 logger.info(threadPrefix +
"DROP VIEW " + viewName);
80 dba.runSql(
"DROP VIEW " + viewName +
";");
81 logger.info(threadPrefix +
"DROP TABLE " + tableName);
82 dba.runSql(
"DROP TABLE " + tableName +
";");
84 logger.info(threadPrefix +
"CREATE IF NOT EXISTS " + sharedTableName);
85 dba.runSql(
"CREATE TABLE IF NOT EXISTS " + sharedTableName +
" (id INTEGER);");
87 logger.info(threadPrefix +
"DROP IF EXISTS " + sharedTableName);
88 dba.runSql(
"DROP TABLE IF EXISTS " + sharedTableName +
";");
static final String admin