github.com/matrixorigin/matrixone@v0.7.0/test/distributed/cases/tenant/privilege/operate_catalog.sql (about) 1 -- the administrator can only read the content of catalog. 2 drop database mo_catalog; 3 drop database system; 4 drop database system_metrics; 5 drop database information_schema; 6 7 use mo_catalog; 8 drop table mo_database; 9 drop table mo_tables; 10 drop table mo_columns; 11 drop table mo_user; 12 drop table mo_account; 13 drop table mo_role; 14 drop table mo_user_grant; 15 drop table mo_role_grant; 16 drop table mo_role_privs; 17 create table A(a int); 18 drop table mo_catalog.mo_database; 19 drop table mo_catalog.mo_tables; 20 drop table mo_catalog.mo_columns; 21 drop table mo_catalog.mo_user; 22 drop table mo_catalog.mo_account; 23 drop table mo_catalog.mo_role; 24 drop table mo_catalog.mo_user_grant; 25 drop table mo_catalog.mo_role_grant; 26 drop table mo_catalog.mo_role_privs; 27 create table mo_catalog.A(a int); 28 update mo_role_grant set granted_id = 0; 29 update mo_catalog.mo_role_grant set granted_id = 0; 30 insert into mo_role_grant values (100,101,0,0,"2022-10-09 00:00:00",true); 31 insert into mo_catalog.mo_role_grant values (100,101,0,0,"2022-10-09 00:00:00",true); 32 delete from mo_role_grant; 33 delete from mo_catalog.mo_role_grant; 34 35 use system; 36 drop table statement_info; 37 drop table span_info; 38 drop table log_info; 39 drop table error_info; 40 create table A(a int); 41 drop table system.statement_info; 42 drop table system.span_info; 43 drop table system.log_info; 44 drop table system.error_info; 45 create table system.A(a int); 46 update statement_info set statement_id = "1111"; 47 update error_info set err_code = "1111"; 48 update system.error_info set err_code = "1111"; 49 insert into error_info values ("2022-10-09 00:00:00", "1", "1", "1", "1", "1"); 50 insert into system.error_info values ("2022-10-09 00:00:00", "1", "1", "1", "1", "1"); 51 delete from error_info; 52 delete from system.error_info; 53 delete from system.statement_info; 54 55 use system_metrics; 56 drop table sql_statement_total; 57 drop table sql_transaction_errors; 58 drop table sql_statement_errors; 59 drop table server_connections; 60 drop table process_cpu_percent; 61 drop table process_resident_memory_bytes; 62 drop table process_open_fds; 63 drop table process_max_fds; 64 drop table sys_cpu_seconds_total; 65 drop table sys_cpu_combined_percent; 66 drop table sys_memory_used; 67 drop table sys_memory_available; 68 drop table sys_disk_read_bytes; 69 drop table sys_disk_write_bytes; 70 drop table sys_net_recv_bytes; 71 drop table sys_net_sent_bytes; 72 create table A(a int); 73 drop table system_metrics.sql_statement_total; 74 drop table system_metrics.sql_transaction_errors; 75 drop table system_metrics.sql_statement_errors; 76 drop table system_metrics.server_connections; 77 drop table system_metrics.process_cpu_percent; 78 drop table system_metrics.process_resident_memory_bytes; 79 drop table system_metrics.process_open_fds; 80 drop table system_metrics.process_max_fds; 81 drop table system_metrics.sys_cpu_seconds_total; 82 drop table system_metrics.sys_cpu_combined_percent; 83 drop table system_metrics.sys_memory_used; 84 drop table system_metrics.sys_memory_available; 85 drop table system_metrics.sys_disk_read_bytes; 86 drop table system_metrics.sys_disk_write_bytes; 87 drop table system_metrics.sys_net_recv_bytes; 88 drop table system_metrics.sys_net_sent_bytes; 89 create table system_metrics.A(a int); 90 update sql_statement_total set type = "1"; 91 update system_metrics.sql_statement_total set type = "1"; 92 insert into sql_statement_total values ("2022-10-09 00:00:00",0,"1","1","1","1"); 93 insert into system_metrics.sql_statement_total values ("2022-10-09 00:00:00",0,"1","1","1","1"); 94 95 drop table if exists mysql.user; 96 drop table if exists mysql.db; 97 drop table if exists mysql.procs_priv; 98 drop table if exists mysql.columns_priv; 99 drop table if exists mysql.tables_priv; 100 -- add it when the mysql is ready 101 -- create table mysql.A(a int); 102 -- add update,insert,delete 103 104 use information_schema; 105 drop table if exists KEY_COLUMN_USAGE; 106 drop table if exists COLUMNS; 107 drop table if exists PROFILING; 108 drop table if exists `PROCESSLIST`; 109 drop table if exists USER_PRIVILEGES; 110 drop table if exists SCHEMATA; 111 drop table if exists CHARACTER_SETS; 112 drop table if exists TRIGGERS; 113 drop table if exists TABLES; 114 create table A(a int); 115 drop table if exists INFORMATION_SCHEMA.KEY_COLUMN_USAGE; 116 drop table if exists INFORMATION_SCHEMA.COLUMNS; 117 drop table if exists INFORMATION_SCHEMA.PROFILING; 118 drop table if exists INFORMATION_SCHEMA.`PROCESSLIST`; 119 drop table if exists INFORMATION_SCHEMA.USER_PRIVILEGES; 120 drop table if exists INFORMATION_SCHEMA.SCHEMATA; 121 drop table if exists INFORMATION_SCHEMA.CHARACTER_SETS; 122 drop table if exists INFORMATION_SCHEMA.TRIGGERS; 123 drop table if exists INFORMATION_SCHEMA.TABLES; 124 create table INFORMATION_SCHEMA.A(a int); 125 -- add update,insert,delete