Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: allow modify usage_schema database
* ci: reduce sleep time
- Loading branch information
Showing
10 changed files
with
102 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
query_server/sqllogicaltests/cases/sys_table/usage_schema/usage_schema_privilege.slt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
statement ok | ||
create table usage_schema.test_privilege (a bigint); | ||
|
||
statement ok | ||
insert into table usage_schema.test_privilege (time, a) | ||
values (1, 1); | ||
|
||
query T | ||
select * from usage_schema.test_privilege; | ||
---- | ||
1970-01-01T00:00:00.000000001 1 | ||
|
||
statement ok | ||
drop table usage_schema.test_privilege; |
2 changes: 1 addition & 1 deletion
2
query_server/test/cases/sys_table/usage_schema/coord_data_in.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
query_server/test/cases/sys_table/usage_schema/coord_data_out.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
query_server/test/cases/sys_table/usage_schema/usage_schema_privilege.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
-- EXECUTE SQL: create user test_usage_schema_user; -- | ||
200 OK | ||
|
||
|
||
-- EXECUTE SQL: create role write_usage_schema_role inherit member; -- | ||
200 OK | ||
|
||
|
||
-- EXECUTE SQL: grant write on database usage_schema to role write_usage_schema_role; -- | ||
200 OK | ||
|
||
|
||
-- EXECUTE SQL: alter tenant cnosdb add user test_usage_schema_user as write_usage_schema_role; -- | ||
200 OK | ||
|
||
|
||
-- EXECUTE SQL: create table usage_schema.test_privilege (a bigint); -- | ||
200 OK | ||
|
||
|
||
-- EXECUTE SQL: insert into usage_schema.test_privilege (time, a) values (1, 1); -- | ||
200 OK | ||
rows | ||
1 | ||
|
||
-- EXECUTE SQL: drop table usage_schema.test_privilege; -- | ||
200 OK | ||
|
||
|
||
-- EXECUTE SQL: alter tenant cnosdb remove user test_usage_schema_user; -- | ||
200 OK | ||
|
||
|
||
-- EXECUTE SQL: drop role write_usage_schema_role; -- | ||
200 OK | ||
|
||
|
||
-- EXECUTE SQL: drop user test_usage_schema_user; -- | ||
200 OK | ||
|
||
|
||
-- EXECUTE SQL: insert into usage_schema.coord_data_in (time, database, tenant, value) values (1, 'invalid', 'invalid', 1); -- | ||
200 OK | ||
rows | ||
1 |
24 changes: 24 additions & 0 deletions
24
query_server/test/cases/sys_table/usage_schema/usage_schema_privilege.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
create user test_usage_schema_user; | ||
|
||
create role write_usage_schema_role inherit member; | ||
|
||
grant write on database usage_schema to role write_usage_schema_role; | ||
|
||
alter tenant cnosdb add user test_usage_schema_user as write_usage_schema_role; | ||
|
||
create table usage_schema.test_privilege (a bigint); | ||
|
||
--#USER_NAME=test_usage_schema_user | ||
insert into usage_schema.test_privilege (time, a) values (1, 1); | ||
|
||
--#USER_NAME=root | ||
drop table usage_schema.test_privilege; | ||
|
||
alter tenant cnosdb remove user test_usage_schema_user; | ||
|
||
drop role write_usage_schema_role; | ||
|
||
drop user test_usage_schema_user; | ||
|
||
insert into usage_schema.coord_data_in (time, database, tenant, value) values (1, 'invalid', 'invalid', 1); | ||
|
2 changes: 1 addition & 1 deletion
2
query_server/test/cases/sys_table/usage_schema/user_queries.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--#DATABASE = usage_schema | ||
--#SLEEP = 10000 | ||
--#SLEEP = 100 | ||
DESCRIBE DATABASE usage_schema; | ||
|
||
DESCRIBE TABLE user_queries; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--#DATABASE = usage_schema | ||
--#SLEEP = 10000 | ||
--#SLEEP = 100 | ||
DESCRIBE DATABASE usage_schema; | ||
|
||
DESCRIBE TABLE user_writes; |
2 changes: 1 addition & 1 deletion
2
query_server/test/cases/sys_table/usage_schema/vnode_cache_size.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
query_server/test/cases/sys_table/usage_schema/vnode_disk_storage.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--#DATABASE = usage_schema | ||
--#SLEEP = 10000 | ||
--#SLEEP = 100 | ||
DESCRIBE DATABASE usage_schema; | ||
|
||
DESCRIBE TABLE vnode_disk_storage; |