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