diff --git a/test/distributed/cases/ddl/alter_table_AddDrop_column.result b/test/distributed/cases/ddl/alter_table_AddDrop_column.result index 10f204ac8a2a9..16923c0bd122d 100644 --- a/test/distributed/cases/ddl/alter_table_AddDrop_column.result +++ b/test/distributed/cases/ddl/alter_table_AddDrop_column.result @@ -361,6 +361,15 @@ alter table transaction03 drop column d; no such table .transaction03 show create table transaction03; not connect to a database +show create table transaction03; +Table Create Table +transaction03 CREATE TABLE `transaction03` (\n`c` INT NOT NULL,\n`d` INT DEFAULT NULL,\nPRIMARY KEY (`c`)\n) +select * from transaction03; +c d +1 1 +2 2 +3 1 +4 2 drop table transaction03; drop table if exists transaction05; create table transaction05(a int not null auto_increment,b varchar(25) not null,c datetime,primary key(a),key bstr (b),key cdate (c) ); @@ -676,4 +685,30 @@ newrename CREATE TABLE `newrename` (\n`col1` INT DEFAULT NULL\n) drop table newRename; drop role role_r1; drop user role_u1; +drop table if exists table01; +begin; +create table table01(col1 int, col2 char); +insert into table01 values(1,'a'); +alter table table01 add column col3 int; +commit; +select * from table01; +col1 col2 col3 +1 a null +select col1 from table01; +col1 +1 +drop table table01; +drop table if exists table02; +begin; +create table table02(col1 int, col2 char); +insert into table02 values(1,'a'); +alter table table02 drop column col2; +commit; +select * from table02; +col1 +1 +select col1 from table02; +col1 +1 +drop table table02; drop database test; diff --git a/test/distributed/cases/ddl/alter_table_AddDrop_column.sql b/test/distributed/cases/ddl/alter_table_AddDrop_column.sql index dad11a1609804..aa52f101ac963 100644 --- a/test/distributed/cases/ddl/alter_table_AddDrop_column.sql +++ b/test/distributed/cases/ddl/alter_table_AddDrop_column.sql @@ -304,6 +304,8 @@ commit; alter table transaction03 drop column d; show create table transaction03; -- @session} +show create table transaction03; +select * from transaction03; drop table transaction03; -- transcation: w-w conflict @@ -573,4 +575,24 @@ drop table newRename; drop role role_r1; drop user role_u1; +-- begin, alter table add/drop column, commit, then select +drop table if exists table01; +begin; +create table table01(col1 int, col2 char); +insert into table01 values(1,'a'); +alter table table01 add column col3 int; +commit; +select * from table01; +select col1 from table01; +drop table table01; + +drop table if exists table02; +begin; +create table table02(col1 int, col2 char); +insert into table02 values(1,'a'); +alter table table02 drop column col2; +commit; +select * from table02; +select col1 from table02; +drop table table02; drop database test; diff --git a/test/distributed/cases/ddl/alter_table_add_drop_primary_key.result b/test/distributed/cases/ddl/alter_table_add_drop_primary_key.result index 8b03a724d665a..e4bb16a2a458b 100644 --- a/test/distributed/cases/ddl/alter_table_add_drop_primary_key.result +++ b/test/distributed/cases/ddl/alter_table_add_drop_primary_key.result @@ -486,3 +486,35 @@ col1 FLOAT(0) NO PRI null col5 INT(32) YES null col4 VARCHAR(100) YES null drop table mix01; +drop table if exists table01; +begin; +create table table01(col1 int, col2 decimal); +insert into table01 values(100,200); +insert into table01 values(200,300); +alter table table01 add constraint primary key (col2); +commit; +select * from table01; +col1 col2 +100 200 +200 300 +select col1 from table01; +col1 +100 +200 +drop table table01; +drop table if exists table01; +begin; +create table table01(col1 int primary key, col2 decimal); +insert into table01 values(100,200); +insert into table01 values(200,300); +alter table table01 drop primary key; +commit; +select * from table01; +col1 col2 +100 200 +200 300 +select col1 from table01; +col1 +100 +200 +drop table table01; diff --git a/test/distributed/cases/ddl/alter_table_add_drop_primary_key.sql b/test/distributed/cases/ddl/alter_table_add_drop_primary_key.sql index baedb529839dd..49b4a806ad235 100644 --- a/test/distributed/cases/ddl/alter_table_add_drop_primary_key.sql +++ b/test/distributed/cases/ddl/alter_table_add_drop_primary_key.sql @@ -300,4 +300,27 @@ update mix01 set newnewcol2 = 8290432.324 where newcol3 = 'd'; select * from mix01; show create table mix01; show columns from mix01; -drop table mix01; \ No newline at end of file +drop table mix01; + +-- begin, alter table add/drop primary key column, commit, then select +drop table if exists table01; +begin; +create table table01(col1 int, col2 decimal); +insert into table01 values(100,200); +insert into table01 values(200,300); +alter table table01 add constraint primary key (col2); +commit; +select * from table01; +select col1 from table01; +drop table table01; + +drop table if exists table01; +begin; +create table table01(col1 int primary key, col2 decimal); +insert into table01 values(100,200); +insert into table01 values(200,300); +alter table table01 drop primary key; +commit; +select * from table01; +select col1 from table01; +drop table table01; \ No newline at end of file diff --git a/test/distributed/cases/ddl/alter_table_change_column.result b/test/distributed/cases/ddl/alter_table_change_column.result index c856fdb370d16..e7872d20ce26e 100644 --- a/test/distributed/cases/ddl/alter_table_change_column.result +++ b/test/distributed/cases/ddl/alter_table_change_column.result @@ -2126,4 +2126,17 @@ mix01 col3 DATE YES mix01 col4 VARCHAR YES mix01 col5 INT YES drop table mix01; +drop table if exists table01; +begin; +create table table01(col1 int, col2 decimal); +insert into table01 values(100,200); +alter table table01 change column col1 NewCol1 float; +commit; +select * from table01; +newcol1 col2 +100.0 200 +select newcol1 from table01; +newcol1 +100.0 +drop table table01; drop database db2; diff --git a/test/distributed/cases/ddl/alter_table_change_column.sql b/test/distributed/cases/ddl/alter_table_change_column.sql index b82c54aebb774..6c77999c8a938 100644 --- a/test/distributed/cases/ddl/alter_table_change_column.sql +++ b/test/distributed/cases/ddl/alter_table_change_column.sql @@ -1150,4 +1150,14 @@ show create table mix01; select table_name,COLUMN_NAME, data_type,is_nullable from information_schema.columns where table_name like 'mix01' and COLUMN_NAME not like '__mo%'; drop table mix01; -drop database db2; \ No newline at end of file +-- begin, alter table change column, commit, then select +drop table if exists table01; +begin; +create table table01(col1 int, col2 decimal); +insert into table01 values(100,200); +alter table table01 change column col1 NewCol1 float; +commit; +select * from table01; +select newcol1 from table01; +drop table table01; +drop database db2; diff --git a/test/distributed/cases/ddl/alter_table_modify_column.result b/test/distributed/cases/ddl/alter_table_modify_column.result index 164cb108a417d..18a679a65033e 100644 --- a/test/distributed/cases/ddl/alter_table_modify_column.result +++ b/test/distributed/cases/ddl/alter_table_modify_column.result @@ -1689,5 +1689,18 @@ mix01 col3 DATE YES mix01 col4 VARCHAR YES mix01 col5 INT YES drop table mix01; +drop table if exists table01; +begin; +create table table01(col1 int, col2 decimal); +insert into table01 values(100,200); +alter table table01 modify column col1 float; +commit; +select * from table01; +col1 col2 +100.0 200 +select col1 from table01; +col1 +100.0 +drop table table01; drop database test; Can't drop database 'test'; database doesn't exist diff --git a/test/distributed/cases/ddl/alter_table_modify_column.sql b/test/distributed/cases/ddl/alter_table_modify_column.sql index 6aab6b8997e97..3a56ea03c31a6 100644 --- a/test/distributed/cases/ddl/alter_table_modify_column.sql +++ b/test/distributed/cases/ddl/alter_table_modify_column.sql @@ -969,4 +969,14 @@ show create table mix01; select table_name,COLUMN_NAME, data_type,is_nullable from information_schema.columns where table_name like 'mix01' and COLUMN_NAME not like '__mo%'; drop table mix01; +-- begin, alter table modify column, commit, then select +drop table if exists table01; +begin; +create table table01(col1 int, col2 decimal); +insert into table01 values(100,200); +alter table table01 modify column col1 float; +commit; +select * from table01; +select col1 from table01; +drop table table01; drop database test; \ No newline at end of file diff --git a/test/distributed/cases/ddl/alter_table_rename_column.result b/test/distributed/cases/ddl/alter_table_rename_column.result index f0e93ebe4c1e3..6318892f42aa9 100644 --- a/test/distributed/cases/ddl/alter_table_rename_column.result +++ b/test/distributed/cases/ddl/alter_table_rename_column.result @@ -527,4 +527,14 @@ col1 col2 2147483647 c 42342 3 drop table prepare01; +drop table if exists table03; +begin; +create table table03(col1 int, col2 char); +alter table table03 rename to NewCol1; +commit; +select * from NewCol1; +col1 col2 +select col1 from NewCol1; +col1 +drop table NewCol1; drop database test; diff --git a/test/distributed/cases/ddl/alter_table_rename_column.sql b/test/distributed/cases/ddl/alter_table_rename_column.sql index 7a1d3487fc6c8..54ce99bd3a48f 100644 --- a/test/distributed/cases/ddl/alter_table_rename_column.sql +++ b/test/distributed/cases/ddl/alter_table_rename_column.sql @@ -325,5 +325,14 @@ insert into prepare01 values (42342, '3'); select * from prepare01; drop table prepare01; +-- begin, alter table rename, commit, then select +drop table if exists table03; +begin; +create table table03(col1 int, col2 char); +alter table table03 rename to NewCol1; +commit; +select * from NewCol1; +select col1 from NewCol1; +drop table NewCol1; drop database test;