github.com/matrixorigin/matrixone@v1.2.0/test/distributed/cases/table/create_table.test (about) 1 2 create table table01(a TINYINT primary key, b SMALLINT SIGNED, c INT UNSIGNED,d BIGINT not null , e FLOAT,f DOUBLE, g CHAR(10), h VARCHAR(20)); 3 create table table15 (a varchar(5) default 'abcde'); 4 create temporary table table05 ( a int, b char(10)); 5 create table table06 (a int primary key, b varchar(10)); 6 create table table10 (a int primary key, b varchar(10)); 7 create table `测试表` (`测试1` int); 8 create table `table11 ` (a int); 9 create table table12 (`a ` int); 10 create table `a/a` (a int); 11 create table `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa int); 12 create table table14 (`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` int); 13 create table table16 (1a20 int,1e int); 14 create table $table18 (a$1 int, $b int, c$ int); 15 create table table19$ (a int); 16 create table table17 (`index` int); 17 create table account(a int); 18 show tables; 19 create table test01(a int primary key, b int) cluster by a; 20 -- @bvt:issue#9109 21 create table test01(a int, b int) cluster by a; 22 create table test02(a int, b int) cluster by b; 23 insert into test01 values(1,1),(2,2),(3,null),(null,4); 24 select * from test01; 25 insert into test02 select * from test01; 26 select * from test02; 27 update test02 set b=null where a=1; 28 select * from test02; 29 -- @bvt:issue 30 create table test03(a int, b int) cluster by c; 31 -- @bvt:issue#9109 32 create table test04(a int, b int, c varchar(10), unique key(a)) cluster by (b,c,a); 33 insert into test04 values(11,3,'bb'); 34 insert into test04 values(1,2,'a'); 35 insert into test04 values(2,2,''); 36 insert into test04 values(3,2,null); 37 select * from test04; 38 create table test06(a int, b int, c varchar(10)) cluster by (b,a,c); 39 insert into test06 select * from test04; 40 select * from test06; 41 update test06 set c=null where a=11; 42 select * from test06; 43 insert into test06 select * from test04; 44 select * from test06; 45 update test06 set c=a where b=2; 46 select * from test06; 47 -- @bvt:issue 48 create table test05(a int, b int, c varchar(10)) cluster by (b,c,d); 49 create temporary table test05(a int, b int, c varchar(10)) cluster by (b,c); 50 -- @bvt:issue#9109 51 show create table test01; 52 show create table test02; 53 show create table test04; 54 show create table test06; 55 desc test01; 56 desc test02; 57 desc test04; 58 desc test06; 59 drop table test01; 60 drop table test02; 61 drop table test04; 62 drop table test06; 63 -- @bvt:issue 64 drop table if exists t1; 65 create table t1(a int, b int, unique key(a), unique key(a, b)); 66 show create table t1; 67 drop table if exists t1; 68 create table t1(a int unique, b int unique key, unique key(a)); 69 show create table t1; 70 drop table t1; 71 72 drop table if exists t1; 73 CREATE TABLE t1 ( 74 col1 INT NOT NULL, 75 col2 DATE NOT NULL unique key, 76 col3 INT NOT NULL, 77 col4 INT NOT NULL, 78 PRIMARY KEY (col1), 79 unique key col2 (col3) 80 ); 81 drop table t1; 82 83 drop table if exists t1; 84 CREATE TABLE t1 ( 85 col1 INT NOT NULL, 86 col2 DATE NOT NULL, 87 col3 INT NOT NULL, 88 col4 INT NOT NULL, 89 PRIMARY KEY (col1), 90 unique key idx_sp1 (col2), 91 unique key idx_sp1 (col3) 92 ); 93 drop table t1; 94 95 drop table if exists t1; 96 CREATE TABLE t1 ( 97 col1 INT NOT NULL, 98 col2 DATE NOT NULL, 99 col3 INT NOT NULL, 100 col4 INT NOT NULL, 101 PRIMARY KEY (col1), 102 unique key idx_sp1 (col2), 103 key idx_sp1 (col3) 104 ); 105 drop table t1; 106 107 drop table if exists t1; 108 CREATE TABLE t1 ( 109 col1 INT NOT NULL, 110 col2 DATE NOT NULL UNIQUE KEY, 111 col3 INT NOT NULL, 112 col4 INT NOT NULL, 113 PRIMARY KEY (col1), 114 KEY col2 (col3) 115 ); 116 drop table t1; 117 118 drop table if exists t1; 119 CREATE TABLE t1 ( 120 col1 INT NOT NULL KEY, 121 col2 DATE NOT NULL KEY, 122 col3 INT NOT NULL, 123 col4 INT NOT NULL 124 ); 125 drop table t1; 126 127 drop table if exists t2; 128 CREATE TABLE t2 ( 129 `PRIMARY` INT NOT NULL, 130 col2 DATE NOT NULL, 131 col3 INT NOT NULL, 132 col4 INT NOT NULL, 133 UNIQUE KEY (`PRIMARY`), 134 UNIQUE KEY (`PRIMARY`, col3) 135 ); 136 drop table t2; 137 138 -- ascii 0 139 create table t1 (`a` varchar(255) DEFAULT b'0'); 140 desc t1; 141 insert into t1 values (); 142 select * from t1; 143 select hex(a) from t1; 144 drop table t1; 145 146 -- char 0 147 create table t1 (`a` varchar(255) DEFAULT x'30'); 148 desc t1; 149 insert into t1 values (); 150 select * from t1; 151 select hex(a) from t1; 152 drop table t1; 153 154 drop table if exists products; 155 create table products ( 156 pid int not null, 157 pname varchar(50) not null, 158 description varchar(20) not null, 159 price decimal(9,2) not null); 160 desc products; 161 drop table products; 162 163 drop database if exists test_creatsql; 164 create database test_creatsql; 165 use test_creatsql; 166 /*comments*/create table /*comments*/ t(a int)/*comments*/; 167 select rel_createsql from mo_catalog.mo_tables where relname = 't' and reldatabase = 'test_creatsql'; 168 drop database test_creatsql;