Changeset: 69f9ebe2c970 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=69f9ebe2c970 Added Files: sql/test/BugConstraints/Tests/add_constraint_1643522.test sql/test/BugConstraints/Tests/check_constraint.SF-1714829.test sql/test/BugConstraints/Tests/delete_primarykey_1643845.test sql/test/BugConstraints/Tests/drop_column_1643542.test sql/test/BugConstraints/Tests/update_primarykey_1643375.test Branch: mtest Log Message:
Converted BugConstraints tests diffs (142 lines): diff --git a/sql/test/BugConstraints/Tests/add_constraint_1643522.test b/sql/test/BugConstraints/Tests/add_constraint_1643522.test new file mode 100644 --- /dev/null +++ b/sql/test/BugConstraints/Tests/add_constraint_1643522.test @@ -0,0 +1,22 @@ +statement ok +create table t1(id int, name varchar(1024)) + +statement ok +alter table t1 add constraint id_p primary key(id) + +statement error +alter table t1 add constraint id_p primary key(id) + +query T rowsort +select name from sys.keys where name = 'id_p' +---- +id_p + +statement ok +drop table t1 + +query T rowsort +select name from sys.keys where name = 'id_p' +---- + + diff --git a/sql/test/BugConstraints/Tests/check_constraint.SF-1714829.test b/sql/test/BugConstraints/Tests/check_constraint.SF-1714829.test new file mode 100644 --- /dev/null +++ b/sql/test/BugConstraints/Tests/check_constraint.SF-1714829.test @@ -0,0 +1,7 @@ +statement error +create table t1 (id int CHECK (f1() = 1)) + +statement error +drop table t1 + + diff --git a/sql/test/BugConstraints/Tests/delete_primarykey_1643845.test b/sql/test/BugConstraints/Tests/delete_primarykey_1643845.test new file mode 100644 --- /dev/null +++ b/sql/test/BugConstraints/Tests/delete_primarykey_1643845.test @@ -0,0 +1,31 @@ +statement ok +create table t1(id int, name varchar(1024)) + +statement ok +alter table t1 add constraint id_p primary key(id) + +statement ok +create table t2(id_f int, age int, foreign key(id_f) references t1(id)) + +statement ok +alter table t2 add constraint age_p primary key(age) + +statement ok +insert into t1 values(1,'romulo') + +statement ok +insert into t2 values(1,33) + +statement error +insert into t2 values(2,33) + +statement error +delete from t1 where id = 1 + +statement ok +drop table t2 + +statement ok +drop table t1 + + diff --git a/sql/test/BugConstraints/Tests/drop_column_1643542.test b/sql/test/BugConstraints/Tests/drop_column_1643542.test new file mode 100644 --- /dev/null +++ b/sql/test/BugConstraints/Tests/drop_column_1643542.test @@ -0,0 +1,29 @@ +statement ok +create table t1(id int, name varchar(1024)) + +statement ok +alter table t1 add constraint id_p primary key(id) + +statement ok +create table t2(id_f int, age int, foreign key(id_f) references t1(id)) + +statement error +alter table t2 add constraint id_p primary key(id_f) + +statement ok +alter table t2 add constraint id_p_2 primary key(id_f) + +statement error +alter table t1 drop id + +query IT rowsort +select * from t1 +---- + +statement ok +drop table t2 + +statement ok +drop table t1 + + diff --git a/sql/test/BugConstraints/Tests/update_primarykey_1643375.test b/sql/test/BugConstraints/Tests/update_primarykey_1643375.test new file mode 100644 --- /dev/null +++ b/sql/test/BugConstraints/Tests/update_primarykey_1643375.test @@ -0,0 +1,28 @@ +statement ok +create table t1(id int, name varchar(1024)) + +statement ok +alter table t1 add constraint id_p primary key(id) + +statement ok +create table t2(id_f int, age int, foreign key(id_f) references t1(id)) + +statement ok +alter table t2 add constraint age_p primary key(age) + +statement ok +insert into t1 values(1,'romulo') + +statement ok +insert into t2 values(1,33) + +statement error +update t1 set id = 0 where id =1 + +statement ok +drop table t2 + +statement ok +drop table t1 + + _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list