github.com/matrixorigin/matrixone@v1.2.0/test/distributed/cases/tenant/clustertable2.result (about) 1 set global enable_privilege_cache = off; 2 drop database if exists db1; 3 create database db1; 4 create table db1.b(b int); 5 insert into db1.b values (0),(1),(2),(3); 6 drop account if exists account_test; 7 create account account_test admin_name = 'root' identified by '111' open comment 'account_test'; 8 use mo_catalog; 9 drop table if exists a; 10 create cluster table a(a int); 11 insert into a values(0,0),(1,0),(2,0),(3,0); 12 insert into a values(0,1),(1,1),(2,1),(3,1); 13 update a set account_id=(select account_id from mo_account where account_name="account_test") where account_id=1; 14 select a from a; 15 a 16 0 17 1 18 2 19 3 20 0 21 1 22 2 23 3 24 use mo_catalog; 25 select * from a; 26 a 27 0 28 1 29 2 30 3 31 delete from a; 32 use mo_catalog; 33 select * from a; 34 a 35 insert into a select b,0 from db1.b; 36 insert into a select b,1 from db1.b; 37 update a set account_id=(select account_id from mo_account where account_name="account_test") where account_id=1; 38 select a from a; 39 a 40 0 41 1 42 2 43 3 44 0 45 1 46 2 47 3 48 use mo_catalog; 49 select * from a; 50 a 51 0 52 1 53 2 54 3 55 delete from a; 56 load data infile '$resources/load_data/cluster_table1.csv' into table a fields terminated by ','; 57 update a set account_id=(select account_id from mo_account where account_name="account_test") where account_id=1; 58 select a from a; 59 a 60 0 61 0 62 0 63 0 64 0 65 0 66 0 67 0 68 use mo_catalog; 69 select * from a; 70 a 71 0 72 0 73 0 74 0 75 delete from a; 76 use mo_catalog; 77 select * from a; 78 a 79 delete from a; 80 truncate table a; 81 use mo_catalog; 82 delete from a; 83 internal error: only the sys account can insert/update/delete the cluster table 84 drop table a; 85 internal error: do not have privilege to execute the statement 86 truncate table a; 87 internal error: only the sys account can truncate the cluster table 88 drop account if exists account_test; 89 select a from a; 90 a 91 drop table if exists a; 92 drop account if exists account_test; 93 drop database if exists db1; 94 use mo_catalog; 95 CREATE CLUSTER TABLE `mo_instance` (`id` varchar(128) NOT NULL,`name` VARCHAR(255) NOT NULL,`account_name` varchar(128) NOT NULL,`provider` longtext NOT NULL,`provider_id` longtext,`region` longtext NOT NULL,`plan_type` longtext NOT NULL,`version` longtext,`status` longtext,`quota` longtext,`network_policy` longtext,`created_by` longtext,`created_at` datetime(3) NULL,PRIMARY KEY (`id`, `account_id`),UNIQUE INDEX `uniq_acc` (`account_name`)); 96 desc mo_catalog.mo_instance; 97 Field Type Null Key Default Extra Comment 98 id VARCHAR(128) NO PRI null 99 name VARCHAR(255) NO null 100 account_name VARCHAR(128) NO UNI null 101 provider TEXT(0) NO null 102 provider_id TEXT(0) YES null 103 region TEXT(0) NO null 104 plan_type TEXT(0) NO null 105 version TEXT(0) YES null 106 status TEXT(0) YES null 107 quota TEXT(0) YES null 108 network_policy TEXT(0) YES null 109 created_by TEXT(0) YES null 110 created_at DATETIME(3) YES null 111 account_id INT UNSIGNED(32) NO PRI null the account_id added by the mo 112 create account acc_idx ADMIN_NAME 'root' IDENTIFIED BY '123456'; 113 desc mo_catalog.mo_instance; 114 Field Type Null Key Default Extra Comment 115 id VARCHAR(128) NO PRI null 116 name VARCHAR(255) NO null 117 account_name VARCHAR(128) NO UNI null 118 provider TEXT(0) NO null 119 provider_id TEXT(0) YES null 120 region TEXT(0) NO null 121 plan_type TEXT(0) NO null 122 version TEXT(0) YES null 123 status TEXT(0) YES null 124 quota TEXT(0) YES null 125 network_policy TEXT(0) YES null 126 created_by TEXT(0) YES null 127 created_at DATETIME(3) YES null 128 account_id INT UNSIGNED(32) NO PRI null the account_id added by the mo 129 drop table mo_instance; 130 drop account if exists acc_idx; 131 use mo_catalog; 132 CREATE CLUSTER TABLE `mo_instance` (`id` varchar(128) NOT NULL,`name` VARCHAR(255) NOT NULL,`account_name` varchar(128) NOT NULL,`provider` longtext NOT NULL,`provider_id` longtext,`region` longtext NOT NULL,`plan_type` longtext NOT NULL,`version` longtext,`status` longtext,`quota` longtext,`network_policy` longtext,`created_by` longtext,`created_at` datetime(3) NULL,PRIMARY KEY (`id`, `account_id`),UNIQUE INDEX `uniq_acc` (`account_name`)); 133 create account acc_idx ADMIN_NAME 'root' IDENTIFIED BY '123456'; 134 SELECT mo_table_rows('mo_catalog', 'mo_instance') as t; 135 t 136 0 137 SELECT mo_table_size('mo_catalog', 'mo_instance') as t; 138 t 139 0 140 drop table mo_instance; 141 drop account if exists acc_idx; 142 set global enable_privilege_cache = on;