github.com/matrixorigin/matrixone@v1.2.0/test/distributed/cases/ddl/alter_table_rename_column.result (about) 1 drop database if exists test; 2 create database test; 3 use test; 4 drop table if exists samecolumn01; 5 create table samecolumn01 (col1 int, col2 char); 6 alter table samecolumn01 rename column col1 to newColumn; 7 alter table samecolumn01 rename column col2 to newcolumn; 8 Duplicate column name 'newcolumn' 9 show create table samecolumn01; 10 Table Create Table 11 samecolumn01 CREATE TABLE `samecolumn01` (\n`newcolumn` INT DEFAULT NULL,\n`col2` CHAR(1) DEFAULT NULL\n) 12 show columns from samecolumn01; 13 Field Type Null Key Default Extra Comment 14 newcolumn INT(32) YES null 15 col2 CHAR(1) YES null 16 drop table samecolumn01; 17 drop table if exists rename01; 18 create table rename01 (col1 int, col2 decimal); 19 alter table rename01 rename column col1 to col1New; 20 show create table rename01; 21 Table Create Table 22 rename01 CREATE TABLE `rename01` (\n`col1new` INT DEFAULT NULL,\n`col2` DECIMAL(38,0) DEFAULT NULL\n) 23 show columns from rename01; 24 Field Type Null Key Default Extra Comment 25 col1new INT(32) YES null 26 col2 DECIMAL128(38) YES null 27 select table_name,COLUMN_NAME, data_type,is_nullable from information_schema.columns where table_name like 'name01' and COLUMN_NAME not like '__mo%'; 28 table_name column_name data_type is_nullable 29 drop table rename01; 30 drop table if exists rename02; 31 create table rename02 (`colcolcol1` int, `colcolcol2` binary); 32 insert into rename02 values (1, '2'); 33 insert into rename02 values (2, 'g'); 34 alter table rename02 rename column `colcolcol1` to `colcolcol1`; 35 show create table rename02; 36 Table Create Table 37 rename02 CREATE TABLE `rename02` (\n`colcolcol1` INT DEFAULT NULL,\n`colcolcol2` BINARY(1) DEFAULT NULL\n) 38 insert into rename02 (colcolcol1, colcolcol2) values (3, '7'); 39 delete from rename02 where colcolcol1 = 1; 40 update rename02 set colcolcol2 = '&' where colcolcol1 = 2; 41 select * from rename02; 42 colcolcol1 colcolcol2 43 3 7 44 2 & 45 show columns from rename02; 46 Field Type Null Key Default Extra Comment 47 colcolcol1 INT(32) YES null 48 colcolcol2 BINARY(1) YES null 49 select table_name,COLUMN_NAME, data_type,is_nullable from information_schema.columns where table_name like 'rename02' and COLUMN_NAME not like '__mo%'; 50 table_name column_name data_type is_nullable 51 rename02 colcolcol1 INT YES 52 rename02 colcolcol2 BINARY YES 53 drop table rename02; 54 drop table if exists rename03; 55 create table rename03(col1 int, col2 int, col3 varchar(20)); 56 insert into rename03 values (1,2,'cfewquier'); 57 insert into rename03 values (2,3,'329382'); 58 insert into rename03 values (3, 10, null); 59 select * from rename03; 60 col1 col2 col3 61 1 2 cfewquier 62 2 3 329382 63 3 10 null 64 alter table rename03 rename column col1 to col1New; 65 alter table rename03 rename column col3 to col3New; 66 show create table rename03; 67 Table Create Table 68 rename03 CREATE TABLE `rename03` (\n`col1new` INT DEFAULT NULL,\n`col2` INT DEFAULT NULL,\n`col3new` VARCHAR(20) DEFAULT NULL\n) 69 insert into rename03 (col1, col2, col3) values (3,4,'121131312'); 70 Unknown column 'col1' in 'rename03' 71 insert into rename03 (col1New, col2, col3New) values (3,4,'121131312'); 72 select * from rename03; 73 col1new col2 col3new 74 1 2 cfewquier 75 2 3 329382 76 3 10 null 77 3 4 121131312 78 update rename03 set col1New = 100 where col1New = 1; 79 update rename03 set col3New = '2798u3d3frew' where col3New = '6'; 80 delete from rename03 where col3New is null; 81 select * from rename03; 82 col1new col2 col3new 83 2 3 329382 84 3 4 121131312 85 100 2 cfewquier 86 show columns from rename03; 87 Field Type Null Key Default Extra Comment 88 col1new INT(32) YES null 89 col2 INT(32) YES null 90 col3new VARCHAR(20) YES null 91 select table_name,COLUMN_NAME, data_type,is_nullable from information_schema.columns where table_name like 'rename03' and COLUMN_NAME not like '__mo%'; 92 table_name column_name data_type is_nullable 93 rename03 col1new INT YES 94 rename03 col2 INT YES 95 rename03 col3new VARCHAR YES 96 drop table rename03; 97 drop table if exists rename04; 98 create table rename04(a int,b int); 99 insert into rename04 values(1,1); 100 alter table rename04 rename column a to newA; 101 show create table rename04; 102 Table Create Table 103 rename04 CREATE TABLE `rename04` (\n`newa` INT DEFAULT NULL,\n`b` INT DEFAULT NULL\n) 104 update rename04 set newA = 100 where b = 1; 105 select * from rename04; 106 newa b 107 100 1 108 alter table rename04 rename column newA to newnewA; 109 show create table rename04; 110 Table Create Table 111 rename04 CREATE TABLE `rename04` (\n`newnewa` INT DEFAULT NULL,\n`b` INT DEFAULT NULL\n) 112 insert into rename04 values (1, 3); 113 insert into rename04 values (1289,232); 114 update rename04 set a = 10000 where b = 1; 115 internal error: column 'a' not found in table 116 update rename04 set newnewA = 10000 where b = 1; 117 select * from rename04; 118 newnewa b 119 1 3 120 1289 232 121 10000 1 122 delet from rename04 where newnewa = 10000; 123 SQL parser error: You have an error in your SQL syntax; check the manual that corresponds to your MatrixOne server version for the right syntax to use. syntax error at line 1 column 5 near "delet from rename04 where newnewa = 10000;"; 124 select * from rename04; 125 newnewa b 126 1 3 127 1289 232 128 10000 1 129 show columns from rename04; 130 Field Type Null Key Default Extra Comment 131 newnewa INT(32) YES null 132 b INT(32) YES null 133 select table_name,COLUMN_NAME, data_type,is_nullable from information_schema.columns where table_name like 'rename04' and COLUMN_NAME not like '__mo%'; 134 table_name column_name data_type is_nullable 135 rename04 b INT YES 136 rename04 newnewa INT YES 137 drop table rename04; 138 drop table if exists rename06; 139 create table rename06(col1 int); 140 insert into rename06 values(1),(2); 141 alter table rename06 rename column col1 to ''; 142 SQL parser error: You have an error in your SQL syntax; check the manual that corresponds to your MatrixOne server version for the right syntax to use. syntax error at line 1 column 45 near " '';"; 143 alter table rename06 rename column col1 to ' '; 144 SQL parser error: You have an error in your SQL syntax; check the manual that corresponds to your MatrixOne server version for the right syntax to use. syntax error at line 1 column 46 near " ' ';"; 145 alter table rename06 rename column col1 to 数据库系统; 146 SQL parser error: You have an error in your SQL syntax; check the manual that corresponds to your MatrixOne server version for the right syntax to use. syntax error at line 1 column 44 near " 数据库系统;"; 147 alter table rename06 rename column col1 to 7327323467dhhjfkrnfe; 148 alter table rename06 rename column col1 to **&&^^%%^&**; 149 SQL parser error: You have an error in your SQL syntax; check the manual that corresponds to your MatrixOne server version for the right syntax to use. syntax error at line 1 column 44 near " **&&^^%^&**;"; 150 drop table rename06; 151 drop table if exists rename06; 152 create table rename06(col1 int); 153 insert into rename06 values(1),(2); 154 alter table rename06 rename column col1 to `数据库系统`; 155 alter table rename06 rename column col1 to `数据操作,数据收集7327323467dhhjfkrnfe`; 156 Unknown column 'col1' in 'rename06' 157 select table_name,COLUMN_NAME, data_type,is_nullable from information_schema.columns where table_name like 'rename06' and COLUMN_NAME not like '__mo%'; 158 table_name column_name data_type is_nullable 159 rename06 数据库系统 INT YES 160 show columns from rename06; 161 Field Type Null Key Default Extra Comment 162 数据库系统 INT(32) YES null 163 drop table rename06; 164 alter table system.statement_info rename column role_id to role_idNew; 165 internal error: do not have privilege to execute the statement 166 alter table mo_catalog.mo_database rename column dat_type to newdat_type; 167 internal error: do not have privilege to execute the statement 168 alter table mysql.procs_priv rename column grantor to newGrantor; 169 internal error: do not have privilege to execute the statement 170 drop table if exists primary01; 171 create table primary01 (col1 int primary key , col2 decimal); 172 insert into primary01 values (2389324, 32784329.4309403); 173 insert into primary01 values (3287, 89384038); 174 alter table primary01 rename column col1 to col1New; 175 show create table primary01; 176 Table Create Table 177 primary01 CREATE TABLE `primary01` (\n`col1new` INT NOT NULL,\n`col2` DECIMAL(38,0) DEFAULT NULL,\nPRIMARY KEY (`col1new`)\n) 178 insert into primary01 values (-2839, 8239802839.00000000); 179 insert into primary01 (col1New, col2) values (3287, 3293892.3232); 180 Duplicate entry '3287' for key 'col1new' 181 delete from primary01 where col1New = -2839; 182 update primary01 set col1 = 2873892 where col1New = 2389324; 183 internal error: column 'col1' not found in table 184 update primary01 set col1New = 2873892 where col1New = 2389324; 185 select * from primary01; 186 col1new col2 187 3287 89384038 188 2873892 32784329 189 show columns from primary01; 190 Field Type Null Key Default Extra Comment 191 col1new INT(32) NO PRI null 192 col2 DECIMAL128(38) YES null 193 select table_name,COLUMN_NAME, data_type,is_nullable from information_schema.columns where table_name like 'primary01' and COLUMN_NAME not like '__mo%'; 194 table_name column_name data_type is_nullable 195 primary01 col1new INT NO 196 primary01 col2 DECIMAL128 YES 197 drop table primary01; 198 drop table if exists foreign01; 199 create table foreign01(col1 int primary key, 200 col2 varchar(20), 201 col3 int, 202 col4 bigint); 203 drop table if exists foreign02; 204 create table foreign02(col1 int, 205 col2 int, 206 col3 int primary key, 207 constraint `c1` foreign key(col1) references foreign01(col1)); 208 show create table foreign01; 209 Table Create Table 210 foreign01 CREATE TABLE `foreign01` (\n`col1` INT NOT NULL,\n`col2` VARCHAR(20) DEFAULT NULL,\n`col3` INT DEFAULT NULL,\n`col4` BIGINT DEFAULT NULL,\nPRIMARY KEY (`col1`)\n) 211 show create table foreign02; 212 Table Create Table 213 foreign02 CREATE TABLE `foreign02` (\n`col1` INT DEFAULT NULL,\n`col2` INT DEFAULT NULL,\n`col3` INT NOT NULL,\nPRIMARY KEY (`col3`),\nCONSTRAINT `c1` FOREIGN KEY (`col1`) REFERENCES `foreign01` (`col1`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) 214 insert into foreign01 values(1,'sfhuwe',1,1); 215 insert into foreign01 values(2,'37829901k3d',2,2); 216 insert into foreign02 values(1,1,1); 217 insert into foreign02 values(2,2,2); 218 select * from foreign01; 219 col1 col2 col3 col4 220 1 sfhuwe 1 1 221 2 37829901k3d 2 2 222 select * from foreign02; 223 col1 col2 col3 224 1 1 1 225 2 2 2 226 alter table foreign01 rename column col1 to col1New; 227 alter table foreign02 rename column col1 to `Colnewcolumn`; 228 show create table foreign01; 229 Table Create Table 230 foreign01 CREATE TABLE `foreign01` (\n`col1new` INT NOT NULL,\n`col2` VARCHAR(20) DEFAULT NULL,\n`col3` INT DEFAULT NULL,\n`col4` BIGINT DEFAULT NULL,\nPRIMARY KEY (`col1new`)\n) 231 show create table foreign02; 232 Table Create Table 233 foreign02 CREATE TABLE `foreign02` (\n`colnewcolumn` INT DEFAULT NULL,\n`col2` INT DEFAULT NULL,\n`col3` INT NOT NULL,\nPRIMARY KEY (`col3`),\nCONSTRAINT `c1` FOREIGN KEY (`colnewcolumn`) REFERENCES `foreign01` (`col1new`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) 234 alter table foreign01 change col2 col2New varchar(100); 235 alter table foreign02 change col2 col2new double after col3; 236 insert into foreign01 values(3,'bcguwgheinwqneku678',2,2); 237 insert into foreign02 values(6,6,6); 238 internal error: Cannot add or update a child row: a foreign key constraint fails 239 delete from foreign01 where col2New = 'sfhuwe'; 240 internal error: Cannot delete or update a parent row: a foreign key constraint fails 241 delete from foreign02 where col2New = 2; 242 update foreign01 set col2 = 'database ewueh ' where col1 = 1; 243 internal error: column 'col2' not found in table 244 update foreign01 set col1new = 9283923 where col1new = 1; 245 internal error: Cannot delete or update a parent row: a foreign key constraint fails 246 select * from foreign01; 247 col1new col2new col3 col4 248 1 sfhuwe 1 1 249 2 37829901k3d 2 2 250 3 bcguwgheinwqneku678 2 2 251 select * from foreign02; 252 colnewcolumn col3 col2new 253 1 1 1.0 254 show create table foreign01; 255 Table Create Table 256 foreign01 CREATE TABLE `foreign01` (\n`col1new` INT NOT NULL,\n`col2new` VARCHAR(100) DEFAULT NULL,\n`col3` INT DEFAULT NULL,\n`col4` BIGINT DEFAULT NULL,\nPRIMARY KEY (`col1new`)\n) 257 show create table foreign02; 258 Table Create Table 259 foreign02 CREATE TABLE `foreign02` (\n`colnewcolumn` INT DEFAULT NULL,\n`col3` INT NOT NULL,\n`col2new` DOUBLE DEFAULT NULL,\nPRIMARY KEY (`col3`),\nCONSTRAINT `c1` FOREIGN KEY (`colnewcolumn`) REFERENCES `foreign01` (`col1new`) ON DELETE RESTRICT ON UPDATE RESTRICT\n) 260 show columns from foreign01; 261 Field Type Null Key Default Extra Comment 262 col1new INT(32) NO PRI null 263 col2new VARCHAR(100) YES null 264 col3 INT(32) YES null 265 col4 BIGINT(64) YES null 266 show columns from foreign02; 267 Field Type Null Key Default Extra Comment 268 colnewcolumn INT(32) YES MUL null 269 col3 INT(32) NO PRI null 270 col2new DOUBLE(0) YES null 271 select table_name,COLUMN_NAME, data_type,is_nullable from information_schema.columns where table_name like 'foreign01' and COLUMN_NAME not like '__mo%'; 272 table_name column_name data_type is_nullable 273 foreign01 col1new INT NO 274 foreign01 col2new VARCHAR YES 275 foreign01 col3 INT YES 276 foreign01 col4 BIGINT YES 277 select table_name,COLUMN_NAME, data_type,is_nullable from information_schema.columns where table_name like 'foreign02' and COLUMN_NAME not like '__mo%'; 278 table_name column_name data_type is_nullable 279 foreign02 col2new DOUBLE YES 280 foreign02 col3 INT NO 281 foreign02 colnewcolumn INT YES 282 drop table foreign02; 283 drop table foreign01; 284 drop table if exists index01; 285 CREATE TABLE index01(a INTEGER not null , b CHAR(10), c date, d decimal(7,2), UNIQUE KEY(a, b)); 286 show create table index01; 287 Table Create Table 288 index01 CREATE TABLE `index01` (\n`a` INT NOT NULL,\n`b` CHAR(10) DEFAULT NULL,\n`c` DATE DEFAULT NULL,\n`d` DECIMAL(7,2) DEFAULT NULL,\nUNIQUE KEY `a` (`a`,`b`)\n) 289 insert into index01 values(1, 'ab', '1980-12-17', 800); 290 insert into index01 values(2, 'ac', '1981-02-20', 1600); 291 insert into index01 values(3, 'ad', '1981-02-22', 500); 292 select * from index01; 293 a b c d 294 1 ab 1980-12-17 800.00 295 2 ac 1981-02-20 1600.00 296 3 ad 1981-02-22 500.00 297 alter table index01 rename column b to bNew; 298 show create table index01; 299 Table Create Table 300 index01 CREATE TABLE `index01` (\n`a` INT NOT NULL,\n`bnew` CHAR(10) DEFAULT NULL,\n`c` DATE DEFAULT NULL,\n`d` DECIMAL(7,2) DEFAULT NULL,\nUNIQUE KEY `a` (`a`,`bnew`)\n) 301 show index from index01; 302 Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression 303 index01 0 a 1 a A 0 NULL NULL YES NULL 304 index01 0 a 2 bnew A 0 NULL NULL YES YES NULL 305 insert into index01 (a, b, c, d) values (5, 'bh', '1999-01-01', 3000); 306 Unknown column 'b' in 'index01' 307 insert into index01 (a, bnew, c, d) values (5, 'bh', '1999-01-01', 3000); 308 select * from index01; 309 a bnew c d 310 1 ab 1980-12-17 800.00 311 2 ac 1981-02-20 1600.00 312 3 ad 1981-02-22 500.00 313 5 bh 1999-01-01 3000.00 314 delete from index01 where b = 'ab'; 315 invalid input: column b does not exist 316 delete from index01 where bneW = 'ab'; 317 select * from index01; 318 a bnew c d 319 2 ac 1981-02-20 1600.00 320 3 ad 1981-02-22 500.00 321 5 bh 1999-01-01 3000.00 322 update index01 set c = '2022-12-12' where bNew = 'ac'; 323 select * from index01; 324 a bnew c d 325 3 ad 1981-02-22 500.00 326 5 bh 1999-01-01 3000.00 327 2 ac 2022-12-12 1600.00 328 show columns from index01; 329 Field Type Null Key Default Extra Comment 330 a INT(32) NO MUL null 331 bnew CHAR(10) YES null 332 c DATE(0) YES null 333 d DECIMAL64(7) YES null 334 select table_name,COLUMN_NAME, data_type,is_nullable from information_schema.columns where table_name like 'index01' and COLUMN_NAME not like '__mo%'; 335 table_name column_name data_type is_nullable 336 index01 a INT NO 337 index01 bnew CHAR YES 338 index01 c DATE YES 339 index01 d DECIMAL64 YES 340 drop table index01; 341 drop table if exists index02; 342 CREATE TABLE index02(a INTEGER PRIMARY KEY, b CHAR(10), c date, d decimal(7,2), INDEX(a, b), KEY(c)); 343 insert into index02 values(1, 'ab', '1980-12-17', 800); 344 insert into index02 values(2, 'ac', '1981-02-20', 1600); 345 insert into index02 values(3, 'ad', '1981-02-22', 500); 346 select * from index02; 347 a b c d 348 1 ab 1980-12-17 800.00 349 2 ac 1981-02-20 1600.00 350 3 ad 1981-02-22 500.00 351 alter table index02 rename column b to bNewNew; 352 show create table index02; 353 Table Create Table 354 index02 CREATE TABLE `index02` (\n`a` INT NOT NULL,\n`bnewnew` CHAR(10) DEFAULT NULL,\n`c` DATE DEFAULT NULL,\n`d` DECIMAL(7,2) DEFAULT NULL,\nPRIMARY KEY (`a`),\nKEY `a` (`a`,`bnewnew`),\nKEY `c` (`c`)\n) 355 insert into index02 values (4, 'ab', '2000-10-10', 10000); 356 insert into index02 values (5, 'gh', '1999-12-31', 20000); 357 delete from index02 where bnewnew = 'ab'; 358 update index02 set bnewnew = 'database' where bnewnEW = 'ad'; 359 select * from index02; 360 a bnewnew c d 361 2 ac 1981-02-20 1600.00 362 5 gh 1999-12-31 20000.00 363 3 database 1981-02-22 500.00 364 show index from index02; 365 Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression 366 index02 1 a 1 a A 0 NULL NULL YES NULL 367 index02 1 a 2 bnewnew A 0 NULL NULL YES YES NULL 368 index02 1 c 1 c A 0 NULL NULL YES YES NULL 369 index02 0 PRIMARY 1 a A 0 NULL NULL YES NULL 370 show columns from index02; 371 Field Type Null Key Default Extra Comment 372 a INT(32) NO PRI null 373 bnewnew CHAR(10) YES null 374 c DATE(0) YES MUL null 375 d DECIMAL64(7) YES null 376 select table_name,COLUMN_NAME, data_type,is_nullable from information_schema.columns where table_name like 'index02' and COLUMN_NAME not like '__mo%'; 377 table_name column_name data_type is_nullable 378 index02 a INT NO 379 index02 bnewnew CHAR YES 380 index02 c DATE YES 381 index02 d DECIMAL64 YES 382 select * from index02; 383 a bnewnew c d 384 2 ac 1981-02-20 1600.00 385 5 gh 1999-12-31 20000.00 386 3 database 1981-02-22 500.00 387 drop table if exists cluster01; 388 create table cluster01(a tinyint primary key, b smallint signed, c int unsigned,d bigint not null); 389 insert into cluster01 (a, b, c, d) values (1, 255, 438, 7328832832); 390 alter table cluster01 rename column a to `NewA`; 391 alter table cluster01 rename column `newa` to `NewAAAAAAAA`; 392 show create table cluster01; 393 Table Create Table 394 cluster01 CREATE TABLE `cluster01` (\n`newaaaaaaaa` TINYINT NOT NULL,\n`b` SMALLINT DEFAULT NULL,\n`c` INT UNSIGNED DEFAULT NULL,\n`d` BIGINT NOT NULL,\nPRIMARY KEY (`newaaaaaaaa`)\n) 395 insert into cluster01 (a, b, c, d) values (-32, 32832, 8329, 893434); 396 Unknown column 'a' in 'cluster01' 397 insert into cluster01 (NewAAAAAAAA, b, c, d) values (-32, 32, 8329, 893434); 398 select * from cluster01; 399 newaaaaaaaa b c d 400 1 255 438 7328832832 401 -32 32 8329 893434 402 show columns from cluster01; 403 Field Type Null Key Default Extra Comment 404 newaaaaaaaa TINYINT(8) NO PRI null 405 b SMALLINT(16) YES null 406 c INT UNSIGNED(32) YES null 407 d BIGINT(64) NO null 408 select table_name,COLUMN_NAME, data_type,is_nullable from information_schema.columns where table_name like 'cluster01' and COLUMN_NAME not like '__mo%'; 409 table_name column_name data_type is_nullable 410 cluster01 b SMALLINT YES 411 cluster01 c INT UNSIGNED YES 412 cluster01 d BIGINT NO 413 cluster01 newaaaaaaaa TINYINT NO 414 drop table cluster01; 415 drop table if exists temporary01; 416 create table temporary01 (col1 int, col2 decimal); 417 insert into temporary01 (col1, col2) values (3728937, 37283.3232); 418 alter table temporary01 rename column col1 to `UUUYGGBBJBJ`; 419 insert into temporary01 (col1, col2) values (-32893, -89232); 420 Unknown column 'col1' in 'temporary01' 421 insert into temporary01 (`UUUYGGBBJBJ`, col2) values (-32893, -89232); 422 select * from temporary01; 423 uuuyggbbjbj col2 424 3728937 37283 425 -32893 -89232 426 show columns from temporary01; 427 Field Type Null Key Default Extra Comment 428 uuuyggbbjbj INT(32) YES null 429 col2 DECIMAL128(38) YES null 430 select table_name,COLUMN_NAME, data_type,is_nullable from information_schema.columns where table_name like 'temporary01' and COLUMN_NAME not like '__mo%'; 431 table_name column_name data_type is_nullable 432 temporary01 col2 DECIMAL128 YES 433 temporary01 uuuyggbbjbj INT YES 434 drop table temporary01; 435 drop table if exists ex_table_2_1; 436 create external table ex_table_2_1(num_col1 tinyint,num_col2 smallint,num_col3 int,num_col4 bigint,num_col5 tinyint unsigned,num_col6 smallint unsigned,num_col7 int unsigned,num_col8 bigint unsigned ,num_col9 float(5,3),num_col10 double(6,5),num_col11 decimal(38,19))infile{"filepath"='$resources/external_table_file/ex_table_2_1.csv'} fields terminated by ',' enclosed by '\"' lines terminated by '\n'; 437 alter table ex_table_2_1 rename column num_col1 to newnum_col1; 438 You have an error in your SQL syntax; check the manual that corresponds to your MatrixOne server version for the right syntax to use. error field terminator at line 13 column 109 near " '""' LINES TERMINATED BY '\\n'"; 439 alter table ex_table_2_1 rename column num_col2 to `shurhenwjkrferveg`; 440 You have an error in your SQL syntax; check the manual that corresponds to your MatrixOne server version for the right syntax to use. error field terminator at line 13 column 109 near " '""' LINES TERMINATED BY '\\n'"; 441 show create table ex_table_2_1; 442 Table Create Table 443 ex_table_2_1 CREATE EXTERNAL TABLE `ex_table_2_1` (\n`num_col1` TINYINT DEFAULT NULL,\n`num_col2` SMALLINT DEFAULT NULL,\n`num_col3` INT DEFAULT NULL,\n`num_col4` BIGINT DEFAULT NULL,\n`num_col5` TINYINT UNSIGNED DEFAULT NULL,\n`num_col6` SMALLINT UNSIGNED DEFAULT NULL,\n`num_col7` INT UNSIGNED DEFAULT NULL,\n`num_col8` BIGINT UNSIGNED DEFAULT NULL,\n`num_col9` FLOAT(5,3) DEFAULT NULL,\n`num_col10` DOUBLE(6,5) DEFAULT NULL,\n`num_col11` DECIMAL(38,19) DEFAULT NULL\n) INFILE{'FILEPATH'='','COMPRESSION'='','FORMAT'='','JSONDATA'=''} FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n' 444 select * from ex_table_2_1; 445 internal error: the input value 'abc' is not int8 type for column 0 446 drop table if exists view01; 447 drop table if exists view02; 448 drop view if exists v0; 449 create table view01 (a int); 450 insert into view01 values (1),(2); 451 create table view02 (a int); 452 insert into view02 values (1); 453 alter table view01 rename column a to `cwhuenwjfdwcweffcfwef`; 454 alter table view02 rename column a to `cwhuenwjfdwcweffcfwef`; 455 show columns from view01; 456 Field Type Null Key Default Extra Comment 457 cwhuenwjfdwcweffcfwef INT(32) YES null 458 show columns from view02; 459 Field Type Null Key Default Extra Comment 460 cwhuenwjfdwcweffcfwef INT(32) YES null 461 show create table view01; 462 Table Create Table 463 view01 CREATE TABLE `view01` (\n`cwhuenwjfdwcweffcfwef` INT DEFAULT NULL\n) 464 show create table view02; 465 Table Create Table 466 view02 CREATE TABLE `view02` (\n`cwhuenwjfdwcweffcfwef` INT DEFAULT NULL\n) 467 create view v0 as select view01.a, view02.a as b from view01 left join view02 using(a); 468 invalid input: column 'a' specified in USING clause does not exist in left table 469 create view v0 as select view01.cwhuenwjfdwcweffcfwef, view02.cwhuenwjfdwcweffcfwef as b from view01 left join view02 using(cwhuenwjfdwcweffcfwef); 470 show create view v0; 471 View Create View character_set_client collation_connection 472 v0 create view v0 as select view01.cwhuenwjfdwcweffcfwef, view02.cwhuenwjfdwcweffcfwef as b from view01 left join view02 using(cwhuenwjfdwcweffcfwef); utf8mb4 utf8mb4_general_ci 473 drop table view01; 474 drop table view02; 475 drop role if exists role_r1; 476 drop user if exists role_u1; 477 create role role_r1; 478 create user role_u1 identified by '111' default role role_r1; 479 drop table if exists rename01; 480 create table rename01(col1 int); 481 insert into rename01 values(1); 482 insert into rename01 values(2); 483 grant create database on account * to role_r1; 484 grant show databases on account * to role_r1; 485 grant connect on account * to role_r1; 486 grant select on table * to role_r1; 487 grant show tables on database * to role_r1; 488 use test; 489 alter table rename01 rename column col1 to newCol1; 490 internal error: do not have privilege to execute the statement 491 grant alter table on database * to role_r1; 492 use test; 493 alter table rename01 rename column col1 to newRename; 494 alter table rename01 rename column newRename to `newNewRename`; 495 show create table rename01; 496 Table Create Table 497 rename01 CREATE TABLE `rename01` (\n`newnewrename` INT DEFAULT NULL\n) 498 show columns from rename01; 499 Field Type Null Key Default Extra Comment 500 newnewrename INT(32) YES null 501 drop table rename01; 502 drop role role_r1; 503 drop user role_u1; 504 drop table if exists prepare01; 505 create table prepare01(col1 int, col2 char); 506 insert into prepare01 values (1,'a'),(2,'b'),(3,'c'); 507 prepare s1 from 'alter table prepare01 rename column col1 to col1dheuwhvcer'; 508 execute s1; 509 show create table prepare01; 510 Table Create Table 511 prepare01 CREATE TABLE `prepare01` (\n`col1dheuwhvcer` INT DEFAULT NULL,\n`col2` CHAR(1) DEFAULT NULL\n) 512 prepare s2 from 'alter table prepare01 rename column col1dheuwhvcer to col1'; 513 execute s2; 514 show create table prepare01; 515 Table Create Table 516 prepare01 CREATE TABLE `prepare01` (\n`col1` INT DEFAULT NULL,\n`col2` CHAR(1) DEFAULT NULL\n) 517 show columns from prepare01; 518 Field Type Null Key Default Extra Comment 519 col1 INT(32) YES null 520 col2 CHAR(1) YES null 521 update prepare01 set col1 = 2147483647 where col2 = 'c'; 522 delete from prepare01 where col2 = 'b'; 523 insert into prepare01 values (42342, '3'); 524 select * from prepare01; 525 col1 col2 526 1 a 527 2147483647 c 528 42342 3 529 drop table prepare01; 530 drop table if exists table03; 531 begin; 532 create table table03(col1 int, col2 char); 533 alter table table03 rename to NewCol1; 534 commit; 535 select * from NewCol1; 536 col1 col2 537 select col1 from NewCol1; 538 col1 539 drop table NewCol1; 540 drop database test;